/* AirSmart Styles v2 */

/* ===================== БАЗОВЫЕ СТИЛИ ===================== */

* {
    box-sizing: border-box;
}

/* Адаптивность для пользователей с ограничениями */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ===================== КАЛЕНДАРЬ ===================== */

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    margin-bottom: 8px;
}

.weekday-cell {
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
    padding: 8px 0;
}

.calendar-days-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
}

.calendar-day {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    cursor: pointer;
    background: #f8fafc;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    padding: 10px 4px;
    min-width: 0;
}

.calendar-day:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
    transform: scale(1.02);
}

.calendar-day.empty {
    background: transparent;
    cursor: default;
    pointer-events: none;
}

.calendar-day.has-price {
    background: #dbeafe;
}

.calendar-day:active:not(.empty) {
    transform: scale(0.98);
}

.calendar-day:hover:not(.empty) {
    background: #bfdbfe;
    transform: scale(1.02);
}

.calendar-day .day-number {
    font-size: 15px;
    font-weight: 600;
    color: #1e293b;
}

.calendar-day .day-price {
    font-size: 10px;
    font-weight: 700;
    margin-top: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.calendar-day .day-price.low { 
    color: #10b981; 
}

.calendar-day .day-price.medium { 
    color: #f59e0b; 
}

.calendar-day .day-price.high { 
    color: #ef4444; 
}

/* Контейнер календаря */
#calendar-grid {
    width: 100%;
}

.bg-white.rounded-2xl {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* ===================== КАРТОЧКИ НАПРАВЛЕНИЙ ===================== */

.city-card {
    transition: all 0.2s ease;
    cursor: pointer;
}

.city-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
}

.city-card:active {
    transform: translateY(0px);
}

.city-card:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Логотипы авиакомпаний в карточках */
.city-card img {
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.city-card:hover img {
    transform: scale(1.05);
}

/* ===================== АВТОКОМПЛИТ ===================== */

#origin-suggestions {
    max-height: 300px;
    overflow-y: auto;
    scrollbar-width: thin;
}

#origin-suggestions::-webkit-scrollbar {
    width: 6px;
}

#origin-suggestions::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

#origin-suggestions::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

#origin-suggestions::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.suggestion-item {
    transition: all 0.15s ease;
    cursor: pointer;
}

.suggestion-item:hover {
    background: #f1f5f9;
}

.suggestion-item:active {
    background: #e2e8f0;
    transform: scale(0.99);
}

.suggestion-item:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: -2px;
}

/* ===================== БЫСТРЫЕ ГОРОДА ===================== */

.quick-city-btn {
    transition: all 0.15s ease;
    cursor: pointer;
}

.quick-city-btn:hover {
    background: #dbeafe !important;
    color: #1d4ed8 !important;
    transform: translateY(-1px);
}

.quick-city-btn:active {
    transform: scale(0.96);
}

.quick-city-btn:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* ===================== ПОЛЗУНОК БЮДЖЕТА ===================== */

input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    background: #e2e8f0;
    height: 4px;
    border-radius: 2px;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #3b82f6;
    cursor: pointer;
    transition: transform 0.1s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    background: #2563eb;
}

input[type="range"]::-webkit-slider-thumb:active {
    transform: scale(0.9);
}

/* Firefox */
input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #3b82f6;
    cursor: pointer;
    border: none;
}

/* ===================== АНИМАЦИИ ===================== */

@keyframes spin {
    to { transform: rotate(360deg); }
}

.animate-spin {
    animation: spin 1s linear infinite;
}

/* Анимация появления карточек */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.city-card {
    animation: fadeInUp 0.3s ease-out;
}

/* Анимация для календаря при смене месяца */
.calendar-days-grid {
    animation: fadeInUp 0.2s ease-out;
}

/* ===================== АДАПТИВ ===================== */

/* Планшеты */
@media (max-width: 768px) {
    .calendar-days-grid {
        gap: 4px;
    }
    
    .calendar-day {
        padding: 6px 2px;
    }
    
    .calendar-day .day-number {
        font-size: 13px;
    }
    
    .calendar-day .day-price {
        font-size: 9px;
        margin-top: 2px;
    }
    
    .weekday-cell {
        font-size: 12px;
        padding: 6px 0;
    }
}

/* Телефоны */
@media (max-width: 600px) {
    .calendar-days-grid {
        gap: 3px;
    }
    
    .calendar-day {
        padding: 4px 2px;
        border-radius: 8px;
    }
    
    .calendar-day .day-number {
        font-size: 12px;
    }
    
    .calendar-day .day-price {
        font-size: 8px;
        margin-top: 2px;
    }
    
    .weekday-cell {
        font-size: 11px;
        padding: 4px 0;
    }
    
    /* Карточки на телефонах */
    .city-card {
        padding: 12px;
    }
    
    .city-card .text-2xl {
        font-size: 1.25rem;
    }
    
    .city-card img {
        width: 32px;
        height: 32px;
    }
}

/* Очень маленькие телефоны */
@media (max-width: 380px) {
    .calendar-day .day-price {
        font-size: 7px;
    }
    
    .calendar-day .day-number {
        font-size: 11px;
    }
}

/* Ландшафтная ориентация на телефонах */
@media (max-width: 768px) and (orientation: landscape) {
    .calendar-days-grid {
        gap: 2px;
    }
    
    .calendar-day {
        padding: 2px;
    }
    
    .calendar-day .day-price {
        display: none; /* Скрываем цены в ландшафте для экономии места */
    }
}

/* ===================== УТИЛИТЫ ===================== */

/* Скрытие элементов */
.hidden {
    display: none;
}

/* Обрезка текста */
.text-truncate {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Отключение выделения для интерактивных элементов */
.city-card,
.quick-city-btn,
.calendar-day,
.suggestion-item {
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

/* Стили для disabled состояния */
button:disabled,
.quick-city-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}