/* Base styles and CSS variables */
:root {
    --primary-color: #4a90e2;
    --background-color: #ffffff;
    --text-color: #333333;
    --border-color: #e0e0e0;
    --input-bg: #ffffff;
    --card-bg: #f5f5f5;
    --shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Dark mode variables */
[data-theme="dark"] {
    --primary-color: #64b5f6;
    --background-color: #1a1a1a;
    --text-color: #ffffff;
    --border-color: #404040;
    --input-bg: #2d2d2d;
    --card-bg: #2d2d2d;
    --shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    transition: background-color 0.3s, color 0.3s;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

/* Header styles */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

h1 {
    font-size: 1.8rem;
    color: var(--primary-color);
}

#darkModeToggle {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: background-color 0.3s;
}

#darkModeToggle:hover {
    background-color: var(--card-bg);
}

[data-theme="dark"] .moon {
    display: none;
}

[data-theme="light"] .sun {
    display: none;
}

/* Form styles */
.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

select,
textarea,
input[type="date"] {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--input-bg);
    color: var(--text-color);
    font-size: 1rem;
    transition: border-color 0.3s;
}

textarea {
    height: 100px;
    resize: vertical;
}

select:focus,
textarea:focus,
input[type="date"]:focus {
    outline: none;
    border-color: var(--primary-color);
}

button[type="submit"] {
    background-color: var(--primary-color);
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    width: 100%;
    transition: background-color 0.3s;
}

button[type="submit"]:hover {
    background-color: #357abd;
}

/* Homework list styles */
.homework-list {
    margin-top: 3rem;
}

.homework-list h2 {
    margin-bottom: 1.5rem;
    color: var(--primary-color);
}

.homework-item {
    background-color: var(--card-bg);
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    box-shadow: var(--shadow);
}

.homework-item h3 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.homework-item p {
    margin-bottom: 0.5rem;
}

.homework-item .due-date {
    color: var(--primary-color);
    font-weight: 500;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    margin: 20px auto;
    animation: spin 1s linear infinite;
    display: none;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.new-homework {
    animation: slideIn 0.5s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.delete-button {
    background-color: #e74c3c;
    color: white;
    border: none;
    padding: 5px 10px;
    cursor: pointer;
    border-radius: 3px;
    margin-left: 10px;
    }
    .delete-button:hover {
    background-color: #c0392b;
    }

/* Responsive design */
@media (max-width: 768px) {
    .container {
        padding: 16px;
    }

    h1 {
        font-size: 1.5rem;
    }

    button[type="submit"] {
        padding: 10px 20px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 12px;
    }

    h1 {
        font-size: 1.3rem;
    }

    .form-group {
        margin-bottom: 1rem;
    }

    select,
    textarea,
    input[type="date"] {
        padding: 10px;
    }
}

/* iPad specific styles */
@media (min-width: 768px) and (max-width: 1024px) {
    .container {
        max-width: 90%;
    }

    .form-group {
        margin-bottom: 2rem;
    }

    select,
    textarea,
    input[type="date"] {
        font-size: 1.1rem;
        padding: 14px;
    }

    button[type="submit"] {
        padding: 14px 28px;
        font-size: 1.1rem;
    }
}

/* Overlay für den Stundenplan */
#scheduleOverlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 1000;
  }
  /* Container, in dem das iFrame mittig positioniert wird */
  #scheduleContainer {
    position: relative;
    width: 100%;
    height: 100%;
  }
  /* iFrame füllt den Container */
  #scheduleContainer iframe {
    width: 100%;
    height: 100%;
    border: none;
  }
  /* "X" Schließ-Button */
  #closeSchedule {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #fff;
    color: #000;
    border: none;
    font-size: 24px;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    z-index: 1100;
  }
  /* Style für den Button, der den Stundenplan öffnet */
  #showSchedule {
    padding: 10px 20px;
    font-size: 16px;
    background-color: #007BFF;
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
  }

  /* Overlay für den Vertretungsplan */
#VerOverlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 1000;
  }
  /* Container, in dem das iFrame mittig positioniert wird */
  #VerContainer {
    position: relative;
    width: 100%;
    height: 100%;
  }
  /* iFrame füllt den Container */
  #VerContainer iframe {
    width: 100%;
    height: 100%;
    border: none;
  }
  /* "X" Schließ-Button */
  #closeVer {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #fff;
    color: #000;
    border: none;
    font-size: 24px;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    z-index: 1100;
  }
  /* Style für den Button, der den Stundenplan öffnet */
  #showVer {
    padding: 10px 20px;
    font-size: 16px;
    background-color: #007BFF;
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
  }

  #KalOverlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 1000;
  }
  /* Container, in dem das iFrame mittig positioniert wird */
  #KalContainer {
    position: relative;
    width: 100%;
    height: 100%;
  }
  /* iFrame füllt den Container */
  #KalContainer iframe {
    width: 100%;
    height: 100%;
    border: none;
  }
  /* "X" Schließ-Button */
  #closeKal {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #fff;
    color: #000;
    border: none;
    font-size: 24px;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    z-index: 1100;
  }
  /* Style für den Button, der den Stundenplan öffnet */
  #showKal {
    padding: 10px 20px;
    font-size: 16px;
    background-color: #007BFF;
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
  }

