:root {
    --primary-color: #2f21b3;
}

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

.bg-light-2 {
    background: #fff !important;
}

.timetable-title {
    text-align: center;
    margin-bottom: 15px;
}

.search-box-container {
    display: flex;
    justify-content: center;
    margin-bottom: 220px;
}


.search-box {
    padding: 20px 30px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    max-width: 900px;
    width: 100%;
    height: max-content;
}

.form-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.form-control {
    flex: 1;
    border: 1px solid var(--primary-color);
    border-radius: 6px;
    padding: 12px 15px;
    font-size: 16px;
    color: var(--primary-color);
    outline: none;
}

.search-btn {
    background: var(--primary-color);
    border: none;
    padding: 5px 30px;
    border-radius: 8px;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    transition: 0.3s;

}

/* Кнопки фильтра */
.filter-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.filter-btn {
    background: #fff;
    border: 1px solid var(--primary-color);
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    transition: 0.3s;
    font-size: 14px;
    color: var(--primary-color);
}

.filter-btn:hover {
    background: var(--primary-color);
    color: #fff;
}

.filter-btn.active {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

.calendar-header button {
    background: #fff;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    border-radius: 5px;
    padding: 5px 10px;
}

.calendar-header button:hover {
    background: var(--primary-color);
    /* border: 1px solid var(--primary-color); */
    color: #fff;
}

/* Результаты */
.results {
    margin-top: 20px;
}

.flight-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 15px 20px;
    margin-bottom: 15px;
    background: #fff;
}

.flight-side {
    width: 20%;
    text-align: left;
}

.flight-side.right {
    text-align: right;
}

.city {
    font-size: 21px;
    font-weight: bold;
}

.code {
    font-size: 14px;
    color: #777;
}

.time {
    font-size: 22px;
    font-weight: 500;
}

.date {
    font-size: 14px;
    color: #555;
}

.flight-center {
    flex: 1;
    text-align: center;
}

.duration {
    font-size: 14px;
    margin-bottom: 5px;
    color: #333;
}

.line {
    height: 2px;
    background: #ccc;
    margin: 5px 0;
    position: relative;
}

.line::before,
.line::after {
    content: "";
    position: absolute;
    top: -4px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #666;
}

.line::before {
    left: 0;
}

.line::after {
    right: 0;
}

.stops {
    font-size: 13px;
    color: #1a73e8;
    cursor: pointer;
}

.btn-container {
    display: flex;
    justify-content: end;
    align-items: center;
}

/* Обертка */
.date-picker {
    position: relative;
    flex: 1;
}

/* Поле выбора */
.date-input {
    border: 1px solid var(--primary-color);
    border-radius: 6px;
    padding: 7px 15px;
    font-size: 16px;
    color: var(--primary-color);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.calendar-icon {
    font-size: 18px;
}

/* Попап */
.calendar-popup {
    display: none;
    position: absolute;
    top: 50px;
    right: 0;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    width: 600px;
    display: flex;
}

/* Левая панель */
.calendar-sidebar {
    background: #f7f9fc;
    border-right: 1px solid #ddd;
    padding: 10px;
    width: 120px;
}

.calendar-sidebar button {
    display: block;
    width: 100%;
    padding: 8px;
    margin-bottom: 5px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    text-align: left;
    background: transparent;
    color: var(--primary-color);
}

.calendar-sidebar button:hover,
.calendar-sidebar button.active {
    background: var(--primary-color);
    color: #fff;
}

/* Правая часть */
.calendar-main {
    flex: 1;
    padding: 15px;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
    margin-top: 10px;
}

.day {
    padding: 8px;
    text-align: center;
    border-radius: 4px;
    cursor: pointer;
}

.day:hover {
    background: #eee;
}

.day.selected {
    background: var(--primary-color);
    color: #fff;
}

.day.in-range {
    background: #d6d4f7;
}


@media (max-width: 768px) {
    .form-row {
        flex-direction: column;
    }

    .flight-card {
        padding: 10px 15px;
        margin-bottom: 10px;
    }

    .flight-side,
    .flight-side.right {
        /* width: 100%; */
        /* text-align: center; */
        width: 110px;
    }

    .city {
        font-size: 14px;
    }

    .time {
        font-size: 20px;
    }

    .date {
        font-size: 13px;
    }

    .form-control {
        width: 100%;
    }

    .search-btn {
        width: 100%;
    }

    .date-picker {
        width: 100%;
    }

    .calendar-popup {
        flex-direction: column;
        width: 100%;
    }

    .flight-center {
        width: 100px;
    }

    .duration {
        font-size: 12px;
    }

    .line::before,
    .line::after {
        width: 6px;
        height: 6px;
        top: -3px;
    }

    .search-box {
        padding: 10px 20px;
    }

    .calendar-sidebar {
        width: auto;
        display: flex;
        gap: 10px;
    }

    .calendar-sidebar button {
        text-align: center;
        border: 1px solid var(--primary-color);
    }

    .day {
        padding: 0;
    }

    .calendar-header button {
        padding: 0 10px;
    }
}

#calendarPopup {
    display: none;
    position: absolute;
}

.no-flights-found {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}
