/* ===== ROUTES PAGE STYLES ===== */

/* Page Header */
.page-header {
    background: linear-gradient(135deg, var(--primary-text) 0%, var(--accent-blue) 100%);
    padding: 6rem 0 4rem;
    color: var(--white);
    position: relative;
    overflow: hidden;
}

.page-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><circle cx="50" cy="50" r="2" fill="white" opacity="0.1"/></svg>');
    animation: slideBackground 60s linear infinite;
}

@keyframes slideBackground {
    from { transform: translateX(0); }
    to { transform: translateX(100px); }
}

.page-header-content {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.page-header h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--white);
}

.page-header p {
    font-size: 1.2rem;
    opacity: 0.95;
}

/* Filter Section */
.filter-section {
    background: var(--white);
    padding: 3rem 0;
    border-bottom: 2px solid var(--light-gray);
    position: sticky;
    top: 70px;
    z-index: 100;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.filter-controls h3 {
    color: var(--primary-text);
    margin-bottom: 1.5rem;
    font-size: 1.4rem;
    text-align: center;
}

.filter-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

.filter-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 1.5rem;
    background: var(--white);
    border: 2px solid var(--light-gray);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
    font-family: inherit;
}

.filter-btn:hover {
    border-color: var(--accent-blue);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px var(--shadow-light);
}

.filter-btn.active {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
    color: var(--white);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 161, 198, 0.3);
}

.filter-icon {
    font-size: 2rem;
    line-height: 1;
}

.filter-btn span:last-child {
    font-size: 0.95rem;
    font-weight: 600;
}

.filter-btn.active span:last-child {
    color: var(--white);
}

/* Routes Grid */
.routes-section {
    padding: 5rem 0;
    background: var(--primary-bg);
}

.routes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2.5rem;
    margin-top: 3rem;
}

.route-card {
    background: var(--white);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px var(--shadow-light);
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    animation: fadeInUp 0.6s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.route-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px var(--shadow-medium);
}

.route-image {
    position: relative;
    height: 400px;
    overflow: hidden;
    background: var(--light-gray);
}

.route-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.route-card:hover .route-image img {
    transform: scale(1.1);
}

.route-badge {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: rgba(255, 255, 255, 0.95);
    color: var(--accent-blue);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.85rem;
    backdrop-filter: blur(10px);
}

.difficulty-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.85rem;
    backdrop-filter: blur(10px);
}

.difficulty-badge.easy {
    background: rgba(76, 217, 100, 0.9);
    color: var(--white);
}

.difficulty-badge.medium {
    background: rgba(255, 200, 87, 0.9);
    color: var(--primary-text);
}

.difficulty-badge.hard {
    background: rgba(255, 69, 58, 0.9);
    color: var(--white);
}

.route-content {
    padding: 2rem;
}

.route-content h3 {
    color: var(--primary-text);
    font-size: 1.4rem;
    margin-bottom: 1rem;
    line-height: 1.4;
}

.route-content > p {
    color: var(--secondary-text);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.route-details {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1.5rem;
    background: var(--primary-bg);
    border-radius: 12px;
}

.detail-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--secondary-text);
    font-size: 0.9rem;
}

.detail-item .icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.route-highlights {
    margin-bottom: 1.5rem;
}

.route-highlights h4 {
    color: var(--primary-text);
    font-size: 1rem;
    margin-bottom: 0.75rem;
}

.route-highlights ul {
    list-style: none;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}

.route-highlights li {
    color: var(--secondary-text);
    font-size: 0.9rem;
    padding-left: 1.5rem;
    position: relative;
}

.route-highlights li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--accent-blue);
    font-weight: 700;
}

.route-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.route-actions .btn {
    flex: 1;
    min-width: 150px;
    justify-content: center;
}

/* Benefits Section */
.educational-benefits {
    padding: 5rem 0;
    background: var(--white);
}

.benefits-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.benefit-card {
    background: var(--primary-bg);
    padding: 2.5rem;
    border-radius: 16px;
    text-align: center;
    transition: var(--transition);
    border: 2px solid transparent;
}

.benefit-card:hover {
    border-color: var(--accent-blue);
    transform: translateY(-5px);
    box-shadow: 0 8px 30px var(--shadow-medium);
}

.benefit-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--accent-blue), var(--primary-text));
    border-radius: 50%;
    font-size: 2.5rem;
}

.benefit-card h3 {
    color: var(--primary-text);
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.benefit-card p {
    color: var(--secondary-text);
    line-height: 1.6;
}

/* Call to Action */
.routes-cta {
    background: linear-gradient(135deg, var(--primary-text), var(--accent-blue));
    padding: 5rem 0;
    color: var(--white);
    text-align: center;
}

.cta-content h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--white);
}

.cta-content p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.95;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.cta-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.cta-buttons .btn {
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
}

.cta-buttons .btn-primary {
    background: var(--white);
    color: var(--accent-blue);
}

.cta-buttons .btn-primary:hover {
    background: var(--light-gray);
}

.cta-buttons .btn-outline {
    border-color: var(--white);
    color: var(--white);
}

.cta-buttons .btn-outline:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .routes-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
        gap: 2rem;
    }
    
    .filter-buttons {
        gap: 0.75rem;
    }
    
    .filter-btn {
        min-width: 100px;
        padding: 0.75rem 1rem;
    }
}

@media (max-width: 768px) {
    .page-header h1 {
        font-size: 2rem;
    }
    
    .page-header p {
        font-size: 1rem;
    }
    
    .filter-section {
        position: relative;
        top: 0;
    }
    
    .filter-buttons {
        gap: 0.5rem;
    }
    
    .filter-btn {
        min-width: 90px;
        padding: 0.75rem 0.75rem;
        font-size: 0.85rem;
    }
    
    .filter-icon {
        font-size: 1.5rem;
    }
    
    .filter-btn span:last-child {
        font-size: 0.85rem;
    }
    
    .routes-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .route-image {
        height: 400px;
    }
    
    .route-content {
        padding: 1.5rem;
    }
    
    .route-details {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .route-highlights ul {
        grid-template-columns: 1fr;
    }
    
    .route-actions {
        flex-direction: column;
    }
    
    .route-actions .btn {
        width: 100%;
    }
    
    .benefits-grid {
        grid-template-columns: 1fr;
    }
    
    .cta-content h2 {
        font-size: 1.8rem;
    }
    
    .cta-buttons {
        flex-direction: column;
        align-items: stretch;
    }
}

/* Loading State */
.route-card.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 5rem 2rem;
    color: var(--secondary-text);
}

.empty-state h3 {
    color: var(--primary-text);
    font-size: 1.8rem;
    margin-bottom: 1rem;
}

.empty-state p {
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

/* ===== MODAL STYLES ===== */
.route-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.route-modal.active {
    display: flex;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(18, 58, 102, 0.85);
    backdrop-filter: blur(8px);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-container {
    position: relative;
    background: var(--white);
    border-radius: 24px;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.4s ease;
    z-index: 1;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    line-height: 1;
    color: var(--primary-text);
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    z-index: 10;
}

.modal-close:hover {
    background: var(--accent-blue);
    color: var(--white);
    transform: rotate(90deg);
}

.modal-navigation {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
    pointer-events: none;
    z-index: 10;
    padding: 0 1rem;
}

.modal-nav-btn {
    width: 50px;
    height: 50px;
    border: none;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--primary-text);
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    pointer-events: auto;
}

.modal-nav-btn:hover {
    background: var(--accent-blue);
    color: var(--white);
    transform: scale(1.1);
}

.modal-nav-btn:active {
    transform: scale(0.95);
}

.modal-content {
    padding: 3rem;
}

.modal-header {
    margin-bottom: 2rem;
}

.modal-badges {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.modal-badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
}

.type-badge {
    background: var(--light-gray);
    color: var(--primary-text);
}

.difficulty-badge {
    padding: 0.5rem 1rem;
}

.difficulty-badge.легкий {
    background: #d4edda;
    color: #155724;
}

.difficulty-badge.средний {
    background: #fff3cd;
    color: #856404;
}

.difficulty-badge.сложный {
    background: #f8d7da;
    color: #721c24;
}

.modal-header h2 {
    font-size: 2rem;
    color: var(--primary-text);
    margin-bottom: 1rem;
    line-height: 1.3;
}

.modal-subtitle {
    font-size: 1.1rem;
    color: var(--secondary-text);
    line-height: 1.6;
}

.modal-body {
    margin-top: 2rem;
}

.modal-info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--light-gray);
    border-radius: 16px;
}

.modal-info-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.info-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.modal-info-item strong {
    display: block;
    color: var(--primary-text);
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

.modal-info-item p {
    color: var(--secondary-text);
    margin: 0;
}

.modal-section {
    margin-bottom: 2.5rem;
}

.modal-section h3 {
    color: var(--primary-text);
    font-size: 1.5rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--accent-blue);
}

.modal-section p {
    color: var(--secondary-text);
    line-height: 1.8;
    font-size: 1.05rem;
}

.modal-list {
    list-style: none;
    padding: 0;
}

.modal-list li {
    padding: 0.75rem 0 0.75rem 2rem;
    position: relative;
    color: var(--secondary-text);
    line-height: 1.6;
    border-bottom: 1px solid var(--light-gray);
}

.modal-list li:last-child {
    border-bottom: none;
}

.modal-list li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--accent-blue);
    font-weight: bold;
    font-size: 1.2rem;
}

.program-list li::before {
    content: '📍';
}

.equipment-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.equipment-item {
    background: var(--light-gray);
    padding: 1rem;
    border-radius: 8px;
    color: var(--secondary-text);
    font-size: 0.95rem;
}

.modal-footer {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px solid var(--light-gray);
}

.modal-price {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    font-size: 1.2rem;
}

.modal-price strong {
    font-size: 2rem;
    color: var(--accent-blue);
}

.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.modal-actions .btn {
    padding: 1rem 2rem;
    font-size: 1rem;
}

.modal-register-btn {
    flex: 1;
    max-width: 300px;
}

.modal-download-btn {
    flex: 1;
    max-width: 300px;
}

/* Modal Responsive */
@media (max-width: 768px) {
    .route-modal {
        padding: 1rem;
    }

    .modal-container {
        max-height: 95vh;
        border-radius: 16px;
    }

    .modal-content {
        padding: 2rem 1.5rem;
    }

    .modal-header h2 {
        font-size: 1.5rem;
    }

    .modal-info-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 1rem;
    }

    .modal-section h3 {
        font-size: 1.25rem;
    }

    .equipment-grid {
        grid-template-columns: 1fr;
    }

    .modal-actions {
        flex-direction: column;
    }

    .modal-register-btn,
    .modal-download-btn {
        max-width: 100%;
    }

    .modal-navigation {
        padding: 0 0.5rem;
    }

    .modal-nav-btn {
        width: 40px;
        height: 40px;
        font-size: 1.5rem;
    }

    .modal-close {
        width: 36px;
        height: 36px;
        top: 1rem;
        right: 1rem;
        font-size: 1.5rem;
    }

    .modal-price {
        flex-direction: column;
        gap: 0.5rem;
    }
}

/* Scrollbar Styling for Modal */
.modal-container::-webkit-scrollbar {
    width: 8px;
}

.modal-container::-webkit-scrollbar-track {
    background: var(--light-gray);
}

.modal-container::-webkit-scrollbar-thumb {
    background: var(--accent-blue);
    border-radius: 4px;
}

.modal-container::-webkit-scrollbar-thumb:hover {
    background: var(--primary-text);
}
