:root {
    --rozklad-color-primary: #1e293b;
    --rozklad-color-secondary: #3191d1;
    --rozklad-color-accent: #f59e0b;
    --rozklad-color-light: #f8fafc;
    --rozklad-color-dark: #0f172a;
    --rozklad-color-success: #10b981;
    --rozklad-color-info: #0284c7;
}

.rozklad-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 10px 15px 40px;
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    color: #1e293b;
}

.rozklad-admin-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #ffffff !important;
    border-radius: 8px;
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s;
    margin-bottom: 25px;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(217, 119, 6, 0.25);
}

.rozklad-admin-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(217, 119, 6, 0.35);
}

/* 📦 Таймлайн — візуалізація навчального дня */
.rozklad-visual-title {
    color: var(--rozklad-color-primary);
    text-align: center;
    margin: 0 0 20px;
    font-size: 1.45rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.rozklad-visual-title i {
    color: var(--rozklad-color-secondary);
}

.rozklad-visual {
    margin-top: 10px;
    margin-bottom: 30px;
    background: #ffffff;
    border-radius: 16px;
    padding: 24px 20px 20px;
    box-shadow: 0 6px 24px rgba(15, 23, 42, 0.08);
    border: 1px solid #e2e8f0;
    text-align: center;
}

.rozklad-timeline-wrapper {
    position: relative;
    max-width: 98%;
    margin: 28px auto 14px;
}

.rozklad-timeline {
    display: flex;
    height: 28px;
    background: #f1f5f9;
    border-radius: 14px;
    overflow: hidden; /* Гарантує ідеальне заокруглення з обох боків */
    border: 1px solid #cbd5e1;
    position: relative;
    box-sizing: border-box;
    width: 100%;
}

.rozklad-segment {
    position: relative;
    flex-grow: 1;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: #475569;
    background: #f8fafc;
    border-right: 1px solid #cbd5e1;
    min-width: 12px;
    user-select: none;
    box-sizing: border-box;
}

.rozklad-segment.segment-mini-break {
    background: repeating-linear-gradient(45deg, #e2e8f0, #e2e8f0 3px, #f8fafc 3px, #f8fafc 6px);
    font-size: 0.65rem;
    color: #94a3b8;
}

.rozklad-segment.segment-break {
    background: repeating-linear-gradient(45deg, #cbd5e1, #cbd5e1 4px, #f1f5f9 4px, #f1f5f9 8px);
}

/* Ліве та праве скруглення сегментів */
.rozklad-segment:first-child,
.rozklad-segment.is-first {
    border-top-left-radius: 14px;
    border-bottom-left-radius: 14px;
}

.rozklad-segment:last-of-type,
.rozklad-segment:last-child,
.rozklad-segment.is-last {
    border-top-right-radius: 14px !important;
    border-bottom-right-radius: 14px !important;
    border-right: none !important;
}

.rozklad-segment:first-child .fill,
.rozklad-segment.is-first .fill {
    border-top-left-radius: 14px;
    border-bottom-left-radius: 14px;
}

.rozklad-segment:last-of-type .fill,
.rozklad-segment:last-child .fill,
.rozklad-segment.is-last .fill {
    border-top-right-radius: 14px !important;
    border-bottom-right-radius: 14px !important;
}

.rozklad-segment .seg-label {
    z-index: 2;
    position: relative;
    pointer-events: none;
}

/* Прогресбар всередині сегмента */
.rozklad-segment .fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    z-index: 1;
    transition: width 0.8s ease-out;
    opacity: 1;
    animation: neon-pulse 2.5s infinite ease-in-out;
}

/* 🎨 Кольори підсвічування кожної з 7 пар */
.fill.pair-1 {
    background-color: #93c5fd;
    box-shadow: 0 0 8px #3b82f6, 0 0 16px rgba(59, 130, 246, 0.4);
}

.fill.pair-2 {
    background-color: #fde68a;
    box-shadow: 0 0 8px #f59e0b, 0 0 16px rgba(245, 158, 11, 0.4);
}

.fill.pair-3 {
    background-color: #ddd6fe;
    box-shadow: 0 0 8px #8b5cf6, 0 0 16px rgba(139, 92, 246, 0.4);
}

.fill.pair-4 {
    background-color: #a7f3d0;
    box-shadow: 0 0 8px #10b981, 0 0 16px rgba(16, 185, 129, 0.4);
}

.fill.pair-5 {
    background-color: #fecdd3;
    box-shadow: 0 0 8px #f43f5e, 0 0 16px rgba(244, 63, 94, 0.4);
}

.fill.pair-6 {
    background-color: #a5f3fc;
    box-shadow: 0 0 8px #06b6d4, 0 0 16px rgba(6, 182, 212, 0.4);
}

.fill.pair-7 {
    background-color: #c7d2fe;
    box-shadow: 0 0 8px #6366f1, 0 0 16px rgba(99, 102, 241, 0.4);
}

/* Перерва між акад. годинами (5 хв) */
.fill.mini-break-fill {
    background: #fcd34d;
    box-shadow: 0 0 8px #f59e0b;
}

/* Перерва між парами (15 хв) */
.fill.break {
    background: repeating-linear-gradient(45deg, #fb923c, #fb923c 5px, #fdba74 5px, #fdba74 10px);
    opacity: 0.85;
    animation: none;
    box-shadow: 0 0 8px #f97316;
}

@keyframes neon-pulse {
    0%, 100% {
        filter: brightness(1);
    }
    50% {
        filter: brightness(1.18);
    }
}

/* Емоджі перекусів на перервах */
.emoji-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.15rem;
    line-height: 1;
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
    white-space: nowrap;
    z-index: 10;
}

/* Текст статусу під таймлайном */
.rozklad-current-pair {
    font-size: 1.1rem;
    font-weight: 600;
    padding-top: 16px;
    color: #1e293b;
    min-height: 28px;
}

.active-label-badge {
    background: linear-gradient(135deg, #0284c7, #0369a1);
    color: #ffffff;
    padding: 3px 9px;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 700;
    display: inline-block;
    box-shadow: 0 2px 6px rgba(2, 132, 199, 0.3);
}

.active-label-break {
    background: #ffedd5;
    color: #c2410c;
    border: 1px solid #fed7aa;
    padding: 3px 8px;
    border-radius: 6px;
    font-weight: 700;
    display: inline-block;
}

/* Маркер поточного часу */
#rozklad-marker {
    position: absolute;
    top: -6px;
    bottom: -6px;
    width: 3px;
    background: #00e5ff;
    z-index: 20;
    pointer-events: none;
    box-shadow: 0 0 8px #00e5ff, 0 0 14px rgba(0, 229, 255, 0.6);
    transition: left 0.5s ease-out;
}

#rozklad-marker-time {
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: #00e5ff;
    color: #0f172a;
    font-size: 0.78rem;
    font-weight: 800;
    padding: 3px 7px;
    border-radius: 6px;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0, 229, 255, 0.4);
    pointer-events: none;
}

/* 🗂️ Картки навігації розкладу */
.rozklad-section {
    margin: 30px 0;
}

.rozklad-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin: 16px 0 30px;
}

.rozklad-card {
    background: linear-gradient(145deg, #ffffff, #f8fafc);
    border-radius: 12px;
    padding: 18px 14px;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
    transition: all 0.25s ease;
    text-align: center;
    border: 2px solid transparent;
    cursor: pointer;
}

.rozklad-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.12);
}

.rozklad-card a {
    text-decoration: none;
    color: var(--rozklad-color-dark);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.rozklad-card i {
    font-size: 1.7rem;
    margin-bottom: 8px;
    transition: transform 0.3s ease;
}

.rozklad-card:hover i {
    transform: scale(1.15) rotate(5deg);
}

.rozklad-card h3 {
    margin: 4px 0 3px;
    font-size: 1.1rem;
    font-weight: 700;
}

.rozklad-card p {
    margin: 0;
    font-size: 0.82rem;
    color: #64748b;
}

.rozklad-card-group { border: 2px solid #bae6fd; }
.rozklad-card-group i { color: #0284c7; }

.rozklad-card-teacher { border: 2px solid #ddd6fe; }
.rozklad-card-teacher i { color: #7c3aed; }

.rozklad-card-exams { border: 2px solid #fde68a; }
.rozklad-card-exams i { color: #d97706; }

.rozklad-card-plans { border: 2px solid #a7f3d0; }
.rozklad-card-plans i { color: #059669; }

/* 📋 Таблиця розкладу дзвінків */
.rozklad-schedule {
    background: #ffffff;
    border-radius: 16px;
    padding: 24px;
    margin: 30px 0;
    box-shadow: 0 6px 24px rgba(15, 23, 42, 0.08);
    border: 1px solid #e2e8f0;
}

.schedule-header-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 20px;
}

.schedule-bell-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #fef08a, #facc15);
    color: #854d0e;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    margin-bottom: 10px;
    box-shadow: 0 4px 12px rgba(234, 179, 8, 0.25);
}

.rozklad-table-responsive {
    width: 100%;
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid #cbd5e1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.rozklad-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    text-align: center;
}

.rozklad-table thead th {
    background: linear-gradient(135deg, #1e293b, #334155);
    color: #ffffff;
    padding: 12px 14px;
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: 0.3px;
    border: none;
}

.rozklad-table th.th-pair { width: 14%; }
.rozklad-table th.th-hour { width: 25%; }
.rozklad-table th.th-mini-break { width: 12%; }
.rozklad-table th.th-break { width: 24%; }

.rozklad-table tbody tr {
    border-bottom: 1px solid #e2e8f0;
    transition: all 0.2s ease;
}

.rozklad-table tbody tr:last-child {
    border-bottom: none;
}

.rozklad-table td {
    padding: 10px 12px;
    font-size: 0.95rem;
    font-weight: 600;
    color: #334155;
    vertical-align: middle;
    border: 2px solid transparent;
    transition: all 0.25s ease;
}

/* Фонові кольори рядків пар */
.rozklad-table tr.row-1 { background-color: #f0f7ff; }
.rozklad-table tr.row-2 { background-color: #fefce8; }
.rozklad-table tr.row-3 { background-color: #faf5ff; }
.rozklad-table tr.row-4 { background-color: #f0fdf4; }
.rozklad-table tr.row-5 { background-color: #fff1f2; }
.rozklad-table tr.row-6 { background-color: #ecfeff; }
.rozklad-table tr.row-7 { background-color: #eef2ff; }

.rozklad-table tbody tr:hover {
    filter: brightness(97%);
}

/* Бейджі номерів пар */
.pair-badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 800;
    letter-spacing: 0.4px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.pair-badge-1 { background: #dbeafe; color: #1d4ed8; border: 1px solid #bfdbfe; }
.pair-badge-2 { background: #fef3c7; color: #b45309; border: 1px solid #fde68a; }
.pair-badge-3 { background: #ede9fe; color: #6d28d9; border: 1px solid #ddd6fe; }
.pair-badge-4 { background: #d1fae5; color: #047857; border: 1px solid #a7f3d0; }
.pair-badge-5 { background: #ffe4e6; color: #be123c; border: 1px solid #fecdd3; }
.pair-badge-6 { background: #cffafe; color: #0e7490; border: 1px solid #a5f3fc; }
.pair-badge-7 { background: #e0e7ff; color: #4338ca; border: 1px solid #c7d2fe; }

/* Теги перерв */
.mini-break-tag {
    display: inline-block;
    background: #fef3c7;
    color: #92400e;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.82rem;
    font-weight: 700;
    border: 1px solid #fde68a;
}

.main-break-tag {
    display: inline-block;
    background: #ffedd5;
    color: #9a3412;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 700;
    border: 1px solid #fed7aa;
}

.final-break-tag {
    display: inline-block;
    background: #f1f5f9;
    color: #475569;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.82rem;
    font-weight: 600;
}

/* 🔥 Активні підсвічування під час занять/перерв */
.rozklad-table tbody tr.row-active {
    box-shadow: 0 0 12px rgba(15, 23, 42, 0.12);
}

.rozklad-table td.highlight-active-hour {
    border: 2.5px solid #2563eb !important;
    background-color: #dbeafe !important;
    border-radius: 8px;
    box-shadow: 0 0 14px rgba(37, 99, 235, 0.35);
    color: #1e3a8a !important;
    font-weight: 800;
    transform: scale(1.02);
}

.rozklad-table td.highlight-active-mini-break {
    border: 2.5px dashed #f59e0b !important;
    background-color: #fef3c7 !important;
    border-radius: 8px;
    box-shadow: 0 0 14px rgba(245, 158, 11, 0.4);
    transform: scale(1.02);
}

.rozklad-table td.highlight-active-break {
    border: 2.5px dashed #ea580c !important;
    background-color: #ffedd5 !important;
    border-radius: 8px;
    box-shadow: 0 0 14px rgba(234, 88, 12, 0.4);
    transform: scale(1.02);
}

/* ℹ️ Інформаційна картка внизу */
.rozklad-info-card {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    background: linear-gradient(145deg, #ffffff, #f0f7ff);
    border: 1.5px solid #bfdbfe;
    border-radius: 12px;
    padding: 16px 20px;
    margin-top: 22px;
    box-shadow: 0 4px 14px rgba(2, 132, 199, 0.08);
}

.info-card-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e0f2fe;
    color: #0284c7;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
    margin-top: 2px;
}

.info-card-content {
    flex-grow: 1;
    font-size: 0.95rem;
    color: #334155;
    line-height: 1.5;
}

.info-card-main {
    margin: 0 0 8px;
    font-size: 1rem;
    color: #0f172a;
}

.info-card-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.info-card-list li {
    display: flex;
    align-items: center;
    gap: 8px;
}

.info-card-list li i {
    color: #0284c7;
    font-size: 0.55rem;
    flex-shrink: 0;
}

/* 📱 Адаптивність */
@media (max-width: 900px) {
    .rozklad-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 650px) {
    .rozklad-visual-title {
        font-size: 1.2rem;
    }

    .rozklad-table th,
    .rozklad-table td {
        font-size: 0.8rem;
        padding: 8px 6px;
    }

    .pair-badge {
        font-size: 0.72rem;
        padding: 3px 7px;
    }

    .time-range {
        font-size: 0.78rem;
    }

    .mini-break-tag, .main-break-tag, .final-break-tag {
        font-size: 0.72rem;
        padding: 2px 5px;
    }

    .rozklad-info-card {
        flex-direction: column;
        gap: 10px;
        padding: 14px;
    }

    .info-card-main {
        font-size: 0.9rem;
    }

    .info-card-list {
        font-size: 0.85rem;
    }

    .rozklad-segment.segment-mini-break .seg-label {
        display: none;
    }

    #rozklad-marker-time {
        font-size: 0.68rem;
        top: -24px;
        padding: 2px 5px;
    }
}
