/* reset & base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', sans-serif;
    background: #F5F7FA;
    color: #2C3E50;
    line-height: 1.5;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main {
    flex: 1;
    max-width: 1280px;
    margin: 2rem auto;
    padding: 0 1.5rem;
    width: 100%;
}

/* header */
.main-header {
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.logo a {
    font-size: 1.8rem;
    font-weight: 700;
    color: #1E88E5;
    text-decoration: none;
    letter-spacing: -0.5px;
}

.logo span {
    font-weight: 300;
    color: #FFB300;
}

.nav-menu {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.nav-menu a {
    text-decoration: none;
    color: #2C3E50;
    font-weight: 500;
    transition: color 0.2s;
}

.nav-menu a:hover {
    color: #1E88E5;
}

.user-greeting {
    background: #1E88E5;
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 30px;
    font-size: 0.9rem;
}

.burger {
    display: none;
    font-size: 1.8rem;
    cursor: pointer;
    background: none;
    border: none;
}

/* ===== Форма поиска ===== */
    #city_filter_form {
        display: flex;
        width: 100%;
        max-width: 1200px;
        margin: 10px auto;
        gap: 10px;
        align-items: flex-start;
        flex-wrap: wrap;
        position: relative;
    }

    .form-group {
        position: relative;
        flex: 1;
        min-width: 110px;
    }

    .city_input_wrapper {
        position: relative;
    }

    .city_input {
        width: 100%;
        padding: 12px 40px 12px 15px;
        border: 2px solid #ddd;
        border-radius: 8px;
        font-size: 16px;
        box-sizing: border-box;
        transition: all 0.3s ease;
        background: white;
        color: #080808;
        height: 48px;
    }

    .city_input:focus {
        outline: none;
        border-color: #4a90e2;
        box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
    }

    .city_input.valid {
        border-color: #36b37e;
    }

    .city_input.error {
        border-color: #ff5630;
    }

    .clear_btn {
        position: absolute;
        right: 12px;
        top: 40%;
        transform: translateY(-50%);
        width: 20px;
        height: 20px;
        background: none;
        border: none;
        cursor: pointer;
        opacity: 0.6;
        transition: opacity 0.2s;
        padding: 0;
        display: none;
    }

    .clear_btn:hover {
        opacity: 1;
    }

    .clear_btn::before,
    .clear_btn::after {
        content: '';
        position: absolute;
        top: 50%;
        left: 50%;
        width: 14px;
        height: 2px;
        background: #666;
        border-radius: 1px;
    }

    .clear_btn::before {
        transform: translate(-50%, -50%) rotate(45deg);
    }

    .clear_btn::after {
        transform: translate(-50%, -50%) rotate(-45deg);
    }

    .autocomplete_dropdown {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        border: 1px solid #ddd;
        border-top: none;
        border-radius: 0 0 8px 8px;
        max-height: 300px;
        overflow-y: auto;
        z-index: 1000;
        box-shadow: 0 4px 20px rgba(0,0,0,0.15);
        display: none;
        animation: fadeIn 0.2s ease;
    }

    @keyframes fadeIn {
        from {
            opacity: 0;
            transform: translateY(-10px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .autocomplete_item {
        padding: 12px 15px;
        cursor: pointer;
        transition: background-color 0.2s;
        border-bottom: 1px solid #f0f0f0;
        display: flex;
        align-items: center;
        gap: 10px;
    }

    .autocomplete_item:last-child {
        border-bottom: none;
    }

    .autocomplete_item:hover,
    .autocomplete_item.active {
        background-color: #f5f9ff;
    }

    .city_name {
        font-weight: 500;
        color: #333;
    }
.city_region {
    font-size: 0.75em;
    color: #6c757d;
    margin-top: 2px;
    line-height: 1.2;
}

    .loading_indicator {
        padding: 15px;
        text-align: center;
        color: #666;
        font-style: italic;
    }

    .no_results {
        padding: 15px;
        text-align: center;
        color: #999;
    }

    .btn_search {
        padding: 0 30px;
        background: linear-gradient(135deg, #ffd067 0%, #edc500 100%);
        color: #181818;
        border: none;
        border-radius: 8px;
        font-size: 16px;
        font-weight: 600;
        cursor: pointer;
        transition: all 0.3s ease;
        white-space: nowrap;
        height: 48px;
        min-width: 150px;
        flex-shrink: 0;
    }

    .btn_search:hover:not(:disabled) {
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
    }

    .btn_search:active:not(:disabled) {
        transform: translateY(0);
    }

    .btn_search:disabled {
        opacity: 0.9;
        cursor: not-allowed;
        background: linear-gradient(135deg, #ffd067 0%, #edc500 100%);
    }

    .input_hint {
        position: absolute;
        bottom: -20px;
        left: 0;
        font-size: 12px;
        color: #999;
        opacity: 0;
        transition: opacity 0.3s;
        pointer-events: none;
    }

    .city_input:focus + .input_hint {
        opacity: 1;
    }

    @media (max-width: 768px) {
        #city_filter_form {
            flex-direction: column;
            gap: 10px;
            margin-bottom: 20px;
        }
        
        .form-group {
            width: 100%;
            margin: 5px 0;
        }
        
        .btn_search {
            width: 100%;
            min-width: auto;
        }
    }

    /* Стили для результатов поиска */
    .city_icon {
        width: 20px;
        height: 20px;
        background: #667eea;
        border-radius: 50%;
        flex-shrink: 0;
        position: relative;
    }

    .city_icon::before {
        content: '📍';
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        font-size: 12px;
    }
    
/* Поле поиска города/региона */
.autocomplete-wrapper {
    position: relative;
}
.autocomplete-dropdown {
    display: none;
    position: absolute;
    background: white;
    border: 1px solid #ccc;
    border-radius: 6px;
    max-height: 150px;
    overflow-y: auto;
    z-index: 1000;
    width: 100%;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}
.autocomplete-item {
    padding: 6px 12px;
    cursor: pointer;
}
.autocomplete-item:hover {
    background: #f0f0f0;
}

/* footer */
.main-footer {
    background: white;
    border-top: 1px solid #E2E8F0;
    padding: 2rem 1.5rem;
    margin-top: 3rem;
}

.footer-container {
    max-width: 1280px;
    margin: 0 auto;
    text-align: center;
    color: #718096;
    font-size: 0.9rem;
}

/* карточки, формы, кнопки */
.card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}

.btn {
    display: inline-block;
    background: #1E88E5;
    color: white;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 30px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    text-decoration: none;
    font-size: 0.9rem;
}

.btn:hover {
    background: #1565C0;
}

.btn-outline {
    background: transparent;
    border: 1px solid #1E88E5;
    color: #1E88E5;
}

.btn-outline:hover {
    background: #1E88E5;
    color: white;
}

input, textarea, select {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #CBD5E0;
    border-radius: 12px;
    font-family: inherit;
    margin-bottom: 1rem;
    transition: border 0.2s;
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: #1E88E5;
    box-shadow: 0 0 0 3px rgba(30,136,229,0.1);
}

h1 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    font-weight: 600;
}

h2 {
    font-size: 1.5rem;
    margin: 1.5rem 0 1rem;
    font-weight: 500;
}

h3 {
    font-size: 1.2rem;
    margin: 1rem 0;
}

/* сетка городов и маршрутов */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin: 1.5rem 0;
}

.route-item, .city-card {
    background: white;
    border-radius: 16px;
    padding: 1.2rem;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
    transition: all 0.2s;
}

.route-item a, .city-card a {
    text-decoration: none;
    font-weight: 600;
    color: #1E88E5;
}

.route-item p {
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: #4A5568;
}

/* карта */
.map-placeholder {
    background: #E2E8F0;
    height: 300px;
    border-radius: 16px;
    margin: 1rem 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #718096;
}

/* отзывы */
.review {
    background: #F9FAFB;
    border-left: 4px solid #1E88E5;
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 12px;
}

/* мобильная адаптация */
@media (max-width: 768px) {
    .burger {
        display: block;
    }
    .nav-menu {
        display: none;
        width: 100%;
        flex-direction: column;
        gap: 1rem;
        margin-top: 1rem;
        text-align: center;
    }
    .nav-menu.active {
        display: flex;
    }
    main {
        padding: 0 1rem;
        margin: 1rem auto;
    }
    h1 {
        font-size: 1.6rem;
    }
}