:root {
    --color-primary: #6366f1;
    --color-primary-hover: #4f46e5;
    --color-secondary: #ec4899;
    --color-success: #10b981;
    --color-background: #0f172a;
    --color-surface: #1e293b;
    --color-text: #f1f5f9;
    --color-text-secondary: #94a3b8;
    --color-border: #334155;
    --color-lesson-day: #8b5cf6;
    --color-lesson-day-hover: #7c3aed;
    --color-today: #f59e0b;
    --radius-base: 12px;
    --radius-lg: 16px;
    --space-8: 8px;
    --space-12: 12px;
    --space-16: 16px;
    --space-24: 24px;
    --space-32: 32px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--color-text);
    min-height: 100vh;
    padding: var(--space-16);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
}

.container {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
}

/* header {
    text-align: center;
    margin-bottom: var(--space-32);
    padding: var(--space-24);
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
} */

header {
    text-align: center;
    margin-bottom: var(--space-32);
    padding: var(--space-24);
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

header p {
    line-height: 2.5;
}

header p a {
    display: inline-block;
    padding: 8px 16px;
    margin: 4px;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: #1e293b;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(251, 191, 36, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

header p a:hover {
    background: linear-gradient(135deg, #fcd34d 0%, #fbbf24 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(251, 191, 36, 0.5);
    border-color: rgba(255, 255, 255, 0.4);
}

header p a:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(251, 191, 36, 0.4);
}

header p a:focus {
    outline: 3px solid #fcd34d;
    outline-offset: 3px;
}

h1 {
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    font-weight: 700;
    color: #ffffff;
    margin-bottom: var(--space-8);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.subtitle {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 400;
    line-height: 1.6;
    margin-bottom: var(--space-16);
}

.resources {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.95);
    line-height: 1.7;
    margin-top: var(--space-16);
}

.resources a {
    color: #fbbf24;
    font-weight: 600;
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
}

.resources a:hover {
    color: #fcd34d;
    text-decoration-color: #fcd34d;
    transform: translateY(-1px);
}

.resources a:focus {
    outline: 2px solid #fbbf24;
    outline-offset: 4px;
    border-radius: 4px;
}

.calendar-container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: var(--radius-lg);
    padding: var(--space-24);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    margin-bottom: var(--space-24);
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-24);
    color: var(--color-background);
}

.calendar-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
}

.calendar-nav {
    display: flex;
    gap: var(--space-8);
}

.nav-btn {
    background: var(--color-primary);
    color: white;
    border: none;
    padding: var(--space-8) var(--space-16);
    border-radius: var(--radius-base);
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.nav-btn:hover {
    background: var(--color-primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.nav-btn:active {
    transform: translateY(0);
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: var(--space-8);
    margin-bottom: var(--space-16);
}

.weekday {
    text-align: center;
    font-weight: 600;
    color: var(--color-primary);
    padding: var(--space-8);
    font-size: 0.85rem;
    text-transform: uppercase;
}

.day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-base);
    background: #f1f5f9;
    color: var(--color-background);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    position: relative;
    font-size: 0.95rem;
}

.day:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.day.empty {
    background: transparent;
    cursor: default;
}

.day.empty:hover {
    transform: none;
    box-shadow: none;
}

.day.today {
    background: var(--color-today);
    color: white;
    font-weight: 700;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.3);
}

.day.has-lesson {
    background: var(--color-lesson-day);
    color: white;
    font-weight: 700;
    position: relative;
}

.day.has-lesson::after {
    content: '▶';
    position: absolute;
    bottom: 4px;
    right: 6px;
    font-size: 0.6rem;
    opacity: 0.8;
}

.day.has-lesson:hover {
    background: var(--color-lesson-day-hover);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.5);
}

.day.selected {
    border-color: var(--color-secondary);
    box-shadow: 0 0 0 3px rgba(236, 72, 153, 0.3);
}

.video-container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: var(--radius-lg);
    padding: var(--space-24);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    display: none;
    animation: slideIn 0.4s ease;
}

.video-container.show {
    display: block;
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.video-header {
    margin-bottom: var(--space-16);
    color: var(--color-background);
}

.video-header h3 {
    font-size: 1.3rem;
    margin-bottom: var(--space-8);
    color: var(--color-primary);
}

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

.video-wrapper {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: var(--radius-base);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    border-radius: var(--radius-base);
}

.legend {
    display: flex;
    gap: var(--space-16);
    justify-content: center;
    flex-wrap: wrap;
    padding: var(--space-16);
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-base);
    margin-top: var(--space-16);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: var(--space-8);
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.9);
}

.legend-color {
    width: 20px;
    height: 20px;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.no-data {
    text-align: center;
    padding: var(--space-32);
    color: var(--color-text-secondary);
    font-style: italic;
}

@media (max-width: 640px) {
    body {
        padding: var(--space-8);
    }

    .calendar-container,
    .video-container {
        padding: var(--space-16);
    }

    .calendar-header h2 {
        font-size: 1.2rem;
    }

    .weekday {
        font-size: 0.7rem;
        padding: var(--space-4);
    }

    .day {
        font-size: 0.85rem;
    }

    .legend {
        gap: var(--space-8);
    }

    .legend-item {
        font-size: 0.75rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
}