/**
 * File: /assets/css/native-app.css
 * Description: Mobile-specific dock, horizontal scroll tracks, and touch UI styling.
 * Dependency: Core CSS variables must be loaded from style.css first.
 */

/* ==========================================================================
   1. GLOBAL TOUCH & MOBILE RESETS
   ========================================================================== */
@media (max-width: 991px) {
    
    html, body {
        /* Prevents pull-to-refresh and bounce effects on the main body */
        overscroll-behavior-y: none;
        /* Disables the default grey tap highlight on mobile browsers */
        -webkit-tap-highlight-color: transparent;
    }

    body {
        /* Pushes content up so the fixed app dock doesn't cover footer links */
        padding-bottom: calc(70px + env(safe-area-inset-bottom)) !important;
    }

    /* Active touch feedback for buttons (App-like click feel) */
    .btn-primary:active, 
    .btn-renew:active, 
    .tier-btn:active {
        transform: scale(0.96);
        transition: transform 0.1s ease;
    }
}

/* ==========================================================================
   2. HORIZONTAL SCROLL TRACKS (App-Style Swipeable Categories)
   ========================================================================== */
.app-horizontal-scroll {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch; /* Smooth momentum scrolling on iOS */
    scroll-snap-type: x mandatory;
    padding: 4px 24px 24px 24px;
    margin: 0 -24px; /* Bleed to the edges of the screen */
    
    /* Hide scrollbar for Firefox */
    scrollbar-width: none;
    /* Hide scrollbar for IE/Edge */
    -ms-overflow-style: none;
}

/* Hide scrollbar for Chrome/Safari/Webkit */
.app-horizontal-scroll::-webkit-scrollbar {
    display: none;
}

.app-horizontal-scroll > * {
    scroll-snap-align: start;
    flex-shrink: 0;
}

/* ==========================================================================
   3. SWIGGY-STYLE BOTTOM APP DOCK (Mobile Only)
   ========================================================================== */
.mobile-app-dock {
    display: none; /* Hidden on desktop by default */
}

@media (max-width: 768px) {
    .mobile-app-dock {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        height: calc(64px + env(safe-area-inset-bottom)); /* iOS Notch Support */
        padding-bottom: env(safe-area-inset-bottom);
        background: rgba(5, 8, 16, 0.85); /* Deep Space Dark with transparency */
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border-top: 1px solid var(--border-glass);
        box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.5);
        justify-content: space-around;
        align-items: center;
        z-index: 99999;
    }
    
    .dock-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-decoration: none;
        color: var(--text-muted);
        font-family: var(--font-ui);
        font-size: 10px;
        font-weight: 600;
        gap: 6px;
        width: 25%; /* Divide evenly among 4 items */
        height: 100%;
        transition: color 0.2s ease;
    }
    
    .dock-item svg { 
        width: 22px; 
        height: 22px; 
        transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275); 
    }
    
    /* Interactive Active States */
    .dock-item.active, 
    .dock-item:active { 
        color: var(--neon-cyan); 
    }
    
    .dock-item.active svg,
    .dock-item:active svg { 
        transform: translateY(-3px); 
        filter: drop-shadow(0 4px 6px rgba(0, 242, 255, 0.4));
    }
    
    /* Support Action Emphasis (Claymorphic pop) */
    .dock-item.support-accent {
        color: var(--neon-green);
    }
    
    .dock-item.support-accent.active svg,
    .dock-item.support-accent:active svg {
        filter: drop-shadow(0 4px 6px rgba(0, 255, 136, 0.4));
    }
}

/* ==========================================================================
   4. APP-STYLE MODALS & BOTTOM SHEETS
   ========================================================================== */
/* Used if you implement native-feeling popups instead of standard alerts */
.app-bottom-sheet {
    position: fixed;
    bottom: -100%;
    left: 0;
    width: 100%;
    background: var(--bg-space-dark);
    border-top-left-radius: 24px;
    border-top-right-radius: 24px;
    border-top: 1px solid var(--border-glass);
    padding: 24px 24px calc(24px + env(safe-area-inset-bottom));
    box-shadow: 0 -10px 40px rgba(0,0,0,0.8);
    z-index: 100000;
    transition: bottom 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}

.app-bottom-sheet.is-open {
    bottom: 0;
}

/* Drag Handle indicator for bottom sheets */
.app-bottom-sheet::before {
    content: '';
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 4px;
    background: var(--border-glass-active);
    border-radius: 4px;
}