/* --- Dynamic Bundle (css) v1.0.4 --- */
/* Loading 7 files in specific order. */

/* --- File: css/base.css --- */

/* === БАЗОВЫЕ СТИЛИ === */
body {
    font-family: 'Inter', sans-serif;
    transition: background-color 0.3s ease, color 0.3s ease;
    
    /* (NEON BACKGROUND) Базовий фон */
    background-color: #f3f4f6;
    min-height: 100vh;
}

/* === (НОВЕ) Примусове виправлення для перемикання теми === */
html.dark body {
    /* (NEON BACKGROUND) Живий градієнтний фон для темної теми */
    background: linear-gradient(-45deg, #0f172a, #1e1b4b, #111827, #312e81);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    
    color: #f3f4f6 !important;
    
    /* Змінні для неонового ефекту */
    --neon-primary: #3b82f6; 
    --neon-shadow-sm: 0 0 5px rgba(59, 130, 246, 0.5);
    --neon-shadow-md: 0 0 15px rgba(59, 130, 246, 0.4), 0 0 6px rgba(59, 130, 246, 0.2);
    --neon-shadow-lg: 0 0 25px rgba(59, 130, 246, 0.5), 0 0 10px rgba(59, 130, 246, 0.3);
    --neon-border: 1px solid rgba(59, 130, 246, 0.4);
}

@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

html:not(.dark) body {
    background-color: #f3f4f6 !important;
    color: #1f2937 !important;
}

/* === (NEON) КАСТОМНИЙ СКРОЛБАР === */
/* Webkit (Chrome, Safari, Edge) */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #f3f4f6; 
}
html.dark ::-webkit-scrollbar-track {
    background: #111827; /* Темний трек */
}

::-webkit-scrollbar-thumb {
    background: #d1d5db; 
    border-radius: 5px;
}
html.dark ::-webkit-scrollbar-thumb {
    background: #374151; /* Темно-сірий повзунок */
    border: 2px solid #111827; /* Відступ від краю */
}
html.dark ::-webkit-scrollbar-thumb:hover {
    background: #3b82f6; /* (NEON) Синій при наведенні */
    box-shadow: 0 0 10px #3b82f6;
}

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: #d1d5db #f3f4f6;
}
html.dark * {
    scrollbar-color: #374151 #111827;
}


/* === Глобальна анімація неону === */
@keyframes neon-border-shadow-flow {
    0% {
        border-color: rgba(59, 130, 246, 0.5); /* Blue */
        box-shadow: 0 0 15px rgba(59, 130, 246, 0.3), inset 0 0 10px rgba(59, 130, 246, 0.1);
    }
    25% {
        border-color: rgba(139, 92, 246, 0.5); /* Purple */
        box-shadow: 0 0 15px rgba(139, 92, 246, 0.3), inset 0 0 10px rgba(139, 92, 246, 0.1);
    }
    50% {
        border-color: rgba(236, 72, 153, 0.5); /* Pink */
        box-shadow: 0 0 15px rgba(236, 72, 153, 0.3), inset 0 0 10px rgba(236, 72, 153, 0.1);
    }
    75% {
        border-color: rgba(6, 182, 212, 0.5); /* Cyan */
        box-shadow: 0 0 15px rgba(6, 182, 212, 0.3), inset 0 0 10px rgba(6, 182, 212, 0.1);
    }
    100% {
        border-color: rgba(59, 130, 246, 0.5); /* Blue */
        box-shadow: 0 0 15px rgba(59, 130, 246, 0.3), inset 0 0 10px rgba(59, 130, 246, 0.1);
    }
}


/* === Привітальний блок === */
.welcome-block {
    text-align: center;
    padding: 4rem 2rem; 
    background-color: #ffffff;
    border-radius: 0.75rem; 
    margin-top: 1.5rem; 
    border: 1px dashed #d1d5db; 
    transition: all 0.3s ease;
}
html.dark .welcome-block {
    background-color: #1f2937; 
    border-color: #4b5563; 
    box-shadow: 0 4px 20px rgba(0,0,0,0.5); 
}
.welcome-block h3 {
    color: #1f2937; 
}
html.dark .welcome-block h3 {
    color: #f3f4f6; 
    text-shadow: 0 0 10px rgba(255,255,255,0.1);
}
.welcome-block.hidden {
    display: none;
}


/* Лоадер */
.loader {
    border: 4px solid #f3f4f6;
    border-top: 4px solid #3b82f6;
    border-radius: 50%;
    width: 40px; height: 40px;
    animation: spin 1s linear infinite;
    margin: 4rem auto;
}
html.dark .loader {
    border-color: #374151;
    border-top-color: #60a5fa; 
    filter: drop-shadow(0 0 4px #3b82f6); 
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.error-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    text-align: center;
    min-height: 250px;
}
.error-message span:first-of-type {
    margin-top: 1rem;
    font-size: 1.125rem;
    font-weight: 500;
}
.error-message span:last-of-type {
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: #6b7280;
}
html.dark .error-message span:last-of-type {
    color: #9ca3af;
}

/* === Глобальний Тултип (Popover) === */
#global-tooltip {
    position: fixed;
    z-index: 1000;
    padding: 8px 12px;
    background-color: rgba(17, 24, 39, 0.95); 
    color: #ffffff;
    font-size: 0.75rem; 
    font-weight: 500;
    border-radius: 0.5rem; 
    pointer-events: none; 
    opacity: 0;
    transform: translateY(5px) scale(0.95);
    transition: opacity 0.2s cubic-bezier(0.165, 0.84, 0.44, 1), 
                transform 0.2s cubic-bezier(0.165, 0.84, 0.44, 1);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    white-space: nowrap;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

#global-tooltip.show {
    opacity: 1;
    transform: translateY(0) scale(1);
}

#global-tooltip::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: -4px; 
    transform: translateX(-50%) rotate(45deg);
    width: 8px;
    height: 8px;
    background-color: inherit; 
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    z-index: -1;
}

#global-tooltip.bottom::after {
    top: -4px;
    bottom: auto;
    border-right: none;
    border-bottom: none;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* --- File: css/header.css --- */

/* === (ОНОВЛЕНО) Шапка === */
.header-section {
    border-radius: 0.75rem; 
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);
    transition: background-color 0.3s ease, box-shadow 0.3s ease, color 0.3s ease;
}

/* (НОВЕ) Анімація для шапки */
@keyframes neon-header-flow {
    0% {
        border-bottom-color: rgba(59, 130, 246, 0.5); /* Blue */
        box-shadow: 
            0 20px 50px -10px rgba(0, 0, 0, 0.8), 
            0 10px 30px -5px rgba(37, 99, 235, 0.4), 
            0 4px 12px rgba(59, 130, 246, 0.6),
            inset 0 -1px 0 rgba(96, 165, 250, 0.4);
    }
    25% {
        border-bottom-color: rgba(139, 92, 246, 0.5); /* Purple */
        box-shadow: 
            0 20px 50px -10px rgba(0, 0, 0, 0.8), 
            0 10px 30px -5px rgba(124, 58, 237, 0.4), 
            0 4px 12px rgba(139, 92, 246, 0.6),
            inset 0 -1px 0 rgba(167, 139, 250, 0.4);
    }
    50% {
        border-bottom-color: rgba(236, 72, 153, 0.5); /* Pink */
        box-shadow: 
            0 20px 50px -10px rgba(0, 0, 0, 0.8), 
            0 10px 30px -5px rgba(219, 39, 119, 0.4), 
            0 4px 12px rgba(236, 72, 153, 0.6),
            inset 0 -1px 0 rgba(244, 114, 182, 0.4);
    }
    75% {
        border-bottom-color: rgba(6, 182, 212, 0.5); /* Cyan */
        box-shadow: 
            0 20px 50px -10px rgba(0, 0, 0, 0.8), 
            0 10px 30px -5px rgba(8, 145, 178, 0.4), 
            0 4px 12px rgba(34, 211, 238, 0.6),
            inset 0 -1px 0 rgba(103, 232, 249, 0.4);
    }
    100% {
        border-bottom-color: rgba(59, 130, 246, 0.5); /* Blue */
        box-shadow: 
            0 20px 50px -10px rgba(0, 0, 0, 0.8), 
            0 10px 30px -5px rgba(37, 99, 235, 0.4), 
            0 4px 12px rgba(59, 130, 246, 0.6),
            inset 0 -1px 0 rgba(96, 165, 250, 0.4);
    }
}

/* (ОНОВЛЕНО) Стилі темної теми для шапки */
html.dark .header-section {
    /* (GLASSMORPHISM) Напівпрозорий фон + розмиття */
    background-color: rgba(31, 41, 55, 0.85); /* 85% opacity */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    
    /* Анімація неону */
    animation: neon-header-flow 20s infinite linear;
    
    z-index: 50; 
    position: relative; 
}
html:not(.dark) .header-section {
    background-color: #ffffff;
}

.header-top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.header-branding {
    display: flex;
    align-items: center;
    gap: 0.75rem; 
    min-width: 0; 
}
.header-logo {
    width: 2.5rem; 
    height: 2.5rem; 
    flex-shrink: 0; 
    filter: drop-shadow(0 0 8px rgba(250, 204, 21, 0.5));
}

.header-title-group {
    text-align: left;
    min-width: 0;
}
.header-section h1 { 
    font-size: 1.25rem; 
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
html.dark .header-section h1 {
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.2), 0 0 20px rgba(59, 130, 246, 0.3);
}

.header-section p { 
    font-size: 0.875rem; 
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
html:not(.dark) .header-section h1 { color: #1f2937; }
html:not(.dark) .header-section p { color: #4b5563; }

/* (НОВЕ) Група кнопок у шапці */
.header-actions-group {
    display: flex;
    align-items: center;
    gap: 0.5rem; 
    flex-shrink: 0;
    margin-left: 1rem; 
}
.header-action-btn {
    position: relative;
    padding: 0.5rem; 
    border-radius: 9999px; 
    color: #4b5563; 
    transition: all 0.2s ease;
}
.header-action-btn:hover {
    background-color: #f3f4f6; 
    color: #1f2937; 
}
html.dark .header-action-btn {
    color: #9ca3af; 
}
html.dark .header-action-btn:hover {
    background-color: rgba(55, 65, 81, 0.8); 
    color: #f3f4f6; 
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.4);
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
}


/* (НОВЕ) Блок "Обране" */
.favorites-wrapper {
    position: relative;
}
.favorites-list {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem; 
    min-width: 250px;
    background-color: #ffffff;
    border-radius: 0.5rem; 
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1),
                0 4px 6px -4px rgba(0,0,0,0.1);
    z-index: 20;
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #f3f4f6;
}
html.dark .favorites-list {
    background-color: #1f2937; 
    border: 1px solid rgba(75, 85, 99, 0.5);
    box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.8), 0 0 15px rgba(59, 130, 246, 0.15);
}
.favorites-list.hidden {
    display: none;
}
.favorite-item, .favorite-item-empty {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem; 
    font-size: 0.875rem; 
    color: #1f2937; 
}
html.dark .favorite-item, html.dark .favorite-item-empty {
    color: #f3f4f6; 
}
.favorite-item-empty {
    color: #6b7280; 
    justify-content: center;
}
html.dark .favorite-item-empty {
    color: #9ca3af; 
}
.favorite-item-content {
    display: flex;
    align-items: center;
    gap: 0.5rem; 
    cursor: pointer;
    flex-grow: 1;
    min-width: 0; 
}
.favorite-item-content span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.favorite-item-content i { 
    flex-shrink: 0;
    color: #6b7280;
    width: 1.25rem; 
    text-align: center;
}
html.dark .favorite-item-content i {
    color: #9ca3af;
}

.favorite-item:hover {
    background-color: #f9fafb; 
}
html.dark .favorite-item:hover {
    background-color: #374151; 
}

.remove-favorite-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    margin-left: 0.5rem;
    border-radius: 99px;
    color: #9ca3af; 
    flex-shrink: 0;
}
.remove-favorite-btn:hover {
    background-color: #f3f4f6; 
    color: #ef4444; 
}
html.dark .remove-favorite-btn {
    color: #6b7280; 
}
html.dark .remove-favorite-btn:hover {
    background-color: #374151; 
    color: #f87171; 
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.4);
}


/* (ОНОВЛЕНО) Пошук */
.search-wrapper {
    position: relative;
    margin-top: 1.5rem; 
    text-align: left;
}
.search-icon-wrapper {
    position: absolute;
    top: 0; bottom: 0; left: 0.75rem;
    display: flex; align-items: center;
    pointer-events: none;
    color: #9ca3af; 
}
html.dark .search-icon-wrapper { color: #6b7280; }

#search-box {
    width: 100%;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    padding: 0.75rem 2.75rem; 
    font-size: 1rem;
    transition: all 0.2s ease;
}
html.dark #search-box {
    background-color: rgba(17, 24, 39, 0.6); /* Напівпрозорий */
    border-color: #4b5563;
    color: #f3f4f6;
}
/* (NEON) Фокус на полі пошуку - яскраво! */
html.dark #search-box:focus {
    border-color: #60a5fa;
    box-shadow: 0 0 0 1px #60a5fa, 0 0 15px rgba(96, 165, 250, 0.4);
    background-color: rgba(17, 24, 39, 0.9);
}

html:not(.dark) #search-box {
    background-color: #ffffff;
    color: #1f2937;
}


.reset-button {
    position: absolute;
    top: 0;
    bottom: 0;
    right: 0.75rem; 
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.25rem; 
    color: #9ca3af;
    background-color: transparent;
    border: none;
    border-radius: 99px;
    cursor: pointer;
    transition: all 0.2s ease;
}
.reset-button:hover {
    color: #1f2937;
    background-color: #e5e7eb;
}
html.dark .reset-button {
    color: #6b7280;
}
html.dark .reset-button:hover {
    color: #f3f4f6;
    background-color: #4b5563;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.1);
}
.reset-button.hidden {
    display: none;
}


/* (ОНОВЛЕНО) Список підказок */
#suggestions-list {
    position: absolute; 
    left: 0;
    right: 0;
    top: 100%; 
    z-index: 10;
    margin-top: 0.5rem;
    background-color: #ffffff;
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1),
                0 4px 6px -4px rgba(0,0,0,0.1);
    max-height: 300px;
    overflow-y: auto;
    transform: scaleY(0.95);
    opacity: 0;
    transform-origin: top;
    transition: all 0.2s ease;
    text-align: left;
    border: 1px solid #f3f4f6;
}
html.dark #suggestions-list {
    background-color: rgba(31, 41, 55, 0.95); /* Glassmorphism */
    backdrop-filter: blur(10px);
    border-color: #4b5563;
    box-shadow: 0 15px 40px -5px rgba(0, 0, 0, 0.8), 0 0 15px rgba(59, 130, 246, 0.1);
}
#suggestions-list.hidden {
    display: none;
}
#suggestions-list:not(.hidden) {
    transform: scaleY(1);
    opacity: 1;
}
.suggestion-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid #f3f4f6;
    transition: background-color 0.15s ease;
}
html.dark .suggestion-item {
    border-bottom-color: #374151;
    color: #d1d5db;
}
.suggestion-item:hover { background-color: #f9fafb; }
html.dark .suggestion-item:hover { 
    background-color: rgba(55, 65, 81, 0.8);
    color: #fff;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.3);
}
.suggestion-item.not-found { color: #9ca3af; }
html.dark .suggestion-item.not-found { color: #9ca3af; }

/* --- File: css/schedule.css --- */

/* === (ОНОВЛЕНО) Заголовок Расписания === */
.schedule-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-top: 1rem;
}

.schedule-header.hidden {
    display: none;
}

#schedule-title {
    font-size: 1.875rem;
    font-weight: 700;
    transition: color 0.3s ease;
    min-width: 0;
}

html.dark #schedule-title {
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
}

.schedule-actions {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex-shrink: 0;
}

/* === Стилізація селектора тижнів === */
#public-week-select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    
    height: 2.25rem; 
    padding: 0 2rem 0 0.75rem; 
    margin-right: 0.5rem;
    font-size: 0.875rem;
    line-height: 1.25;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    
    background-color: #ffffff !important;
    border: 1px solid #d1d5db;
    color: #1f2937 !important;
    
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.25em 1.25em;
}

#public-week-select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

html.dark #public-week-select {
    background-color: #1f2937 !important;
    border-color: #4b5563;
    color: #f3f4f6 !important;
    
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%239ca3af' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
}

html.dark #public-week-select:hover {
    background-color: #374151 !important;
    border-color: #6b7280;
}
#public-week-select:hover {
    border-color: #9ca3af;
}

.schedule-action-btn {
    padding: 0.5rem;
    border-radius: 0.375rem;
    color: #6b7280;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 2.25rem; 
    width: 2.25rem; 
}

.schedule-action-btn:hover {
    background-color: #e5e7eb;
    color: #1f2937;
}

html.dark .schedule-action-btn {
    color: #9ca3af;
}

html.dark .schedule-action-btn:hover {
    background-color: #374151;
    color: #f3f4f6;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.15);
}

#favorite-icon.text-yellow-500 {
    color: #f59e0b;
}

html.dark #favorite-icon.text-yellow-500 {
    color: #fcd34d;
    filter: drop-shadow(0 0 5px rgba(252, 211, 77, 0.6));
}

#inspector-toggle-btn.active {
    background-color: #dbeafe;
    color: #2563eb;
}

html.dark #inspector-toggle-btn.active {
    background-color: rgba(37, 99, 235, 0.2);
    color: #60a5fa;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.4);
    border: 1px solid rgba(59, 130, 246, 0.3);
}

/* === Swiper и Карточки === */
.swiper-initializing {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.swiper.hidden {
    display: none;
}

.swiper {
    width: 100%;
    padding-bottom: 2.5rem;
}

.swiper-pagination-bullet {
    background-color: #9ca3af;
    opacity: 0.8;
}

html.dark .swiper-pagination-bullet {
    background-color: #4b5563;
    opacity: 0.7;
}

.swiper-pagination-bullet-active {
    background-color: #3b82f6;
    opacity: 1;
}

html.dark .swiper-pagination-bullet-active {
    box-shadow: 0 0 8px #3b82f6;
}

.swiper-slide {
    user-select: text;
    min-height: 400px;
}

/* Контент слайдов */
.day-slide-content {
    background-color: #ffffff;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    padding: 1rem;
    min-height: 250px;
    text-align: left;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

html.dark .day-slide-content {
    background-color: #1f2937;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.day-title {
    color: #4b5563;
    font-size: 1.125rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 1rem;
    transition: color 0.3s ease;
}

html.dark .day-title {
    color: #9ca3af;
}

.day-title--today {
    color: #2563eb;
    font-weight: 700;
}

html.dark .day-title--today {
    color: #60a5fa;
    text-shadow: 0 0 10px rgba(96, 165, 250, 0.5);
}

.empty-day-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    padding: 1rem;
    min-height: 200px;
    color: #d1d5db;
}

.empty-day-placeholder p {
    margin-top: 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #9ca3af;
}

/* === БАЗОВИЙ СТИЛЬ КАРТКИ === */
.card {
    position: relative; /* ВАЖЛИВО: Щоб смужка не вилітала */
    background-color: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 1rem 1rem 1rem 1.25rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
}

html.dark .card {
    background-color: #1f2937;
    border-color: #374151;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
}

/* Чередування кольорів (1-4) */
.card:nth-of-type(4n+1) { --card-border-color: #3b82f6; } /* Blue */
.card:nth-of-type(4n+2) { --card-border-color: #ef4444; } /* Red */
.card:nth-of-type(4n+3) { --card-border-color: #f59e0b; } /* Yellow */
.card:nth-of-type(4n+4) { --card-border-color: #10b981; } /* Green */

.card::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    border-radius: 0.5rem 0 0 0.5rem;
    background-color: var(--card-border-color);
    
    /* (ОПТИМІЗАЦІЯ) Прибрали 'all', залишили тільки безпечні властивості */
    transition: background-color 0.3s ease; 

    /* (ОПТИМІЗАЦІЯ) Статична тінь замість анімації для всіх карток */
    box-shadow: 0 0 4px var(--card-border-color);
    opacity: 0.85;
    
    /* FIX: Оптимізація для Firefox */
    will-change: box-shadow, opacity; 
    transform: translateZ(0);
}

html.dark .card::before {
    /* Трохи яскравіше світіння для темної теми */
    box-shadow: 0 0 8px var(--card-border-color);
}

/* Стилі для ПОТОЧНОЇ (Активної) картки */
.card.card-current {
    --card-border-color: #1d4ed8;
    border-color: #1d4ed8;
    background-color: #eff6ff;
    box-shadow: 0 4px 10px rgba(59, 130, 246, 0.2);
}

.card.card-current::before {
    width: 6px;
    left: -1px;
    /* Тільки для активної картки залишаємо анімацію */
    will-change: box-shadow, filter;
    animation: border-pulse-active 2s infinite ease-in-out;
}

html.dark .card.card-current {
    --card-border-color: #60a5fa;
    border-color: #60a5fa;
    background-color: rgba(30, 58, 138, 0.4);
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.3), inset 0 0 10px rgba(59, 130, 246, 0.1);
}

html.dark .card.card-current::before {
    /* Анімація тільки тут */
    box-shadow: 0 0 15px var(--card-border-color);
}

@keyframes border-pulse-active {
    0%, 100% { box-shadow: 0 0 8px var(--card-border-color); filter: brightness(1); }
    50% { box-shadow: 0 0 18px var(--card-border-color); filter: brightness(1.3); }
}

.card-time {
    font-size: 0.8125rem;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.375rem;
    line-height: 1.3;
    width: 100%; /* Розтягуємо на всю ширину */
}

/* === (НОВЕ) Таймер всередині активної картки === */
.card-timer {
    margin-left: auto; /* Притискаємо вправо */
    font-weight: 700;
    font-family: monospace;
    font-size: 0.85em;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    
    /* Колір таймера - червоний, щоб привертати увагу */
    color: #dc2626; 
    background-color: #fee2e2;
    padding: 2px 6px;
    border-radius: 4px;
    
    animation: blink-timer 2s infinite ease-in-out;
}

html.dark .card-timer {
    color: #fca5a5;
    background-color: rgba(127, 29, 29, 0.4);
    box-shadow: 0 0 5px rgba(220, 38, 38, 0.4);
}

@keyframes blink-timer {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

.pair-number {
    font-weight: 700;
    color: var(--card-border-color);
    transition: all 0.3s ease;
}

html.dark .pair-number {
    text-shadow: 0 0 8px var(--card-border-color);
}

.pair-time {
    font-weight: 500;
    font-size: 0.75rem;
    color: #6b7280;
}

html.dark .pair-time {
    color: #9ca3af;
}

.pair-type-icon {
    width: 0.875rem;
    height: 0.875rem;
}

.card-subject {
    font-size: 0.875rem;
    font-weight: 600;
    margin: 0.125rem 0;
    line-height: 1.4;
}

.card-details {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.25rem;
    border-bottom: 1px dashed #d1d5db;
    padding-bottom: 0.25rem;
}

html.dark .card-details {
    border-bottom-color: #4b5563;
}

.card-detail-item {
    display: flex;
    align-items: center;
    font-size: 0.8125rem;
    color: #4b5563;
}

html.dark .card-detail-item {
    color: #d1d5db;
}

.card-detail-item i {
    width: 14px;
    height: 14px;
    margin-right: 0.375rem;
    color: #9ca3af;
    text-align: center;
}

.card-participants {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    margin-top: 0.25rem;
}

.participant-item {
    background-color: #e0e7ff;
    color: #3730a3;
    font-size: 0.6875rem;
    font-weight: 500;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
}

html.dark .participant-item {
    background-color: #3730a3;
    color: #e0e7ff;
}

.participant-link {
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.participant-link:hover {
    background-color: #c7d2fe;
    color: #1e1b4b;
    transform: translateY(-1px);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

html.dark .participant-link:hover {
    background-color: #4338ca;
    color: #e0e7ff;
    box-shadow: 0 0 8px rgba(99, 102, 241, 0.5);
}

/* === Підсвічування чисельника/знаменника === */
.card-subject-part {
    padding: 1px 4px;
    border-radius: 4px;
    transition: all 0.3s ease;
    display: inline-block;
    margin: 1px 0;
}

.card-subject-part.inactive {
    opacity: 0.5;
}

html:not(.dark) .card-subject-part.numerator-active {
    background-color: #dbeafe;
    color: #1e40af;
}

html:not(.dark) .card-subject-part.denominator-active {
    background-color: #ffedd5;
    color: #9a3412;
}

html.dark .card-subject-part.numerator-active {
    background-color: rgba(30, 58, 138, 0.6);
    color: #bfdbfe;
    box-shadow: 0 0 5px rgba(59, 130, 246, 0.3);
}

html.dark .card-subject-part.denominator-active {
    background-color: rgba(124, 45, 18, 0.6);
    color: #fed7aa;
    box-shadow: 0 0 5px rgba(249, 115, 22, 0.3);
}

.card-subject .text-gray-400 {
    color: #9ca3af;
}

html.dark .card-subject .text-gray-500 {
    color: #6b7280;
}

/* === ВИДЖЕТ "СЕЙЧАС" (LIVE WIDGET) === */
.now-widget {
    background-color: #ffffff;
    border-radius: 0.75rem;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
    border: 1px solid #e5e7eb;
    transition: all 0.3s ease;
    overflow: hidden;
    position: relative;
}

.now-widget.hidden {
    display: none;
}

html.dark .now-widget {
    background-color: #1f2937;
    border-color: #374151;
    /* (NEON) Світіння для віджета */
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.15);
}

.now-widget-content {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.now-widget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.status-badge {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.status-active {
    background-color: #fee2e2; /* red-100 */
    color: #991b1b; /* red-800 */
}
html.dark .status-active {
    background-color: rgba(153, 27, 27, 0.3);
    color: #fca5a5; /* red-300 */
}

.status-break {
    background-color: #d1fae5; /* green-100 */
    color: #065f46; /* green-800 */
}
html.dark .status-break {
    background-color: rgba(6, 95, 70, 0.3);
    color: #6ee7b7; /* green-300 */
}

.timer-text {
    font-family: monospace; /* Моноширинний для цифр */
    font-size: 1rem;
    font-weight: 700;
    color: #374151;
}
html.dark .timer-text {
    color: #f3f4f6;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.3);
}

.now-widget-body h3 {
    margin: 0;
    line-height: 1.2;
    color: #111827;
}
html.dark .now-widget-body h3 {
    color: #f9fafb;
}

.progress-bar-bg {
    height: 6px;
    background-color: #e5e7eb;
    border-radius: 3px;
    overflow: hidden;
    width: 100%;
}
html.dark .progress-bar-bg {
    background-color: #374151;
}

.progress-bar-fill {
    height: 100%;
    background-color: #3b82f6; /* Blue */
    width: 0%;
    transition: width 1s linear; /* Плавний рух щосекунди */
    border-radius: 3px;
}

/* Якщо це перерва, зробимо прогрес зеленим */
.progress-bar-fill.break-mode {
    background-color: #10b981; /* Green */
}

html.dark .progress-bar-fill {
    box-shadow: 0 0 8px #3b82f6;
}
html.dark .progress-bar-fill.break-mode {
    box-shadow: 0 0 8px #10b981;
}

/* --- File: css/grid_view.css --- */

/* === (ОНОВЛЕНО) Стилі для режиму "Сітка" (Grid View) === */

/* Контейнер сітки */
.schedule-grid-wrapper {
    display: grid;
    grid-auto-flow: column;
    grid-template-rows: auto repeat(7, minmax(100px, auto));

    gap: 0; 
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    overflow: hidden;
    background-color: #ffffff;
    
    overflow-x: auto;
    scroll-snap-type: x mandatory; 
    scroll-behavior: smooth;
    
    scrollbar-width: none; /* Firefox */
}
.schedule-grid-wrapper::-webkit-scrollbar {
    display: none;
}

html.dark .schedule-grid-wrapper {
    border-color: #374151; 
    background-color: #1f2937; 
    /* (NEON) Легке зовнішнє світіння таблиці */
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
}

/* === АДАПТИВНІСТЬ КОЛОНОК === */

/* ДЕСКТОП (ПК і Ноутбуки) */
@media (min-width: 1024px) {
    .schedule-grid-wrapper {
        grid-template-columns: repeat(6, 1fr);
        min-width: 1000px; 
    }
}

/* МОБІЛЬНИЙ (Телефони і Планшети) */
@media (max-width: 1023px) {
    .schedule-grid-wrapper {
        grid-template-columns: repeat(6, 100%);
        min-width: auto; 
    }
}


/* Заголовок колонки (День) */
.grid-day-header {
    padding: 0.75rem 0.5rem;
    text-align: center;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.8rem;
    background-color: #f9fafb; 
    border-bottom: 1px solid #e5e7eb;
    border-right: 1px solid #e5e7eb;
    color: #4b5563;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    
    scroll-snap-align: start;
    scroll-snap-stop: always; 
}

.grid-day-header:last-child, 
.grid-cell:nth-last-child(-n+7) { 
     border-right: none;
}

html.dark .grid-day-header {
    background-color: #111827; 
    border-bottom-color: #374151;
    border-right-color: #374151;
    color: #9ca3af;
}
.grid-day-header.is-today {
    color: #2563eb; 
    background-color: #eff6ff; 
}
html.dark .grid-day-header.is-today {
    color: #60a5fa;
    background-color: rgba(30, 58, 138, 0.5); /* blue-900 */
    /* (NEON) Світіння активного заголовка */
    box-shadow: inset 0 -2px 5px rgba(59, 130, 246, 0.5);
    border-bottom: 1px solid #3b82f6;
}


/* Комірка таблиці */
.grid-cell {
    padding: 0.5rem; 
    border-bottom: 1px solid #e5e7eb;
    border-right: 1px solid #e5e7eb; 
    display: flex;
    flex-direction: column;
    justify-content: center; 
    transition: background-color 0.2s ease;
    
    scroll-snap-align: start;
    scroll-snap-stop: always;
}

html.dark .grid-cell {
    border-bottom-color: #374151; 
    border-right-color: #374151;
    background-color: #1f2937; 
}
.grid-cell:hover {
    background-color: #f3f4f6;
}
html.dark .grid-cell:hover {
    background-color: #263142; 
}

/* Порожня комірка */
.grid-cell-empty {
    align-items: center; 
    opacity: 0.6; 
}
.empty-icon {
    font-size: 2rem; 
    animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
html.dark .empty-icon {
    color: #6b7280;
    /* (NEON) Легке світіння іконки */
    filter: drop-shadow(0 0 5px rgba(107, 114, 128, 0.5));
}

@keyframes popIn {
    from { transform: scale(0.5); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}


/* === Адаптація карток === */
#schedule-grid .card {
    margin: 0;
    width: 100%;
    height: 100%; 
    box-shadow: none; 
    border: 1px solid #e5e7eb; 
    font-size: 0.85em; 
}
html.dark #schedule-grid .card {
    border-color: #4b5563;
    background-color: #18202f; 
}

/* (NEON) Активна картка в сітці */
html.dark #schedule-grid .card.card-current {
    background-color: rgba(30, 58, 138, 0.3);
    border: 1px solid #60a5fa;
    box-shadow: inset 0 0 10px rgba(59, 130, 246, 0.2);
}

#schedule-grid .card::before {
    border-radius: 0.5rem 0 0 0.5rem;
    left: 0;
    width: 3px; 
}
#schedule-grid .card {
    padding: 0.5rem; 
    padding-left: 0.75rem; 
    display: flex;
    flex-direction: column;
    justify-content: center; 
}

#schedule-grid .card-subject {
    font-size: 0.8rem;
    line-height: 1.2;
    margin: 0.25rem 0;
}
#schedule-grid .pair-time {
    font-size: 0.7rem;
}
#schedule-grid .card-details {
    margin-top: 0.25rem;
    gap: 0.25rem;
}
#schedule-grid .participant-item {
    font-size: 0.65rem;
    padding: 0px 4px;
}

/* --- File: css/modal.css --- */

/* (НОВЕ) === Модальне вікно === */
/* Основа */
.modal-fade {
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    transition: opacity 0.3s ease;
}
/* Стан "Відкрито" */
.modal-fade.modal-open {
    opacity: 1 !important;
    pointer-events: auto;
}
/* Анімація панелі */
.modal-panel-animate {
    transform: scale(0.95);
    opacity: 0;
    transition: all 0.3s ease;
}
.modal-open .modal-panel-animate {
    transform: scale(1);
    opacity: 1;
}

/* (ВИПРАВЛЕНО) Стилі модального вікна для темної теми */
html.dark #modalPanel {
    /* (GLASSMORPHISM) Напівпрозорий фон */
    background-color: rgba(31, 41, 55, 0.85); 
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    
    /* (NEON) Світіння модального вікна */
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.8), 0 0 20px rgba(59, 130, 246, 0.2);
    border: 1px solid rgba(59, 130, 246, 0.2);
}
/* (ВИПРАВЛЕНО) Стилі модального вікна для світлої теми */
html:not(.dark) #modalPanel {
    background-color: #ffffff;
}

/* Стилі тегів (копія .participant-item, але для модалки) */
.modal-tag {
    font-size: 0.875rem; /* 14px */
    font-weight: 500;
    padding: 0.25rem 0.75rem; /* 4px 12px */
    border-radius: 9999px;
}
/* Кольори тегів для світлої теми */
html:not(.dark) .modal-tag-group {
    background-color: #e0e7ff; /* blue-100 */
    color: #3730a3; /* indigo-800 */
}
html:not(.dark) .modal-tag-group:hover {
    background-color: #c7d2fe; /* blue-200 */
}
html:not(.dark) .modal-tag-teacher {
    background-color: #d1fae5; /* green-100 */
    color: #065f46; /* green-800 */
}
html:not(.dark) .modal-tag-teacher:hover {
    background-color: #a7f3d0; /* green-200 */
}

/* Кольори тегів для темної теми */
html.dark .modal-tag-group {
    background-color: #3730a3; /* indigo-800 */
    color: #e0e7ff; /* blue-100 */
    /* (NEON) */
    box-shadow: 0 0 5px rgba(67, 56, 202, 0.5);
}
html.dark .modal-tag-group:hover {
    background-color: #4338ca; /* indigo-700 */
}
html.dark .modal-tag-teacher {
    background-color: #065f46; /* green-800 */
    color: #d1fae5; /* green-100 */
    /* (NEON) */
    box-shadow: 0 0 5px rgba(6, 95, 70, 0.5);
}
html.dark .modal-tag-teacher:hover {
    background-color: #047857; /* green-700 */
}

/* --- File: css/responsive.css --- */

/* Наразі в `old_style.css` не було адаптивних стилів, окрім друку. */
/* Ви можете додати свої медіа-запити тут. */

/*
@media (max-width: 768px) {
    
}

@media (max-width: 640px) {
    
}
*/

/* --- File: css/print.css --- */

/* === Стили для Печати === */
@media print {
    @page {
        size: A4 landscape;
        margin: 0.5cm; 
    }
    body {
        background-color: #ffffff !important;
        color: #000000 !important;
        font-family: 'Inter', sans-serif;
        font-size: 8pt; 
    }
    /* Ховаємо все, що не потрібно */
    .header-section,
    .schedule-actions, 
    .header-actions-group,
    #reset-selection,
    .swiper-pagination,
    .search-wrapper,
    .welcome-block,
    footer,
    #lessonModal { /* (ОНОВЛЕНО) Ховаємо модальне вікно */
        display: none !important;
    }

    /* Налаштовуємо контейнери */
    .px-4 { padding: 0 !important; }
    .mx-auto { margin: 0 !important; }
    .max-w-6xl { max-width: 100% !important; }
    
    .schedule-header {
        display: block !important; 
        text-align: center !important;
        margin-bottom: 0.4rem !important; 
        padding-top: 0;
    }
    #schedule-title {
        font-size: 12pt !important; 
        font-weight: 700 !important;
        color: #000000 !important; /* Примусово чорний */
    }

    /* Розгортаємо Swiper */
    .swiper-container,
    .swiper {
        display: block !important; 
        width: 100% !important;
        padding: 0 !important;
        overflow: visible !important;
    }
    .swiper-wrapper {
        display: flex !important; 
        flex-direction: row !important;
        flex-wrap: nowrap !important; 
        justify-content: space-between !important;
        gap: 0.4rem !important;
    }
    .swiper-slide {
        display: block !important;
        width: 19% !important; /* ~5 колонок */
        flex-shrink: 0 !important;
        page-break-inside: avoid !important;
    }

    /* Стилі для карточок */
    .day-slide-content {
        background-color: #ffffff !important;
        border: 1px solid #ddd !important;
        padding: 0.4rem !important;
        box-shadow: none !important;
        min-height: 0 !important;
    }
    .day-title {
        font-size: 10pt !important;
        font-weight: 700 !important;
        color: #000000 !important;
        margin-bottom: 0.4rem !important;
    }
    .card {
        background-color: #ffffff !important;
        border: 1px solid #eee !important;
        padding: 0.4rem !important;
        margin-left: 0 !important; /* Прибираємо відступ для смужки */
        box-shadow: none !important;
        page-break-inside: avoid !important;
        opacity: 1 !important;
        transform: none !important;
        margin-bottom: 0.3rem !important;
    }
    .card::before {
        display: none !important; /* Ховаємо кольорові смужки */
    }
    
    /* Ущільнюємо текст */
    .card-subject {
        font-size: 7.5pt !important;
        font-weight: 600 !important;
        color: #000000 !important;
        margin: 0.1rem 0 !important;
        word-break: break-all;
    }
    .pair-number, .pair-time, .card-detail-item {
        font-size: 7pt !important;
    }
    .pair-number { color: #000 !important; font-weight: 700; }
    .pair-time { color: #333 !important; }
    .card-detail-item { color: #333 !important; }
    .card-detail-item i { display: none; } /* (ОНОВЛЕНО) */
    .pair-number i { display: none; } /* (НОВЕ) */
    
    .card-details {
        gap: 0.25rem !important;
        margin-top: 0.2rem !important;
        padding-bottom: 0.2rem !important;
        border-bottom: 1px dashed #ccc !important;
    }
    
    .card-participants {
        margin-top: 0.2rem !important;
        gap: 0.2rem !important;
    }
    .participant-item {
        font-size: 6.5pt !important;
        background-color: #eee !important;
        color: #000 !important;
        padding: 1px 4px !important;
    }
    
    .empty-day-placeholder {
        min-height: 100px !important;
        padding: 0.5rem !important;
    }
    .empty-day-placeholder i { display: none; }
}

