/* CSS Reset и базовые стили */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* CSS переменные для цветовой схемы */
:root {
    /* Основные цвета градиента */
    --gradient-start: #667eea;
    --gradient-middle: #764ba2;
    --gradient-end: #667eea;
    
    /* Цвета прогресс-бара */
    --progress-bg: rgba(255, 255, 255, 0.2);
    --progress-fill-start: #48bb78;
    --progress-fill-end: #38a169;
    
    /* Цвета текста */
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.9);
    --text-muted: rgba(255, 255, 255, 0.7);
    
    /* Размеры шрифтов */
    --font-size-h1: 2.5rem;
    --font-size-countdown: 2rem;
    --font-size-date-labels: 0.9rem;
    
    /* Размеры компонентов */
    --progress-bar-height: 25px;
    --container-max-width: 600px;
    --container-padding: 2rem;
    
    /* Анимации */
    --transition-fast: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* Базовые стили body */
body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Roboto', 'Oxygen', 
                 'Ubuntu', 'Cantarell', 'Open Sans', 'Helvetica Neue', sans-serif;
    background: linear-gradient(135deg, var(--gradient-start) 0%, var(--gradient-middle) 50%, var(--gradient-end) 100%);
    min-height: 100vh;
    color: var(--text-primary);
    font-weight: 400;
    line-height: 1.6;
    overflow-x: hidden;
}

/* Flexbox центрирование основного контента */
.container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: var(--container-padding);
    text-align: center;
}

/* Стили заголовка */
header h1 {
    font-size: var(--font-size-h1);
    font-weight: 600;
    margin-bottom: 3rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    color: var(--text-primary);
}

/* Секция счетчика */
.countdown-section {
    margin-bottom: 3rem;
    width: 100%;
}

.countdown-display {
    font-size: var(--font-size-countdown);
    font-weight: 500;
    color: var(--text-primary);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    margin-bottom: 1rem;
    transition: all var(--transition-fast);
}

/* Секция прогресс-бара */
.progress-section {
    width: 100%;
    margin-top: 2rem;
}

/* Контейнер прогресс-бара с фиксированной высотой */
.progress-bar {
    width: 100%;
    height: var(--progress-bar-height);
    background: var(--progress-bg);
    border-radius: calc(var(--progress-bar-height) / 2);
    overflow: hidden;
    position: relative;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* Заполняемая область с плавной анимацией */
.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--progress-fill-start) 0%, var(--progress-fill-end) 100%);
    border-radius: calc(var(--progress-bar-height) / 2);
    transition: width var(--transition-slow);
    position: relative;
    overflow: hidden;
}

/* Анимированный блик на прогресс-баре */
.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.4) 50%, 
        transparent 100%);
    animation: shine 2s infinite;
}

@keyframes shine {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Подписи дат под прогресс-баром */
.date-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 0.5rem;
    font-size: var(--font-size-date-labels);
    color: var(--text-muted);
    font-weight: 400;
}

.start-date,
.end-date {
    transition: color var(--transition-fast);
}

.start-date:hover,
.end-date:hover {
    color: var(--text-secondary);
}

/* Адаптивный дизайн */

/* Мобильные устройства (320px-768px) */
@media (max-width: 768px) {
    :root {
        --font-size-h1: 2rem;
        --font-size-countdown: 1.5rem;
        --font-size-date-labels: 0.8rem;
        --progress-bar-height: 20px;
        --container-padding: 1.5rem;
    }
    
    .container {
        padding: 1rem;
    }
    
    header h1 {
        margin-bottom: 2rem;
    }
    
    .countdown-section {
        margin-bottom: 2rem;
    }
}

/* Планшеты (768px-1024px) */
@media (min-width: 768px) and (max-width: 1024px) {
    :root {
        --font-size-h1: 2.25rem;
        --font-size-countdown: 1.75rem;
        --font-size-date-labels: 0.85rem;
        --progress-bar-height: 22px;
        --container-padding: 1.75rem;
    }
}

/* Десктоп (1024px+) */
@media (min-width: 1024px) {
    :root {
        --font-size-h1: 2.5rem;
        --font-size-countdown: 2rem;
        --font-size-date-labels: 0.9rem;
        --progress-bar-height: 25px;
        --container-padding: 2rem;
    }
    
    /* Hover-эффекты для десктопа */
    .progress-bar:hover {
        transform: scale(1.02);
        transition: transform var(--transition-fast);
    }
    
    .countdown-display:hover {
        transform: scale(1.05);
        text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    }
}

/* Пульсация при критических значениях времени (будет добавлено через JS) */
.critical-time {
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { 
        transform: scale(1);
        opacity: 1;
    }
    50% { 
        transform: scale(1.05);
        opacity: 0.8;
    }
    100% { 
        transform: scale(1);
        opacity: 1;
    }
}

/* Состояние "Отпуск начался" */
.vacation-started {
    color: var(--progress-fill-start);
    font-size: calc(var(--font-size-countdown) * 1.2);
    animation: celebration 2s ease-in-out;
}

@keyframes celebration {
    0%, 100% { transform: scale(1); }
    25% { transform: scale(1.1) rotate(2deg); }
    75% { transform: scale(1.1) rotate(-2deg); }
}

/* Плавные переходы для обновления счетчика */
.countdown-display,
.progress-fill,
.date-labels span {
    transition: all var(--transition-fast);
}

/* Улучшенная читаемость на градиентном фоне */
.container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.1);
    z-index: -1;
    border-radius: 20px;
}