/* Основные стили */
:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --accent-color: #e74c3c;
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --light-color: #ecf0f1;
    --dark-color: #2c3e50;
    --gray-color: #95a5a6;
    --light-gray: #f8f9fa;
    --border-color: #ddd;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f7fa;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Шапка */
.header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 1.5rem 0;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
}

.logo {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 10px;
}

.logo i {
    font-size: 2.5rem;
}

.logo h1 {
    font-size: 2rem;
    font-weight: 700;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Навигация */
.nav {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.nav a {
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 6px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav a:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.nav a.active {
    background-color: rgba(255, 255, 255, 0.3);
    font-weight: 500;
}
/* Поисковая секция */
.search-section {
    background: white;
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
}

.search-box {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.search-input {
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
}

.search-input i {
    position: absolute;
    left: 15px;
    color: var(--gray-color);
}

.search-input input {
    flex: 1;
    padding: 15px 15px 15px 45px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: var(--transition);
}

.search-input input:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

.search-input button {
    padding: 15px 30px;
    background-color: var(--secondary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.search-input button:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
}

.search-options {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

.filter {
    display: flex;
    align-items: center;
    gap: 10px;
}

.filter label {
    font-weight: 500;
    color: var(--dark-color);
}

.filter select {
    padding: 8px 15px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background-color: white;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition);
}

.filter select:focus {
    outline: none;
    border-color: var(--secondary-color);
}

/* Основной контент */
.content-wrapper {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 2rem;
    margin-bottom: 2rem;
}

.schedule-section {
    background: white;
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--light-gray);
}

.section-header h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.5rem;
    color: var(--primary-color);
}

.refresh {
    display: flex;
    align-items: center;
    gap: 15px;
}

#refreshBtn {
    padding: 10px 20px;
    background-color: var(--light-gray);
    color: var(--dark-color);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
}

#refreshBtn:hover {
    background-color: var(--secondary-color);
    color: white;
}

.last-update {
    color: var(--gray-color);
    font-size: 0.9rem;
}

/* Информация о маршруте */
.route-info {
    background: var(--light-gray);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.selected-route {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.route-number {
    display: flex;
    align-items: center;
    gap: 15px;
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    color: white;
    font-size: 1.5rem;
    font-weight: bold;
}

.badge.bus {
    background-color: #3498db;
}

.badge.trolleybus {
    background-color: #27ae60;
}

.badge.tram {
    background-color: #e74c3c;
}

.route-details h3 {
    font-size: 1.3rem;
    margin-bottom: 5px;
    color: var(--primary-color);
}

.route-description {
    color: var(--gray-color);
    font-size: 0.95rem;
}

.route-stats {
    display: flex;
    gap: 2rem;
}

.stat {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--dark-color);
}

.stat i {
    color: var(--secondary-color);
}

/* Вкладки */
.tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--light-gray);
    padding-bottom: 5px;
}

.tab {
    padding: 12px 24px;
    background: none;
    border: none;
    border-radius: 6px 6px 0 0;
    font-size: 1rem;
    color: var(--gray-color);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.tab:hover {
    color: var(--secondary-color);
    background-color: rgba(52, 152, 219, 0.1);
}

.tab.active {
    color: var(--secondary-color);
    font-weight: 500;
}

.tab.active::after {
    content: '';
    position: absolute;
    bottom: -7px;
    left: 0;
    right: 0;
    height: 3px;
    background-color: var(--secondary-color);
    border-radius: 3px;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Таблица расписания */
.schedule-table {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

/* Legal page */
.legal-layout {
    align-items: start;
}

.legal-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.legal-nav {
    display: flex;
    justify-content: flex-start;
}

.legal-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--secondary-color);
    text-decoration: none;
    font-weight: 500;
}

.legal-link:hover {
    text-decoration: underline;
}

.legal-block {
    background: var(--light-gray);
    border-radius: 8px;
    padding: 1rem 1.25rem;
}

.legal-block h3 {
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.legal-block p {
    color: var(--dark-color);
}

.table-header {
    display: grid;
    grid-template-columns: 2fr 2fr 1fr;
    background-color: var(--primary-color);
    color: white;
    font-weight: 500;
}

.header-cell {
    padding: 15px;
    text-align: left;
}

.table-body {
    max-height: 400px;
    overflow-y: auto;
}

.table-row {
    display: grid;
    grid-template-columns: 2fr 2fr 1fr;
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
}

.table-row:hover {
    background-color: var(--light-gray);
}

.table-cell {
    padding: 15px;
    display: flex;
    align-items: center;
}

.stop-name {
    display: flex;
    align-items: center;
    gap: 10px;
}

.stop-icon {
    color: var(--secondary-color);
}

.next-times {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.time-badge {
    padding: 5px 10px;
    background-color: var(--light-gray);
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 500;
}

.time-badge.now {
    background-color: var(--success-color);
    color: white;
}

.time-badge.soon {
    background-color: var(--warning-color);
    color: white;
}

.interval {
    color: var(--gray-color);
    font-size: 0.9rem;
}

.loading {
    padding: 40px;
    text-align: center;
    color: var(--gray-color);
    font-style: italic;
}

/* Список остановок */
.stops-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.stop-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px;
    background-color: var(--light-gray);
    border-radius: 8px;
    transition: var(--transition);
}

.stop-item:hover {
    background-color: #e3e8f0;
    transform: translateX(5px);
}

.stop-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.stop-number {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--secondary-color);
    color: white;
    border-radius: 50%;
    font-weight: bold;
}

.stop-details h4 {
    margin-bottom: 5px;
    color: var(--primary-color);
}

.stop-details p {
    color: var(--gray-color);
    font-size: 0.9rem;
}

.stop-actions {
    display: flex;
    gap: 10px;
}

.stop-actions button {
    padding: 8px 15px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition);
}

.stop-actions .favorite-btn {
    background-color: transparent;
    color: var(--gray-color);
}

.stop-actions .favorite-btn.active {
    color: var(--warning-color);
}

.stop-actions .direction-btn {
    background-color: var(--secondary-color);
    color: white;
}

/* Карта */
.map-container {
    display: grid;
    grid-template-columns: 1fr 250px;
    gap: 1.5rem;
}

#map {
    height: 400px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.map-legend {
    background-color: var(--light-gray);
    padding: 1.5rem;
    border-radius: 8px;
}

.map-legend h4 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.legend-color {
    width: 20px;
    height: 20px;
    border-radius: 50%;
}

.legend-color.bus-stop {
    background-color: #3498db;
}

.legend-color.route-line {
    background-color: #e74c3c;
    width: 30px;
    height: 5px;
    border-radius: 3px;
}

.legend-color.start-point {
    background-color: #27ae60;
}

.legend-color.end-point {
    background-color: #f39c12;
}

/* Боковая панель */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.popular-routes, .favorites, .news {
    background: white;
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.popular-routes h3, .favorites h3, .news h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 1rem;
    color: var(--primary-color);
    font-size: 1.2rem;
}

.route-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.route-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
}

.route-item:hover {
    background-color: var(--light-gray);
    border-color: var(--secondary-color);
    transform: translateX(5px);
}

.route-item .badge {
    width: 40px;
    height: 40px;
    font-size: 1rem;
}

.favorites-list {
    min-height: 150px;
}

.empty-favorites {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--gray-color);
}

.empty-favorites i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.news-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.news-item {
    padding: 1rem;
    background-color: var(--light-gray);
    border-radius: 8px;
    border-left: 4px solid var(--secondary-color);
}

.news-date {
    font-size: 0.8rem;
    color: var(--gray-color);
    margin-bottom: 5px;
}

.news-title {
    font-weight: 500;
    margin-bottom: 5px;
    color: var(--primary-color);
}

.news-text {
    font-size: 0.9rem;
    color: var(--gray-color);
}

/* Подвал */
.footer {
    background-color: var(--primary-color);
    color: white;
    padding: 2rem 0;
    margin-top: 3rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h4 {
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.footer-section p {
    margin-bottom: 10px;
    font-size: 0.9rem;
    opacity: 0.9;
}

.footer-section i {
    margin-right: 10px;
    color: var(--secondary-color);
}

.copyright {
    text-align: center;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.9rem;
    opacity: 0.8;
}

/* Страница О проекте */
.about-section {
    background: white;
    border-radius: 10px;
    padding: 2rem;
    box-shadow: var(--shadow);
}

.about-section h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.8rem;
    color: var(--primary-color);
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--light-gray);
}

.about-content {
    display: grid;
    gap: 2rem;
}

.about-block {
    padding: 1.5rem;
    background-color: var(--light-gray);
    border-radius: 8px;
    border-left: 4px solid var(--secondary-color);
}

.about-block h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.about-block h3 i {
    color: var(--secondary-color);
}

.about-block p {
    color: #555;
    line-height: 1.7;
}

.about-block ul {
    margin-top: 0.5rem;
    padding-left: 1.5rem;
}

.about-block li {
    color: #555;
    margin-bottom: 0.5rem;
}

.contact-list {
    list-style: none;
    padding: 0;
}

.contact-list li {
    display: flex;
    align-items: center;
    gap: 10px;
}

.contact-list i {
    color: var(--secondary-color);
    width: 20px;
}

/* Навигация */
.nav-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.logo h1 a {
    color: white;
    text-decoration: none;
}

.logo h1 a:hover {
    text-decoration: underline;
}

.main-nav {
    display: flex;
    gap: 1rem;
}

.main-nav a {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: background 0.3s, color 0.3s;
    font-weight: 500;
}

.main-nav a:hover {
    background: rgba(255, 255, 255, 0.15);
    color: white;
}

.main-nav a.active {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.main-nav i {
    margin-right: 6px;
}

.footer-section a {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    transition: color 0.3s;
}

.footer-section a:hover {
    color: white;
    text-decoration: underline;
}

/* Контакты */
.contacts-section {
    background: white;
    border-radius: 10px;
    padding: 2rem;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.contacts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.contacts-info h2,
.contacts-form-wrapper h2,
.map-section h2 {
    margin-bottom: 1.5rem;
    color: var(--primary-color);
    font-size: 1.5rem;
}

.contacts-info h2 i,
.contacts-form-wrapper h2 i,
.map-section h2 i {
    color: var(--secondary-color);
    margin-right: 10px;
}

.contact-cards {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.contact-card {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.2rem;
    background: var(--light-gray);
    border-radius: 8px;
    transition: var(--transition);
}

.contact-card:hover {
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}

.contact-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.3rem;
    flex-shrink: 0;
}

.contact-details h3 {
    font-size: 1rem;
    margin-bottom: 0.3rem;
    color: var(--primary-color);
}

.contact-details p {
    font-size: 0.95rem;
    color: #555;
}

.contact-note {
    font-size: 0.85rem !important;
    color: var(--gray-color) !important;
    margin-top: 3px;
}

/* Соцсети */
.social-section {
    margin-top: 0.5rem;
}

.social-section h3 {
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.social-section h3 i {
    color: var(--secondary-color);
    margin-right: 8px;
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-link {
    width: 48px;
    height: 48px;
    background: var(--light-gray);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    font-size: 1.4rem;
    transition: var(--transition);
    text-decoration: none;
}

.social-link:hover {
    background: var(--secondary-color);
    color: white;
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}

/* Форма */
.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.form-group label {
    font-weight: 500;
    color: var(--primary-color);
    font-size: 0.95rem;
}

.form-group input,
.form-group textarea {
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: var(--transition);
    outline: none;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.15);
}

.form-submit {
    background: linear-gradient(135deg, var(--secondary-color), #2980b9);
    color: white;
    border: none;
    padding: 14px 30px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.form-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
}

.form-success {
    text-align: center;
    padding: 2rem;
    background: var(--light-gray);
    border-radius: 8px;
}

.form-success i {
    font-size: 3rem;
    color: var(--success-color);
    margin-bottom: 1rem;
}

.form-success h3 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.form-success p {
    color: var(--gray-color);
}

.map-section {
    margin-top: 0.5rem;
}

.contact-map-container {
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

/* Адаптивность — контакты */
@media (max-width: 900px) {
    .contacts-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .nav-bar {
        flex-direction: column;
        align-items: flex-start;
    }

    .nav-bar .logo {
        margin-bottom: 0.3rem;
    }
}

/* Адаптивность */
@media (max-width: 1200px) {
    .content-wrapper {
        grid-template-columns: 1fr;
    }
    
    .map-container {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .header {
        padding: 1rem 0;
    }
    
    .logo h1 {
        font-size: 1.5rem;
    }
    
    .search-options {
        flex-direction: column;
        gap: 1rem;
    }
    
    .selected-route {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .route-stats {
        width: 100%;
        justify-content: space-between;
    }
    
    .table-header, .table-row {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

@media (max-width: 480px) {
    .tabs {
        flex-direction: column;
    }
    
    .tab {
        width: 100%;
        text-align: center;
    }
    
    .search-input {
        flex-direction: column;
    }
    
    .search-input button {
        width: 100%;
        margin-top: 10px;
    }
}