/* СБРОС И БАЗОВЫЕ СТИЛИ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #136243;
    --primary-dark: #0d4a33;
    --bg-light: #f5f7fa;
    --text-dark: #1e293b;
    --text-soft: #334155;
    --border-color: #d1d5db;
    --white: #ffffff;
    --gray-icon: #4b5563;
    --footer-bg: #111827;
    --footer-text: #e5e7eb;
    --card-shadow: 0 4px 12px rgba(0,0,0,0.05);
    --hover-shadow: 0 8px 16px rgba(0,0,0,0.1);
    --favorite-color: #ffd700;
    --rating-high: #2e7d32;
    --rating-medium: #ff9800;
    --rating-low: #f44336;
    
    /* Цвета для информационной плашки */
    --promo-bg: #f8f4e9;
    --promo-border: #e2d9c8;
    --promo-text: #136243;
    --promo-text-hover: #1e7e5b;
    --promo-close: #9b8c78;
    --promo-close-hover: #136243;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ИНФОРМАЦИОННАЯ ПЛАШКА */
.info-banner {
    background-color: var(--promo-bg);
    border-bottom: 2px solid var(--promo-border);
    padding: 8px 0;
    position: sticky;
    top: 0;
    width: 100%;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.info-banner.hidden {
    display: none;
}

.info-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.info-link {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--promo-text);
    transition: color 0.2s;
    flex: 1;
}

.info-link:hover {
    color: var(--promo-text-hover);
}

.info-icon {
    font-size: 1.3rem;
    line-height: 1;
    min-width: 24px;
    text-align: center;
}

.info-text {
    font-size: 1rem;
    font-weight: 500;
    border-bottom: 1px dashed currentColor;
}

.info-close {
    background: none;
    border: none;
    color: var(--promo-close);
    font-size: 1.8rem;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
    flex-shrink: 0;
}

.info-close:hover {
    color: var(--promo-close-hover);
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 30px;
    width: 100%;
}

/* ШАПКА */
.header-image {
    width: 100%;
    background-color: var(--primary);
    border-radius: 0 0 16px 16px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    margin: 0 0 20px 0;
}

.header-image img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: cover;
    max-height: 400px;
    min-height: 120px;
    background-color: var(--primary);
}

/* НАВИГАЦИЯ */
.nav-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: var(--white);
    border: 2px solid var(--border-color);
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 500;
    transition: all 0.2s;
}

.back-btn:hover {
    border-color: var(--primary);
    background-color: #f9f9f9;
}

.back-arrow {
    font-size: 1.2rem;
    color: var(--primary);
}

/* ИЗБРАННОЕ */
.favorites-section {
    background: linear-gradient(135deg, #fff9e6, #fff);
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: var(--card-shadow);
    border: 1px solid #ffe68f;
}

.favorites-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: #b45f06;
    display: flex;
    align-items: center;
    gap: 10px;
}

.favorites-title::before {
    content: "⭐";
    font-size: 1.8rem;
}

.favorites-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
}

.favorite-card {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: white;
    border-radius: 10px;
    border: 1px solid #ffe68f;
    transition: all 0.2s;
    cursor: pointer;
}

.favorite-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--hover-shadow);
}

.favorite-number {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary);
    min-width: 70px;
}

/* БЛИЖАЙШИЕ АВТОБУСЫ */
.next-buses-section {
    background: var(--white);
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-color);
}

.section-title {
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text-dark);
    border-left: 6px solid var(--primary);
    padding-left: 16px;
}

.next-buses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 15px;
}

.next-bus-card {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: var(--bg-light);
    border-radius: 10px;
    border: 2px solid var(--border-color);
    transition: all 0.2s;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

.next-bus-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--hover-shadow);
}

.next-bus-time {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary);
    min-width: 80px;
    text-align: center;
}

.next-bus-info {
    flex: 1;
    min-width: 0;
}

.next-bus-route {
    font-weight: 600;
    font-size: 1.2rem;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.next-bus-destination {
    font-size: 0.95rem;
    color: var(--text-soft);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.next-bus-wait {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--primary-dark);
    background: #e8f5e9;
    padding: 4px 12px;
    border-radius: 20px;
    white-space: nowrap;
}

/* ПОИСК */
.search-section {
    margin-bottom: 30px;
}

.search-box {
    position: relative;
    margin-bottom: 20px;
}

.search-box input {
    width: 100%;
    padding: 15px 50px 15px 50px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 1.1rem;
    transition: all 0.2s;
    background: var(--white);
}

.search-box input:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(19,98,67,0.1);
}

.search-icon {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2rem;
    color: var(--gray-icon);
}

.search-clear {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.5rem;
    color: var(--gray-icon);
    cursor: pointer;
    display: none;
    width: 30px;
    height: 30px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--bg-light);
}

.search-clear.visible {
    display: flex;
}

.search-clear:hover {
    background: var(--border-color);
}

/* СЕТКА МАРШРУТОВ */
.routes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.route-card {
    background: var(--white);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 18px;
    transition: all 0.2s;
    cursor: pointer;
    position: relative;
}

.route-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--hover-shadow);
}

.route-card.favorite {
    border-color: var(--favorite-color);
    background: #fffdf5;
}

.favorite-star {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 1.5rem;
    cursor: pointer;
    color: #ddd;
    transition: all 0.2s;
    z-index: 2;
}

.favorite-star.active {
    color: var(--favorite-color);
}

.favorite-star:hover {
    transform: scale(1.2);
}

.route-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    margin-right: 40px;
}

.route-number {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--primary);
}

.rating-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: var(--bg-light);
    border-radius: 20px;
    font-size: 0.9rem;
    border: 1px solid var(--border-color);
}

.rating-badge.high {
    background: #e8f5e9;
    color: var(--rating-high);
    border-color: #a5d6a7;
}

.rating-badge.medium {
    background: #fff3e0;
    color: var(--rating-medium);
    border-color: #ffb74d;
}

.rating-badge.low {
    background: #ffebee;
    color: var(--rating-low);
    border-color: #ef9a9a;
}

.route-destination {
    font-size: 1.1rem;
    margin-bottom: 8px;
    color: var(--text-soft);
}

.route-price {
    color: #2e7d32;
    font-weight: 500;
    margin-bottom: 10px;
    font-size: 0.95rem;
}

.route-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 10px;
}

.time-badge {
    padding: 4px 8px;
    background: var(--bg-light);
    border-radius: 6px;
    font-size: 0.9rem;
    border: 1px solid var(--border-color);
}

.interval-badge {
    padding: 4px 8px;
    background: #e0f2fe;
    border-radius: 6px;
    font-size: 0.9rem;
    color: #0284c7;
    border: 1px solid #7dd3fc;
}

.season-badge {
    padding: 4px 8px;
    background: #fff3e0;
    border-radius: 6px;
    font-size: 0.9rem;
    color: #e65100;
    border: 1px solid #ffb74d;
    display: inline-block;
    margin-bottom: 8px;
}

/* МОДАЛЬНОЕ ОКНО */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--white);
    border-radius: 16px;
    max-width: 700px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 30px;
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
}

.close-modal {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 2rem;
    cursor: pointer;
    color: var(--gray-icon);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
    background: var(--bg-light);
    border: none;
}

.close-modal:hover {
    background: var(--border-color);
    color: var(--primary);
}

.modal-route-header {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.modal-route-number {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--primary);
}

.modal-route-rating {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-light);
    padding: 8px 15px;
    border-radius: 30px;
    border: 1px solid var(--border-color);
}

.modal-rating-stars {
    display: flex;
    gap: 2px;
}

.modal-star {
    color: #ffd700;
    font-size: 1.2rem;
}

.modal-star.empty {
    color: #ddd;
}

.modal-route-destination {
    font-size: 1.2rem;
    color: var(--text-soft);
    margin-bottom: 15px;
}

.modal-price {
    background: #e8f5e9;
    padding: 8px 15px;
    border-radius: 30px;
    display: inline-block;
    margin-bottom: 20px;
    color: #2e7d32;
    font-weight: 500;
}

.modal-season {
    background: #fff3e0;
    padding: 10px 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    color: #e65100;
    border: 1px solid #ffb74d;
}

.stops-section {
    background: var(--bg-light);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 25px;
    border: 1px solid var(--border-color);
}

.stops-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--text-dark);
}

.stops-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.stop-item {
    padding: 8px 15px;
    background: white;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.stop-item.start {
    border-left: 4px solid #4caf50;
}

.stop-item.end {
    border-left: 4px solid #f44336;
}

.stop-icon {
    font-size: 1.2rem;
}

.schedule-section {
    margin-bottom: 25px;
}

.schedule-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.schedule-tab {
    padding: 8px 16px;
    background: var(--white);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}

.schedule-tab:hover {
    border-color: var(--primary);
}

.schedule-tab.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.times-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 10px;
}

.time-item {
    background: var(--bg-light);
    padding: 10px;
    text-align: center;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    font-weight: 500;
}

.interval-info {
    background: #e0f2fe;
    padding: 15px;
    border-radius: 10px;
    color: #0284c7;
    border: 1px solid #7dd3fc;
}

.reviews-section {
    background: var(--bg-light);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 25px;
    border: 1px solid var(--border-color);
}

.reviews-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 15px;
}

.review-item {
    background: white;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 10px;
    border: 1px solid var(--border-color);
}

.review-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.review-stars {
    display: flex;
    gap: 3px;
}

.review-star {
    color: #ffd700;
    font-size: 1.1rem;
}

.review-star.empty {
    color: #ddd;
}

.review-date {
    font-size: 0.85rem;
    color: var(--gray-icon);
}

.review-text {
    color: var(--text-dark);
}

.review-form {
    margin-top: 15px;
}

.review-form textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 10px;
    font-family: inherit;
    resize: vertical;
}

.review-form textarea:focus {
    border-color: var(--primary);
    outline: none;
}

.review-stars-input {
    display: flex;
    gap: 5px;
    margin-bottom: 10px;
}

.review-star-input {
    font-size: 2rem;
    cursor: pointer;
    color: #ddd;
    transition: all 0.2s;
}

.review-star-input:hover,
.review-star-input.selected {
    color: #ffd700;
}

.review-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}

.review-btn:hover {
    background: var(--primary-dark);
}

/* КНОПКИ ПОДЕЛИТЬСЯ */
.share-section {
    background: var(--bg-light);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 25px;
    border: 1px solid var(--border-color);
}

.share-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--text-dark);
}

.share-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.share-btn {
    flex: 1;
    min-width: 120px;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: white;
    color: var(--text-dark);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s;
}

.share-btn:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--hover-shadow);
}

.share-btn.vk:hover {
    background: #4a76a8;
    color: white;
    border-color: #4a76a8;
}

.share-btn.tg:hover {
    background: #0088cc;
    color: white;
    border-color: #0088cc;
}

.share-btn.email:hover {
    background: #ea4335;
    color: white;
    border-color: #ea4335;
}

.share-btn.copy {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.share-btn.copy:hover {
    background: var(--primary-dark);
}

.share-icon {
    font-size: 1.2rem;
}

.modal-footer {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 10px;
    margin-top: 10px;
}

.modal-footer a, .modal-footer button {
    padding: 12px;
    text-align: center;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-dark);
    background: white;
    cursor: pointer;
    font-size: 0.95rem;
    transition: all 0.2s;
}

.modal-footer a:hover, .modal-footer button:hover {
    border-color: var(--primary);
}

.complaint-btn {
    background: #fee2e2 !important;
    color: #dc2626 !important;
    border-color: #fecaca !important;
}

.complaint-btn:hover {
    background: #fecaca !important;
}

/* МОДАЛЬНОЕ ОКНО ЖАЛОБЫ */
.complaint-form {
    margin-top: 20px;
}

.complaint-form select, .complaint-form textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 15px;
    font-family: inherit;
}

.complaint-submit {
    width: 100%;
    padding: 15px;
    background: #dc2626;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    cursor: pointer;
}

.complaint-submit:hover {
    background: #b91c1c;
}

/* УВЕДОМЛЕНИЯ */
.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--primary);
    color: white;
    padding: 15px 25px;
    border-radius: 8px;
    box-shadow: var(--hover-shadow);
    z-index: 2000;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ФУТЕР */
footer {
    margin-top: 50px;
    background-color: var(--footer-bg);
    color: var(--footer-text);
    padding: 40px 0 30px;
    border-top: 1px solid #2d3748;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 30px 40px;
    margin-bottom: 20px;
}

.footer-links a {
    color: #9ca3af;
    text-decoration: none;
    font-size: 1rem;
    border-bottom: 1px solid transparent;
    transition: color 0.2s, border-color 0.2s;
    cursor: pointer;
}

.footer-links a:hover {
    color: white;
    border-bottom-color: var(--primary);
}

.footer-social {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin: 25px 0;
}

.social-icon {
    display: block;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.social-icon:hover {
    transform: scale(1.15);
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
}

.social-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.footer-note {
    text-align: center;
    font-size: 0.9rem;
    color: #6b7280;
    max-width: 800px;
    margin: 20px auto 0;
}

/* АДАПТАЦИЯ */
@media (max-width: 768px) {
    .container, .info-container {
        padding: 0 20px;
    }
    
    .header-image img {
        max-height: 180px;
    }
    
    .nav-bar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .back-btn {
        justify-content: center;
    }
    
    .next-buses-grid,
    .routes-grid {
        grid-template-columns: 1fr;
    }
    
    .next-bus-card {
        flex-wrap: wrap;
    }
    
    .next-bus-time {
        width: 100%;
        text-align: left;
    }
    
    .modal-content {
        padding: 20px;
        width: 95%;
    }
    
    .modal-footer {
        grid-template-columns: 1fr;
    }
    
    .modal-route-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .route-header {
        flex-wrap: wrap;
    }
    
    .share-buttons {
        flex-direction: column;
    }
    
    .share-btn {
        width: 100%;
    }
    
    .info-text {
        font-size: 0.95rem;
    }
    
    .footer-social {
        gap: 15px;
    }
    
    .social-icon {
        width: 40px;
        height: 40px;
    }
}

@media (max-width: 480px) {
    .info-text {
        font-size: 0.9rem;
    }
    
    .info-icon {
        font-size: 1.2rem;
    }
}