/* ========================================
   BUS PILOT - PAGES & NAVIGATION STYLES
   Stili per tutte le pagine dell'app
   Sviluppato da VERGEN ICT TECHNOLOGY
   ======================================== */

/* ========================================
   PAGES CONTAINER
   ======================================== */
.pages-container {
    position: relative;
}

.page {
    display: none;
    animation: none;
}

.page.active {
    display: block;
}

.page-enter {
    animation: pageEnter 0.3s ease forwards;
}

.page-exit {
    animation: pageExit 0.3s ease forwards;
}

@keyframes pageEnter {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pageExit {
    from {
        opacity: 1;
        transform: translateX(0);
    }

    to {
        opacity: 0;
        transform: translateX(-20px);
    }
}

/* ========================================
   PAGE HEADER
   ======================================== */
.page-header {
    padding: 1rem 0 1.5rem;
    text-align: center;
}

.page-header h2 {
    font-size: 1.75rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    background: var(--gradient-italian);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.page-subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ========================================
   SEARCH BOX
   ======================================== */
.search-box {
    margin-bottom: 1rem;
}

.search-box .search-input {
    width: 100%;
    padding: 1rem 1.25rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.search-box .search-input:focus {
    outline: none;
    border-color: var(--accent-green);
    box-shadow: 0 0 0 3px rgba(0, 200, 83, 0.2);
}

/* ========================================
   ROUTES CATEGORIES
   ======================================== */
.routes-categories {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    -webkit-overflow-scrolling: touch;
}

.category-btn {
    padding: 0.6rem 1.25rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 50px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.3s ease;
}

.category-btn:hover {
    background: var(--bg-tertiary);
}

.category-btn.active {
    background: var(--gradient-green);
    border-color: transparent;
    color: white;
    box-shadow: 0 4px 15px rgba(0, 200, 83, 0.3);
}

/* ========================================
   ROUTES LIST
   ======================================== */
.routes-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.route-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.route-card:hover {
    background: var(--bg-tertiary);
    transform: translateX(5px);
    border-color: var(--accent-green);
}

.route-card:active {
    transform: scale(0.98);
}

.route-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.route-info {
    flex: 1;
    min-width: 0;
}

.route-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.route-arrow {
    font-size: 1.25rem;
    color: var(--text-muted);
    transition: transform 0.3s ease;
}

.route-card:hover .route-arrow {
    transform: translateX(5px);
    color: var(--accent-green);
}

/* ========================================
   STATS OVERVIEW
   ======================================== */
.stats-overview {
    margin-bottom: 2rem;
}

.stat-card-large {
    background: linear-gradient(135deg, rgba(0, 200, 83, 0.2) 0%, rgba(0, 150, 36, 0.2) 100%);
    border: 1px solid rgba(0, 200, 83, 0.3);
    border-radius: 20px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.stat-icon-large {
    font-size: 3rem;
}

.stat-details {
    flex: 1;
}

.stat-value-large {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text-primary);
    display: block;
    line-height: 1;
}

.stat-label-large {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
    display: block;
}

.stats-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

/* ========================================
   SECTION TITLE
   ======================================== */
.section-title {
    margin-bottom: 1rem;
    padding-top: 0.5rem;
}

.section-title h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* ========================================
   SETTINGS SECTION
   ======================================== */
.settings-section {
    margin-bottom: 2rem;
}

.settings-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
    padding-left: 0.5rem;
}

.setting-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    margin-bottom: 0.75rem;
}

.setting-info {
    flex: 1;
}

.setting-name {
    display: block;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.setting-desc {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.setting-control {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* ========================================
   TOGGLE SWITCH
   ======================================== */
.toggle {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 28px;
}

.toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-tertiary);
    border: 2px solid var(--glass-border);
    border-radius: 28px;
    transition: all 0.3s ease;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 2px;
    bottom: 2px;
    background: var(--text-muted);
    border-radius: 50%;
    transition: all 0.3s ease;
}

.toggle input:checked+.toggle-slider {
    background: var(--accent-green);
    border-color: var(--accent-green);
}

.toggle input:checked+.toggle-slider:before {
    background: white;
    transform: translateX(24px);
}

/* ========================================
   RANGE SLIDER
   ======================================== */
.range-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100px;
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    outline: none;
}

.range-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: var(--accent-green);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 200, 83, 0.4);
}

.range-value {
    min-width: 40px;
    text-align: right;
    font-weight: 600;
    color: var(--accent-green);
}

/* ========================================
   SETTINGS BUTTONS
   ======================================== */
.settings-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.btn-danger {
    background: rgba(255, 82, 82, 0.2) !important;
    border: 2px solid var(--status-error) !important;
    color: var(--status-error) !important;
}

.btn-danger:hover {
    background: rgba(255, 82, 82, 0.3) !important;
}

/* ========================================
   APP INFO
   ======================================== */
.app-info {
    text-align: center;
    padding: 2rem 1rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
}

.app-logo {
    font-size: 4rem;
    margin-bottom: 0.5rem;
}

.app-name {
    font-size: 1.75rem;
    font-weight: 800;
    background: var(--gradient-italian);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.app-version {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.app-developer {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.app-developer a {
    color: var(--accent-blue);
    font-weight: 700;
    text-decoration: none;
}

.app-developer a:hover {
    text-decoration: underline;
}

/* ========================================
   RESPONSIVE FIXES
   ======================================== */
@media (max-width: 380px) {
    .stats-grid-2 {
        grid-template-columns: 1fr;
    }

    .stat-card-large {
        flex-direction: column;
        text-align: center;
    }

    .setting-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .setting-control {
        width: 100%;
        justify-content: space-between;
    }
}

/* ========================================
   SESSION CARD IMPROVEMENTS
   ======================================== */
.session-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    transition: all 0.3s ease;
}

.session-card:hover {
    background: var(--bg-tertiary);
}

.session-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.session-route {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.session-date {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.session-stats {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.75rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    flex-wrap: wrap;
}

.session-actions {
    display: flex;
    gap: 0.5rem;
}