/* ============================================
   DESIGN SYSTEM — Exam Calendar (Light Theme)
   Primary Color: #0059ff
   ============================================ */

:root {
    /* Primary Palette */
    --primary: #0059ff;
    --primary-light: #3d7fff;
    --primary-lighter: #e8f0ff;
    --primary-dark: #0044cc;
    --primary-glow: rgba(0, 89, 255, 0.12);

    /* Backgrounds */
    --bg-page: #f4f6fb;
    --bg-card: #ffffff;
    --bg-card-hover: #fafbff;
    --bg-subtle: #f0f2f8;

    /* Text */
    --text-primary: #1a1d2e;
    --text-secondary: #4a4e69;
    --text-muted: #8b8fa8;

    /* Status Colors */
    --accent-exam: #0059ff;
    --accent-exam-glow: rgba(0, 89, 255, 0.2);
    --accent-exam-bg: rgba(0, 89, 255, 0.07);
    --accent-rest: #ef4444;
    --accent-rest-glow: rgba(239, 68, 68, 0.18);
    --accent-rest-bg: rgba(239, 68, 68, 0.06);

    /* Borders & Shadows */
    --border-color: rgba(0, 30, 80, 0.08);
    --border-color-hover: rgba(0, 89, 255, 0.18);
    --shadow-sm: 0 1px 3px rgba(0, 30, 80, 0.06);
    --shadow-card: 0 4px 20px rgba(0, 30, 80, 0.07), 0 1px 3px rgba(0,0,0,0.04);
    --shadow-card-hover: 0 8px 32px rgba(0, 89, 255, 0.10), 0 2px 8px rgba(0,0,0,0.04);
    --shadow-header: 0 8px 40px rgba(0, 89, 255, 0.12);

    /* Radius */
    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 22px;
    --radius-xl: 28px;

    /* Typography */
    --font: 'Roboto', sans-serif;

    /* Transitions */
    --t-fast: 0.18s ease;
    --t-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   RESET & BASE
   ============================================ */

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font);
    background: var(--bg-page);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   BACKGROUND DECORATION
   ============================================ */

.bg-shapes {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    animation: float 25s ease-in-out infinite;
}

.shape-1 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(0, 89, 255, 0.10), transparent 70%);
    top: -15%;
    right: -10%;
    animation-delay: 0s;
}

.shape-2 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(0, 89, 255, 0.07), transparent 70%);
    bottom: 5%;
    left: -12%;
    animation-delay: -6s;
}

.shape-3 {
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.06), transparent 70%);
    top: 45%;
    right: 15%;
    animation-delay: -12s;
}

.shape-4 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(239, 68, 68, 0.05), transparent 70%);
    bottom: -8%;
    right: 35%;
    animation-delay: -18s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(25px, -35px) scale(1.04); }
    50% { transform: translate(-15px, 20px) scale(0.96); }
    75% { transform: translate(10px, 30px) scale(1.02); }
}

/* ============================================
   CONTAINER
   ============================================ */

.container {
    position: relative;
    z-index: 1;
    max-width: 860px;
    margin: 0 auto;
    padding: 40px 20px 60px;
}

/* ============================================
   HEADER
   ============================================ */

.header {
    text-align: center;
    padding: 48px 36px 40px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-header);
    margin-bottom: 28px;
    opacity: 0;
    transform: translateY(30px);
    animation: slideUp 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.header-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 68px;
    height: 68px;
    border-radius: 20px;
    background: linear-gradient(135deg, #0059ff, #3d7fff);
    margin-bottom: 22px;
    box-shadow: 0 8px 28px rgba(0, 89, 255, 0.3);
}

.header-icon svg {
    width: 32px;
    height: 32px;
    color: #fff;
}

.header h1 {
    font-size: 2rem;
    font-weight: 900;
    color: var(--primary);
    margin-bottom: 8px;
    letter-spacing: -0.01em;
}

.subtitle {
    font-size: 1.05rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 34px;
}

/* Stats Row */
.header-stats {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 32px;
    padding-top: 28px;
    border-top: 1px solid var(--border-color);
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.stat-number {
    font-size: 2.2rem;
    font-weight: 900;
    line-height: 1;
    color: var(--primary);
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.stat-divider {
    width: 1px;
    height: 44px;
    background: var(--border-color);
}

/* ============================================
   LEGEND
   ============================================ */

.legend {
    display: flex;
    justify-content: center;
    gap: 36px;
    margin-bottom: 32px;
    opacity: 0;
    transform: translateY(20px);
    animation: slideUp 0.6s 0.15s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-secondary);
}

.legend-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2.5px solid transparent;
}

.legend-dot.exam {
    background: var(--accent-exam);
    box-shadow: 0 0 0 4px var(--accent-exam-bg);
}

.legend-dot.rest {
    background: var(--accent-rest);
    box-shadow: 0 0 0 4px var(--accent-rest-bg);
}

/* ============================================
   SCHEDULE GRID — Week Cards
   ============================================ */

.schedule-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 52px;
}

.week-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-card);
    opacity: 0;
    transform: translateY(30px);
    transition: box-shadow var(--t-normal), border-color var(--t-normal), transform var(--t-normal);
}

.week-card:hover {
    box-shadow: var(--shadow-card-hover);
    border-color: var(--border-color-hover);
    transform: translateY(-2px);
}

.week-card.animate-in {
    animation: slideUp 0.6s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.week-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 26px;
    background: var(--primary-lighter);
    border-bottom: 1px solid var(--border-color);
}

.week-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--primary-dark);
    display: flex;
    align-items: center;
    gap: 12px;
}

.week-title .week-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: var(--primary);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 900;
    box-shadow: 0 3px 10px rgba(0, 89, 255, 0.25);
}

.week-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 14px;
    border-radius: 30px;
    font-size: 0.78rem;
    font-weight: 700;
    background: var(--primary);
    color: #fff;
    box-shadow: 0 2px 8px rgba(0, 89, 255, 0.2);
}

.week-body {
    padding: 8px 14px;
}

/* Day Row */
.day-row {
    display: flex;
    align-items: center;
    padding: 15px 18px;
    border-radius: var(--radius-sm);
    margin: 4px 0;
    transition: background var(--t-fast), transform var(--t-fast);
    cursor: default;
}

.day-row:hover {
    background: var(--bg-subtle);
    transform: translateX(-4px);
}

.day-status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-left: 18px;
    position: relative;
}

.day-status-indicator.exam {
    background: var(--accent-exam);
    box-shadow: 0 0 0 4px var(--accent-exam-bg);
}

.day-status-indicator.exam::after {
    content: '';
    position: absolute;
    inset: -5px;
    border-radius: 50%;
    border: 2px solid rgba(0, 89, 255, 0.2);
    animation: pulse-ring 2.5s infinite;
}

.day-status-indicator.rest {
    background: var(--accent-rest);
    box-shadow: 0 0 0 4px var(--accent-rest-bg);
}

.day-info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 14px;
}

.day-name {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    min-width: 85px;
}

.day-date {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
}

.day-type-badge {
    padding: 5px 16px;
    border-radius: 30px;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.day-type-badge.exam {
    background: var(--accent-exam-bg);
    color: var(--accent-exam);
    border: 1.5px solid rgba(0, 89, 255, 0.18);
}

.day-type-badge.rest {
    background: var(--accent-rest-bg);
    color: var(--accent-rest);
    border: 1.5px solid rgba(239, 68, 68, 0.18);
}

@keyframes pulse-ring {
    0% { transform: scale(1); opacity: 1; }
    70% { transform: scale(1.7); opacity: 0; }
    100% { transform: scale(1.7); opacity: 0; }
}

/* ============================================
   TIMELINE SECTION
   ============================================ */

.timeline-section {
    margin-bottom: 48px;
    opacity: 0;
    transform: translateY(30px);
}

.timeline-section.animate-in {
    animation: slideUp 0.6s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.section-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 28px;
}

.section-title svg {
    color: var(--primary);
}

.timeline {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    background: var(--bg-card);
    padding: 24px 20px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-card);
}

.timeline-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    padding: 12px 10px;
    border-radius: var(--radius-sm);
    min-width: 60px;
    transition: transform var(--t-fast), background var(--t-fast), box-shadow var(--t-fast);
    cursor: default;
    opacity: 0;
    transform: scale(0.8);
}

.timeline-item.animate-in {
    animation: popIn 0.4s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.timeline-item:hover {
    transform: scale(1.12) !important;
    background: var(--bg-subtle);
    box-shadow: var(--shadow-sm);
}

.timeline-day-name {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.timeline-date-circle {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 900;
    transition: box-shadow var(--t-fast), transform var(--t-fast);
}

.timeline-date-circle.exam {
    background: var(--primary);
    color: #fff;
    border: none;
    box-shadow: 0 3px 12px rgba(0, 89, 255, 0.25);
}

.timeline-date-circle.rest {
    background: var(--accent-rest-bg);
    color: var(--accent-rest);
    border: 2px solid rgba(239, 68, 68, 0.25);
}

.timeline-item:hover .timeline-date-circle.exam {
    box-shadow: 0 4px 20px rgba(0, 89, 255, 0.35);
    transform: scale(1.05);
}

.timeline-item:hover .timeline-date-circle.rest {
    box-shadow: 0 4px 16px var(--accent-rest-glow);
    transform: scale(1.05);
}

.timeline-month {
    font-size: 0.65rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* ============================================
   FOOTER
   ============================================ */

.footer {
    text-align: center;
    padding: 28px;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
    border-top: 1px solid var(--border-color);
}

/* ============================================
   ANIMATIONS
   ============================================ */

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* ============================================
   RESPONSIVE
   ============================================ */

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

    .header {
        padding: 32px 20px 28px;
        border-radius: var(--radius-lg);
    }

    .header h1 {
        font-size: 1.5rem;
    }

    .header-icon {
        width: 56px;
        height: 56px;
        border-radius: 16px;
    }

    .header-icon svg {
        width: 26px;
        height: 26px;
    }

    .header-stats {
        gap: 18px;
    }

    .stat-number {
        font-size: 1.6rem;
    }

    .legend {
        gap: 22px;
    }

    .week-header {
        padding: 14px 18px;
        flex-wrap: wrap;
        gap: 10px;
    }

    .day-row {
        padding: 12px 12px;
    }

    .day-row:hover {
        transform: translateX(-2px);
    }

    .day-info {
        flex-wrap: wrap;
        gap: 4px;
    }

    .day-name {
        min-width: auto;
        font-size: 0.92rem;
    }

    .day-date {
        font-size: 0.82rem;
    }

    .timeline {
        padding: 18px 12px;
    }

    .timeline-item {
        min-width: 50px;
        padding: 10px 6px;
    }

    .timeline-date-circle {
        width: 38px;
        height: 38px;
        font-size: 0.82rem;
    }
}

@media (max-width: 400px) {
    .header h1 {
        font-size: 1.3rem;
    }

    .subtitle {
        font-size: 0.9rem;
    }

    .header-stats {
        flex-direction: column;
        gap: 12px;
    }

    .stat-divider {
        width: 60px;
        height: 1px;
    }
}

/* ============================================
   PRINT STYLES
   ============================================ */

@media print {
    body {
        background: #fff;
    }

    .bg-shapes,
    .timeline-section {
        display: none;
    }

    .header {
        box-shadow: none;
        border: 2px solid #ddd;
    }

    .week-card {
        box-shadow: none;
        border: 1px solid #ddd;
        page-break-inside: avoid;
    }

    .week-card:hover {
        transform: none;
    }

    .day-status-indicator.exam::after {
        display: none;
    }
}
