/* Общие стили */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f4f7fa; /* Светлый фон */
    color: #333;
}

/* Заголовок сайта (Шапка) */
.site-header {
    background-color: #1e90ff; /* Яркий синий цвет */
    color: white;
    padding: 20px 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.site-header h1 {
    margin: 0;
    font-size: 1.8em;
}

.site-header a {
    color: white;
    text-decoration: none;
    margin-left: 20px;
    padding: 5px 10px;
    transition: background-color 0.3s;
}

.site-header a:hover {
    background-color: #156ecb;
    border-radius: 4px;
}

/* Основной контент */
main {
    padding: 40px 5%;
    max-width: 1200px;
    margin: 0 auto;
}

/* Блок поиска (Widget) */
.search-widget {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    margin-bottom: 40px;
}

.search-widget h2 {
    color: #1e90ff;
    border-bottom: 2px solid #eee;
    padding-bottom: 15px;
    margin-top: 0;
}

/* Группы ввода */
.input-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 20px;
}

.input-group label {
    font-weight: bold;
    color: #555;
    margin-bottom: 8px;
}

.input-group input, .input-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    box-sizing: border-box; /* Важно для корректности ширины */
    font-size: 1em;
}

/* Группа дат (для размещения в ряд) */
.date-group {
    display: flex;
    gap: 20px;
    margin-bottom: 25px;
}

.date-group .input-group {
    flex: 1; /* Делает обе даты одинаковой ширины */
}

/* Блок действий (Пассажиры и кнопка) */
.search-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.search-actions select {
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    margin-right: 15px;
}

/* Кнопка поиска */
#search-button {
    background-color: #ff4d6d; /* Яркий акцентный цвет (красный/розовый) */
    color: white;
    padding: 12px 30px;
    border: none;
    border-radius: 6px;
    font-size: 1.1em;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.1s;
}

#search-button:hover {
    background-color: #e74260;
    transform: translateY(-2px);
}

/* Результаты поиска */
.results-container h2 {
    color: #1e90ff;
    margin-top: 0;
}

/* Сообщение загрузки */
#loading-message {
    text-align: center;
    padding: 50px;
    font-size: 1.2em;
    color: #666;
    display: none; /* Сначала скрыто */
}

/* Стиль для отдельной карточки рейса */
.flight-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    margin-bottom: 15px;
    background: white;
    border-left: 4px solid #ff4d6d; /* Акцентная линия */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s;
}

.flight-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1);
}

/* Блок времени и рейса */
.flight-details {
    display: flex;
    gap: 40px;
    align-items: center;
    flex-basis: 65%; /* Занимает большую часть места */
}

.time-info {
    text-align: center;
    flex-shrink: 0; /* Не сжимается при малой ширине */
}
.time-info p { margin: 3px 0; font-size: 0.9em;}
.time-info strong { display: block; font-size: 1.4em; }

/* Информация о пересадках и авиакомпании */
.airline-info {
    flex-grow: 1;
}
.airline-info p { margin: 2px 0; font-size: 0.95em;}


/* Блок цены и кнопки */
.price-section {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    width: 25%; /* Фиксированная ширина для ценника */
}

.price-section span {
    font-size: 1.8em;
    color: #ff4d6d;
    font-weight: bold;
}

/* Медиазапросы для адаптивности */
@media (max-width: 768px) {
    .date-group {
        flex-direction: column;
        gap: 15px;
    }
    
    .search-actions {
        flex-direction: column;
        align-items: stretch;
    }

    #search-button, .search-actions select {
        width: 100%;
        margin-top: 10px;
    }

    /* Стили для результатов на мобильных */
    .flight-details {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }

    .time-info, .airline-info {
        width: 100%;
    }

    /* Делаем блоки более вертикальными */
    .flight-details > * {
        margin: 0 auto;
    }
}
