/* Стили для красивого календаря выбора дат */

.date-picker-container {
    position: relative;
    display: inline-block;
    width: 100%;
}

.date-input-field {
    width: 100%;
    padding: 10px 40px 10px 40px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background-color: #ffffff;
    font-size: 14px;
    color: #374151;
    font-family: 'Inter', sans-serif;
    transition: all 0.3s ease;
    cursor: pointer;
    height: 42px;
    line-height: 1.25;
    box-sizing: border-box;
    background-image: url('data:image/svg+xml;charset=utf-8,%3Csvg xmlns=\'http://www.w3.org/2000/svg\' fill=\'none\' viewBox=\'0 0 24 24\' stroke=\'%2374909c\' stroke-width=\'2\'%3E%3Cpath stroke-linecap=\'round\' stroke-linejoin=\'round\' d=\'M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z\'/%3E%3C/svg%3E');
    background-position: left 12px center;
    background-repeat: no-repeat;
    background-size: 16px;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.date-input-field:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    outline: none;
    transform: translateY(-1px);
}

.date-input-field.has-value {
    color: #111827;
    font-weight: 500;
}

.date-input-field::placeholder {
    color: #9ca3af;
    font-weight: normal;
}

/* Календарь */
.calendar-popup {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    z-index: 9999;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    pointer-events: none;
    margin-top: 4px;
    width: 320px;
    min-width: 320px;
    max-width: 320px;
    backdrop-filter: blur(8px);
}

.calendar-popup.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
}

.calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 16px;
    border-bottom: 1px solid #e5e7eb;
    background: #ffffff;
    border-radius: 12px 12px 0 0;
}

.calendar-nav-button {
    width: 36px;
    height: 36px;
    border: 1px solid #e5e7eb;
    background: #ffffff;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #374151;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.calendar-nav-button:hover {
    background: #f8fafc;
    color: #111827;
    border-color: #d1d5db;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.calendar-nav-button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.calendar-month-year {
    font-weight: 600;
    color: #111827;
    font-size: 18px;
    font-family: 'Inter', sans-serif;
}

.calendar-grid {
    padding: 0 24px 24px;
    background: #ffffff;
    border-radius: 0 0 12px 12px;
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin-bottom: 8px;
    width: 100%;
}

.calendar-weekday {
    text-align: center;
    padding: 8px 4px;
    font-size: 12px;
    font-weight: 500;
    color: #6b7280;
    text-transform: uppercase;
    width: 36px;
    flex-shrink: 0;
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    width: 100%;
    max-width: 100%;
}

.calendar-day {
    width: 36px;
    height: 36px;
    border: 1px solid transparent;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    color: #374151;
    position: relative;
    font-family: 'Inter', sans-serif;
    flex-shrink: 0;
}

.calendar-day:hover:not(:disabled) {
    background: #f8fafc;
    color: #111827;
    border-color: #e5e7eb;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.06);
}

.calendar-day:disabled {
    color: #d1d5db;
    cursor: not-allowed;
}

.calendar-day.other-month {
    color: #d1d5db;
}

.calendar-day.selected {
    background: #2563eb;
    color: white;
    border-color: #2563eb;
    box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.3);
    font-weight: 600;
}

.calendar-day.in-range {
    background: #dbeafe;
    color: #1e40af;
    border-color: #bfdbfe;
}

.calendar-day.range-start {
    background: #2563eb;
    color: white;
    border-radius: 8px 0 0 8px;
    border-color: #2563eb;
    box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.3);
    font-weight: 600;
}

.calendar-day.range-end {
    background: #2563eb;
    color: white;
    border-radius: 0 8px 8px 0;
    border-color: #2563eb;
    box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.3);
    font-weight: 600;
}

.calendar-day.range-start.range-end {
    border-radius: 8px;
}

.calendar-day.today {
    background: #fef3c7;
    color: #92400e;
    font-weight: 600;
    border-color: #fbbf24;
}

.calendar-day.today.selected,
.calendar-day.today.range-start,
.calendar-day.today.range-end {
    background: #2563eb;
    color: white;
    border-color: #2563eb;
}

/* Адаптивные стили */
@media (max-width: 640px) {
    .calendar-popup {
        left: -10px;
        right: -10px;
        margin-top: 8px;
        width: auto;
        min-width: auto;
        max-width: none;
    }

    .calendar-header {
        padding: 12px 16px 8px;
    }

    .calendar-grid {
        padding: 0 16px 16px;
    }

    .calendar-day {
        width: 32px;
        height: 32px;
        font-size: 13px;
    }

    .calendar-weekday {
        width: 32px;
    }

    .calendar-month-year {
        font-size: 15px;
    }
}

/* Анимация появления */
@keyframes calendarSlideIn {
    from {
        opacity: 0;
        transform: translateY(-10px) scale(0.95);
    }

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

.calendar-popup.show {
    animation: calendarSlideIn 0.2s ease-out;
}

/* Стили для диапазона дат */
.date-range-picker {
    display: flex;
    gap: 8px;
    align-items: center;
}

.date-range-separator {
    color: #9ca3af;
    font-weight: 500;
    font-size: 14px;
    flex-shrink: 0;
}

/* Для grid layout в hero секции */
.hero-date-fields {
    display: contents;
}

@media (max-width: 1024px) {
    .date-range-picker {
        flex-direction: column;
        gap: 12px;
    }

    .date-range-separator {
        display: none;
    }
}

/* Улучшенные состояния фокуса */
.date-input-field:focus-within,
.date-picker-container.active .date-input-field {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

/* Фон-подложка для мобильных */
.calendar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 9998;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.calendar-overlay.show {
    opacity: 1;
    pointer-events: all;
}

/* Стили для мобильных устройств */
@media (max-width: 480px) {
    .calendar-popup {
        position: fixed !important;
        top: 50% !important;
        left: 50% !important;
        right: auto !important;
        transform: translate(-50%, -50%) !important;
        margin: 0 !important;
        max-width: 320px;
        width: 90vw;
        max-height: 80vh;
        border-radius: 16px;
        z-index: 9999;
    }

    .calendar-popup.show {
        transform: translate(-50%, -50%) scale(1) !important;
    }
}