:root {
    /* Light theme (default) */
    --primary: #ffffff;
    --primary-title: #000000
    --primary-dark: #1E429F;
    --primary-light: #0056d6;
    --background: #FFFFFF;
    --foreground: #1A202C;
    --card-bg: #F7FAFC;
    --border: #E2E8F0;
    --muted: #718096;
    --accent: #3C66F5;
    --error: #E53E3E;
    --header: #4C49F5;
}

/* Dark theme colors */
.dark-theme {
    --primary: #ffffff;
    --primary-title: #ffffff
    --primary-dark: #2C4FD3;
    --primary-light: #172554;
    --background: #1A202C;
    --foreground: #F7FAFC;
    --card-bg: #2D3748;
    --border: #4A5568;
    --muted: #A0AEC0;
    --accent: #4C6EF5;
    --error: #FC8181;
    --header: #4C49F5;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
#weekrooster-title {
    color: var(--primary-title);
    text-align: center;
}

#current-week {
    text-align: center;
    margin-bottom: 20px;

}
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--background);
    color: var(--foreground);
    line-height: 1.5;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Header styles */
header {
    background-color: var(--header);
    color: white;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    position: relative;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Hamburger menu styles */
.hamburger-menu {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: 5px;
}

.hamburger-menu span {
    width: 25px;
    height: 3px;
    background-color: white;
    margin: 3px 0;
    transition: 0.3s;
}

.hamburger-menu.active span:nth-child(1) {
    transform: rotate(-45deg) translate(-5px, 6px);
}

.hamburger-menu.active span:nth-child(2) {
    opacity: 0;
}

.hamburger-menu.active span:nth-child(3) {
    transform: rotate(45deg) translate(-5px, -6px);
}

/* Mobile navigation */
.mobile-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: var(--header);
    z-index: 1000;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-in-out;
}

.mobile-nav.active {
    max-height: 300px;
}

.mobile-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mobile-nav li {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.mobile-nav a {
    display: block;
    padding: 15px 20px;
    color: white;
    text-decoration: none;
    transition: background-color 0.2s;
}

.mobile-nav a:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

#schedule-switcher {
    width: 100%;
    padding: 10px 20px;
    display: flex;
    gap: 10px;
    align-items: center;
    background-color: var(--background);
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}

.schedule-container {
    display: flex;
    align-items: center;
    gap: 5px;
}

.schedule-add-btn, .schedule-switch-btn {
    background: none;
    border: none;
    color: var(--foreground);
    padding: 5px 10px;
    cursor: pointer;
    font-size: 14px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.schedule-delete-btn {
    background: none;
    border: none;
    color: var(--error);
    cursor: pointer;
    font-size: 18px;
    padding: 2px 5px;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.schedule-delete-btn:hover {
    background-color: rgba(255, 0, 0, 0.1);
}

.schedule-add-btn:hover, .schedule-switch-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.schedule-switch-btn.active {
    background-color: rgba(255, 255, 255, 0.2);
}

.nav {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
}

.navdiv {
    aling-items: center;
    display: flex;
    justify-content: center; /* Centraal in de navdiv */
}

.headerul {
  display: flex;
  gap: 1.5rem; /* optioneel: ruimte tussen de links */
  list-style: none;
  margin: 0;
  padding: 0;
  justify-content: center; /* Centraal in de ul */
  align-items: center;
}
.headerlink {
    color: white;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    position: relative;
    transition: color 0.5s ease;
}

.headerlink:hover {
    color: gray;
    transition: color 0.2s ease;
}



.headerlink::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background-color: gray;
    transition: width 0.3s ease;
}

.headerlink:hover::after {
    width: 100%;
}

.logo {
    font-size: 14px;
}

#theme-toggle-btn {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 5px;
}

.moon-icon {
    display: none;
}

.dark-theme .sun-icon {
    display: none;
}

.dark-theme .moon-icon {
    display: block;
}

/* Main content styles */
main {
    padding-top: 4rem;
    padding-bottom: 2rem;
    min-height: 100vh;
}

/* Calendar section */
.calendar-section {
    text-align: center;
    padding: 1.5rem 0;
}

.calendar-section h1 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--primary);
}

.week-display {
    margin-bottom: 1rem;
    color: var(--muted);
    font-size: 0.875rem;
}

.week-navigation {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.btn {
    background-color: blue;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 0.25rem;
    cursor: pointer;
    font-size: 0.875rem;
    transition: background-color 0.2s;
}

/* Notes styles */
.notes-container {
    max-width: 800px;
    margin: 2rem auto;
    padding: 1rem;
}

.notes-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

#note-title {
    padding: 0.5rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--background);
    color: var(--foreground);
}

#note-content {
    min-height: 150px;
    padding: 0.5rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--background);
    color: var(--foreground);
    resize: vertical;
}

.note-item {
    padding: 1rem;
    margin-bottom: 1rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--background);
    position: relative;
}

.note-item h3 {
    margin: 0 0 0.5rem 0;
}

.note-item small {
    color: var(--muted);
    display: block;
    margin-top: 0.5rem;
}

.note-item .delete-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: none;
    border: none;
    color: var(--error);
    cursor: pointer;
    font-size: 1.2rem;
}

.btn:hover {
    background-color: rgb(0, 0, 220);
}

.btn:active {
    background-color: rgb(0, 0, 180);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Current time indicator */
.current-time-cell {
    background-color: rgba(255, 215, 0, 0.2);
    position: relative;
}

.current-time-cell.leswissel {
    background-color: rgba(255, 215, 0, 0.1);
}

.current-time-cell::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 2px;
    background-color: #FFD700;
}

/* Schedule table */
.schedule-container {
    overflow-x: hidden;
    background-color: var(--card-bg);
    border-radius: 0.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    position: relative;
}

#schedule-table {
    transform: translateX(0);
    will-change: transform;
    transition: transform 0.3s ease-in-out;
    position: relative;
}

#schedule-body tr:nth-child(even) {
    background-color: rgba(0, 0, 0, 0.03);
}

.dark-theme #schedule-body tr:nth-child(even) {
    background-color: rgba(255, 255, 255, 0.03);
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 0.75rem;
    text-align: center;
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

th {
    background-color: var(--primary-light);
    color: var(--primary);
    font-size: 0.875rem;
    font-weight: 600;
}

.time-cell {
    width: 100px;
    text-align: left;
}

.schedule-block {
    background-color: var(--primary-light);
    border-radius: 0.25rem;
    padding: 0.5rem;
    font-size: 0.75rem;
    color: var(--primary);
    position: relative;
    min-height: 4.5em;
    line-height: 1.5em;
    display: flex;
    flex-direction: column;
}

.schedule-block.break {
    min-height: 1.5em !important;
    background-color: #4A5568;
    font-size: 0.65rem;
    padding: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.event-info {
    margin-right: 25px;
}

.note-toggle {
    position: absolute;
    top: 5px;
    right: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px;
    font-size: 12px;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.note-toggle:hover {
    opacity: 1;
}

.color-toggle {
    position: absolute;
    top: 25px;
    right: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px;
    font-size: 12px;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.color-toggle:hover {
    opacity: 1;
}

.note-area {
    width: 100%;
    margin-top: 0.5rem;
    padding: 0.25rem;
    border: 1px solid var(--border);
    border-radius: 0.25rem;
    font-size: 0.75rem;
    background-color: var(--background);
    color: var(--foreground);
    resize: vertical;
    min-height: 50px;
}

.note-area.hidden {
    display: none;
}

.color-picker {
    position: absolute;
    top: 45px;
    right: 5px;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px;
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 6px;
    z-index: 100;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    min-width: 200px;
    max-width: 240px;
    max-height: 350px;
    overflow-y: auto;
}

.color-picker.hidden {
    display: none;
}

.color-option {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
    position: relative;
}

.color-option:hover {
    transform: scale(1.15);
    border-color: var(--foreground);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.color-option.clear-color {
    background: var(--background);
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    color: var(--foreground);
    grid-column: span 2;
    width: auto;
}

.color-option.clear-color:hover {
    background: var(--error);
    color: white;
    transform: scale(1.05);
}

/* Loading indicator */
.loading-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    color: var(--muted);
}

.spinner {
    border: 3px solid var(--border);
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    width: 2rem;
    height: 2rem;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

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

/* Error message */
.error-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    color: var(--error);
    text-align: center;
    padding: 1rem;
}

.error-message svg {
    margin-bottom: 1rem;
}

/* Calendar settings button */
.calendar-settings {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 20;
}

.btn-circle {
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    background-color: var(--primary);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: background-color 0.2s, transform 0.2s;
}

.btn-circle:hover {
    background-color: var(--primary-dark);
    transform: scale(1.05);
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 30;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background-color: var(--card-bg);
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    padding: 24px;
}

.modal-help {
    margin-top: 1rem;
    font-size: 0.9rem;
    text-align: center;
}

.modal-help a {
    color: var(--primary);
    text-decoration: none;
}

.modal-help a:hover {
    text-decoration: underline;
}

.modal-content h2 {
    font-size: 1.5rem;
    color: var(--foreground);
    margin-bottom: 20px;
    text-align: center;
}

.close-button {
    position: absolute;
    right: 20px;
    top: 20px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--muted);
    transition: color 0.2s;
}

.close-button:hover {
    color: var(--foreground);
}

#name-input,
#calendar-url-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 16px;
    background-color: var(--background);
    color: var(--foreground);
    margin-bottom: 20px;
    transition: border-color 0.2s;
}

#calendar-url-input:focus {
    outline: none;
    border-color: blue;
}

#save-calendar-btn {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 8px;
    background-color: blue;
    color: white;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.2s, background-color 0.2s;
}

#save-calendar-btn:hover {
    transform: translateY(-1px);
    background-color: rgb(0, 0, 220);
}

.modal-footer {
    padding: 1rem;
    display: flex;
    justify-content: flex-end;
    border-top: 1px solid var(--border);
}

/* Chat styles */
.chat-container {
    height: calc(100vh - 60px);
    overflow: hidden;
}

.chat-container iframe {
    transition: filter 0.3s ease;
    width: 100%;
    height: 100%;
    border: none;
}

/* In light mode, invert the chat for better visibility */
.chat-container iframe {
    filter: invert(1) hue-rotate(180deg);
}

/* In dark mode, show normal colors */
.dark-theme .chat-container iframe {
    filter: none;
}

/* Utility classes */
.hidden {
    display: none;
}

/* Readme styles */
.readme-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
}

.readme-content h1 {
    color: var(--primary-title);
    margin-bottom: 1.5rem;
    font-size: 2.5rem;
}

.readme-content h2 {
    color: var(--primary-title);
    margin: 2rem 0 1rem;
    font-size: 1.8rem;
}

.readme-content p {
    margin-bottom: 1rem;
    line-height: 1.6;
}

.readme-content ul, 
.readme-content ol {
    margin: 1rem 0;
    padding-left: 2rem;
}

.readme-content li {
    margin-bottom: 0.5rem;
}

.readme-content a {
    color: var(--primary);
    text-decoration: none;
}

.readme-content a:hover {
    text-decoration: underline;
}

/* Todo styles */
.todo-container {
  max-width: 600px;
  margin: 2rem auto;
  padding: 1rem;
}

#todo-form {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
}

#todo-input {
  flex: 1;
  padding: 0.5rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--background);
  color: var(--foreground);
}

#todo-form button {
  padding: 0.5rem 1rem;
  background: blue;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

#todo-list {
  list-style: none;
  padding: 0;
}

#todo-list li {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.5rem;
  border-bottom: 1px solid var(--border);
}

#todo-list input[type="checkbox"] {
  cursor: pointer;
}

#todo-list .completed {
  text-decoration: line-through;
  opacity: 0.7;
}

#todo-list .delete-btn {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--error);
  cursor: pointer;
  font-size: 1.2rem;
}

/* Mobile schedule styles */
.mobile-schedule-container {
    display: none;
}

.day-navigation {
    display: none;
    justify-content: space-between;
    align-items: center;
    margin: 1rem 0;
    padding: 0 1rem;
}

.day-navigation button {
    background: var(--primary-light);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
}

.day-navigation button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.current-day-display {
    font-weight: bold;
    color: var(--foreground);
    font-size: 1.1rem;
}

.mobile-schedule-table {
    width: 100%;
    border-collapse: collapse;
}

.mobile-schedule-table th {
    background-color: var(--primary-light);
    color: var(--primary);
    padding: 0.75rem;
    text-align: left;
}

.mobile-schedule-table td {
    padding: 0.5rem;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}

.mobile-current-time-row {
    background-color: rgba(255, 215, 0, 0.2);
}

.mobile-current-time-row .mobile-time-cell {
    border-left: 3px solid #FFD700;
    font-weight: bold;
    color: var(--primary);
}

.mobile-current-time-row .mobile-event-cell {
    background-color: rgba(255, 215, 0, 0.1);
}

.mobile-time-cell {
    width: 100px;
    font-weight: bold;
    color: var(--muted);
}

.mobile-event-cell {
    width: calc(100% - 100px);
}

/* Media queries for responsive design */
@media (max-width: 768px) {
    /* Hide hamburger menu and show mobile nav */
    .hamburger-menu {
        display: flex;
    }
    
    .nav {
        display: none;
    }
    
    /* Hide desktop schedule, show mobile schedule */
    .schedule-container {
        display: none;
    }
    
    #schedule-table-container {
        display: none;
    }
    
    .mobile-schedule-container {
        display: block;
    }
    
    .day-navigation {
        display: flex;
    }
    
    /* Hide week navigation on mobile */
    .week-navigation {
        display: none;
    }
    
    /* Show schedule switcher on mobile */
    #schedule-switcher {
        display: flex;
        flex-direction: row;
        gap: 8px;
        padding: 10px;
        flex-wrap: wrap;
        align-items: center;
    }
    
    .schedule-container {
        display: flex;
        align-items: center;
        gap: 5px;
    }
    
    .schedule-switch-btn {
        padding: 8px 12px;
        font-size: 0.9rem;
        white-space: nowrap;
    }
    
    .schedule-add-btn {
        padding: 8px 12px;
        font-size: 0.9rem;
        white-space: nowrap;
    }

    .time-cell {
        width: 80px;
    }

    th, td {
        padding: 0.5rem 0.25rem;
        font-size: 0.75rem;
    }

    .schedule-block {
        padding: 0.25rem;
        font-size: 0.7rem;
    }
    
    /* Mobile specific adjustments */
    .calendar-settings {
        bottom: 1rem;
        right: 1rem;
    }
    
    .btn-circle {
        width: 2.5rem;
        height: 2.5rem;
    }
    
    main {
        padding-top: 2rem;
    }
    
    .container {
        padding: 0 0.5rem;
    }
}

/* Learning Resources Styles */
.learning-resources {
    max-width: 800px;
    margin: 0 auto;
}

.learning-resources h2 {
    color: var(--primary);
    margin: 2rem 0 1rem 0;
    font-size: 1.5rem;
}

.resource-links {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.resource-link {
    display: block;
    background-color: var(--header);
    color: white;
    text-decoration: none;
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

.resource-link:hover {
    background-color: var(--primary-dark, #3a37c4);
}

.add-link-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
    max-width: 400px;
}

.add-link-form input {
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    background-color: var(--background);
    color: var(--foreground);
}

.all-links {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.custom-link-item {
    position: relative;
    display: block;
}

.delete-link-btn {
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    background: rgba(255, 0, 0, 0.7);
    color: white;
    border: none;
    border-radius: 50%;
    width: 25px;
    height: 25px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.delete-link-btn:hover {
    background: rgba(255, 0, 0, 0.9);
}

/* Updates Page Styles */
.releases {
    max-width: 800px;
    margin: 0 auto;
}

.release {
    background-color: var(--card-background, rgba(255, 255, 255, 0.05));
    padding: 1.5rem;
    margin-bottom: 1rem;
    border-radius: 8px;
    border-left: 4px solid var(--foreground);
}

.release h3 {
    color: var(--primary-title);
    margin: 0 0 0.5rem 0;
    font-size: 1.2rem;
}

.release p {
    margin: 0;
    color: var(--foreground);
}

/* Footer Styles */
footer {
    background-color: var(--header);
    color: white;
    text-align: center;
    padding: 1rem;
    margin-top: 2rem;
}

footer a {
    color: var(--primary);
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

@media (max-width: 768px) {
    .add-link-form {
        max-width: 100%;
    }
}
