/* ============================================
   ROUTES WRAPPER
   ============================================ */
.routes-wrapper {
    min-height: calc(100vh - 76px);
    padding-bottom: 4rem;
}

/* ============================================
   ROUTES HERO
   ============================================ */
.routes-hero {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(139, 92, 246, 0.1));
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 3rem 0 2rem;
    margin-bottom: 3rem;
}

.routes-hero-title {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 800;
    text-align: center;
    margin-bottom: 1rem;
    color: var(--light);
}

.routes-hero-subtitle {
    text-align: center;
    font-size: 1.2rem;
    color: var(--gray);
    max-width: 600px;
    margin: 0 auto;
}

/* ============================================
   FILTER SECTION
   ============================================ */
.filter-section {
    padding: 2rem;
    margin-bottom: 2rem;
    animation: fadeInDown 0.5s ease-out;
}

.filter-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--light);
    margin-bottom: 1.5rem;
}

.filter-header i {
    color: var(--primary);
}

.filter-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    align-items: end;
}

.filter-group {
    display: flex;
    flex-direction: column;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 1rem;
    color: var(--gray);
    font-size: 1rem;
    pointer-events: none;
    z-index: 2;
}

.filter-input,
.filter-select {
    width: 100%;
    padding: 0.9rem 1rem 0.9rem 2.8rem;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    color: var(--light);
    font-size: 0.95rem;
    transition: all var(--transition-normal);
    font-family: 'Inter', sans-serif;
}

.filter-input::placeholder {
    color: var(--gray);
}

.filter-input:focus,
.filter-select:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.filter-select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M10.293 3.293L6 7.586 1.707 3.293A1 1 0 00.293 4.707l5 5a1 1 0 001.414 0l5-5a1 1 0 10-1.414-1.414z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 12px;
}

.filter-select option {
    background: var(--dark);
    color: var(--light);
}

.filter-btn {
    height: 48px;
    padding: 0 1.5rem;
    white-space: nowrap;
}

/* ============================================
   STATS BAR
   ============================================ */
.stats-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    animation: fadeIn 0.6s ease-out;
}

.stat-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    color: var(--light);
    font-weight: 600;
}

.stat-badge i {
    color: var(--primary);
}

/* ============================================
   ROUTES GRID
   ============================================ */
.routes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

/* ============================================
   ROUTE CARD
   ============================================ */
.route-card {
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
    transition: all var(--transition-normal);
    animation: fadeInUp 0.5s ease-out backwards;
}

.route-card:hover {
    transform: translateY(-8px);
}

.route-card-header {
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(139, 92, 246, 0.1));
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.route-name {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--light);
    margin: 0;
    line-height: 1.3;
}

.route-type-badge {
    padding: 0.4rem 0.9rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.route-type-sport {
    background: linear-gradient(135deg, #667EEA, #764BA2);
    color: white;
}

.route-type-trad {
    background: linear-gradient(135deg, #F093FB, #F5576C);
    color: white;
}

.route-type-boulder {
    background: linear-gradient(135deg, #4FACFE, #00F2FE);
    color: white;
}

.route-card-body {
    padding: 1.5rem;
    flex: 1;
}

.route-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}

.route-info-item {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
}

.info-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(99, 102, 241, 0.15);
    border-radius: 8px;
    color: var(--primary-light);
    font-size: 0.95rem;
    flex-shrink: 0;
}

.info-content {
    flex: 1;
}

.info-label {
    font-size: 0.8rem;
    color: var(--gray);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.25rem;
}

.info-value {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--light);
}

.difficulty-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: linear-gradient(135deg, var(--warning), var(--danger));
    border-radius: 6px;
    color: white;
    font-size: 0.9rem;
}

.route-card-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-route-save {
    width: 100%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border: none;
    padding: 0.85rem 1.5rem;
    font-weight: 600;
    transition: all var(--transition-normal);
}

.btn-route-save:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.btn-route-save.saved {
    background: linear-gradient(135deg, var(--success), #059669);
    cursor: not-allowed;
}

.btn-route-save.completed {
    background: linear-gradient(135deg, var(--gray), #475569);
    cursor: not-allowed;
}

.btn-route-save:disabled {
    opacity: 0.7;
}

/* ============================================
   PAGINATION
   ============================================ */
.pagination-wrapper {
    display: flex;
    justify-content: center;
    margin-top: 3rem;
}

.pagination-nav {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-lg);
    padding: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.pagination {
    display: flex;
    list-style: none;
    gap: 0.5rem;
    margin: 0;
    padding: 0;
}

.page-item {
    display: flex;
}

.page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0.5rem 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    color: var(--light);
    text-decoration: none;
    font-weight: 500;
    transition: all var(--transition-fast);
}

.page-link:hover {
    background: rgba(99, 102, 241, 0.2);
    border-color: var(--primary);
    color: var(--primary-light);
}

.page-item.active .page-link {
    background: var(--gradient-primary);
    border-color: var(--primary);
    color: white;
}

.page-item.disabled .page-link {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* ============================================
   EMPTY STATE
   ============================================ */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    animation: fadeIn 0.5s ease-out;
}

.empty-state-icon {
    font-size: 5rem;
    color: var(--primary);
    opacity: 0.3;
    margin-bottom: 1.5rem;
}

.empty-state-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--light);
    margin-bottom: 1rem;
}

.empty-state-text {
    font-size: 1.1rem;
    color: var(--gray);
    line-height: 1.6;
}

.empty-state-text a {
    color: var(--primary-light);
    text-decoration: none;
    font-weight: 600;
}

.empty-state-text a:hover {
    text-decoration: underline;
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */
.toast-container {
    position: fixed;
    top: 100px;
    right: 2rem;
    z-index: 9999;
}

.toast {
    display: none;
    min-width: 300px;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(20px);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1.25rem;
    box-shadow: var(--shadow-xl);
    animation: slideInRight 0.3s ease-out;
}

.toast.show {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.toast-success {
    border-left: 4px solid var(--success);
}

.toast-icon {
    font-size: 1.5rem;
    color: var(--success);
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 700;
    color: var(--light);
    margin-bottom: 0.25rem;
}

.toast-message {
    color: var(--gray);
    font-size: 0.9rem;
}

.toast-close {
    background: none;
    border: none;
    color: var(--gray);
    cursor: pointer;
    padding: 0.25rem;
    transition: color var(--transition-fast);
}

.toast-close:hover {
    color: var(--light);
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .routes-hero {
        padding: 2rem 0 1.5rem;
        margin-bottom: 2rem;
    }

    .filter-section {
        padding: 1.5rem;
    }

    .filter-form {
        grid-template-columns: 1fr;
    }

    .filter-btn {
        width: 100%;
    }

    .routes-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    .route-info-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .stats-bar {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }

    .stat-badge {
        justify-content: center;
    }

    .toast-container {
        right: 1rem;
        left: 1rem;
    }

    .toast {
        min-width: auto;
        width: 100%;
    }

    .pagination {
        flex-wrap: wrap;
    }
}

@media (max-width: 480px) {
    .routes-hero-title {
        font-size: 1.75rem;
    }

    .routes-hero-subtitle {
        font-size: 1rem;
    }

    .route-card-header {
        flex-direction: column;
        gap: 0.75rem;
    }

    .route-type-badge {
        align-self: flex-start;
    }

    .filter-input,
    .filter-select {
        font-size: 16px; /* Prevents iOS zoom */
    }
}