/* ==========================================================================
   APP-UI.CSS - PANTHERA STORE NATIVE APP LAYOUT & M3 COMPONENTS
   ========================================================================== */

/* --- 1. THE APP SHELL --- */
#app-shell {
    position: relative;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* --- 2. TOP APP BAR (M3 Top App Bar) --- */
.app-bar {
    position: fixed;
    top: 0; left: 0; width: 100%;
    height: var(--app-bar-height);
    background: var(--app-bar-bg);
    /* Note: backdrop-filter: blur() was removed here on purpose. It sits
       above scrolling content on every swipeable view and forces the browser
       to re-blur everything underneath it on every scroll frame — a well
       known cause of scroll jank on Android WebViews/mid-range phones. A
       near-solid background looks almost identical without that cost. */
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 16px; z-index: 50;
    border-bottom: 1px solid var(--border-color);
    transition: background-color var(--transition-fast);
}
.brand-title { display: flex; align-items: center; gap: 8px; font-size: 1.2rem; font-weight: 800; letter-spacing: -0.5px; }
.app-bar-logo { width: 32px; height: 32px; border-radius: var(--radius-sm); }
.icon-btn { width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; font-size: 1.5rem; color: var(--text-primary); border-radius: 50%; transition: background var(--transition-fast); }
.icon-btn:active { background: var(--bg-surface-variant); }

/* --- 3. SWIPEABLE VIEWPORT (3 Screens: Home, Blogs, Reader) --- */
.view-container {
    position: relative; width: 100vw;
    height: calc(100vh - var(--app-bar-height));
    height: calc(100dvh - var(--app-bar-height));
    margin-top: var(--app-bar-height); 
    overflow: hidden;
}

.swipe-track {
    display: flex;
    width: 300vw; /* 3 pages */
    height: 100%;
    transition: transform var(--transition-swipe);
    will-change: transform;
}

/* Scroll Fix Applied Here */
.view-page {
    width: 100vw; 
    height: 100%; 
    overflow-y: auto; /* Allows vertical scroll inside the page without reserving a track */
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 120px; /* Space for bottom nav so content isn't hidden */
}

.page-content { padding: 20px; max-width: 800px; margin: 0 auto; overflow-wrap: break-word; }

/* Home view ends in the full-width site-footer, which already reserves its
   own space above the bottom nav — so it shouldn't also inherit the generic
   120px page padding (that would leave a mismatched grey gap after it). */
#view-home.view-page { padding-bottom: 0; }

/* ==========================================================================
   HEAVY HOME PAGE STYLING (M3 Cards)
   ========================================================================== */

/* Hero Section */
.hero-section { padding: 40px 0 30px; text-align: left; }
.main-heading { font-size: clamp(1.9rem, 7vw, 2.6rem); font-weight: 900; line-height: 1.15; margin-bottom: 16px; letter-spacing: -1px; overflow-wrap: break-word; }
.highlight-text { color: var(--accent-green); }
.sub-heading { font-size: 1.1rem; color: var(--text-secondary); margin-bottom: 30px; line-height: 1.6; max-width: 90%; }
.hero-buttons { display: flex; gap: 12px; flex-wrap: wrap; }

/* M3 Buttons */
.btn-primary { background: var(--accent-green); color: #fff; padding: 14px 28px; border-radius: var(--radius-pill); font-weight: 700; font-size: 1rem; box-shadow: var(--shadow-md); transition: transform var(--transition-fast), box-shadow var(--transition-fast); }
.btn-primary:active { transform: scale(0.97); box-shadow: var(--shadow-sm); }
.btn-secondary { background: var(--bg-surface-variant); color: var(--text-primary); padding: 14px 28px; border-radius: var(--radius-pill); font-weight: 700; font-size: 1rem; border: 1px solid var(--border-color); transition: transform var(--transition-fast); }
.btn-secondary:active { transform: scale(0.97); }
.btn-text { color: var(--text-secondary); font-weight: 600; font-size: 1rem; display: flex; align-items: center; gap: 8px; padding: 8px 0; margin-bottom: 20px; transition: color var(--transition-fast); }
.btn-text:active { color: var(--text-primary); }

/* Features Grid */
.features-grid { display: grid; grid-template-columns: 1fr; gap: 16px; margin-bottom: 40px; }
@media(min-width: 600px) { .features-grid { grid-template-columns: 1fr 1fr; } }
.feature-card { background: var(--bg-surface); padding: 28px; border-radius: var(--radius-lg); border: 1px solid var(--border-color); box-shadow: var(--shadow-sm); }
.feature-icon { font-size: 2rem; color: var(--accent-green); margin-bottom: 16px; }
.feature-card h3 { font-size: 1.25rem; margin-bottom: 8px; letter-spacing: -0.5px; }
.feature-card p { color: var(--text-secondary); font-size: 0.95rem; line-height: 1.6; }

/* Section Titles */
.section-title { font-size: 1.5rem; margin-bottom: 20px; font-weight: 800; letter-spacing: -0.5px; }

/* Ecosystem Showcase */
.ecosystem-section { margin-bottom: 40px; }
.product-showcase { background: linear-gradient(145deg, var(--bg-surface), var(--bg-surface-variant)); border: 1px solid var(--border-color); border-radius: var(--radius-lg); padding: 28px; position: relative; overflow: hidden; box-shadow: var(--shadow-sm); }
.product-logo { width: 56px; height: 56px; border-radius: var(--radius-sm); margin-bottom: 16px; box-shadow: var(--shadow-sm); }
.product-showcase h3 { font-size: 1.5rem; margin-bottom: 8px; letter-spacing: -0.5px; }
.product-showcase p { color: var(--text-secondary); margin-bottom: 20px; line-height: 1.6; }
.product-link { display: inline-flex; align-items: center; gap: 8px; color: var(--accent-green); font-weight: 700; font-size: 1.05rem; }

/* ==========================================================================
   APPS SECTION (Play Store style grid + pop-up)
   ========================================================================== */
.apps-section { margin: 8px 0 40px; }
.apps-section-header { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 16px; }
.apps-section-header .section-title { margin-bottom: 0; }
.apps-count { font-size: 0.85rem; color: var(--text-secondary); font-weight: 700; }

.apps-search-wrap { position: relative; margin-bottom: 20px; }
.apps-search-wrap i { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--text-secondary); font-size: 1.1rem; }
.apps-search-wrap input { width: 100%; padding: 13px 16px 13px 44px; border-radius: var(--radius-pill); border: 1px solid var(--border-color); background: var(--bg-surface-variant); color: var(--text-primary); font-family: inherit; font-size: 0.95rem; }
.apps-search-wrap input::placeholder { color: var(--text-secondary); }

.apps-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 14px; }
.app-card { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 16px 10px; background: var(--bg-surface); border: 1px solid var(--border-color); border-radius: 22px; transition: transform var(--transition-fast), box-shadow var(--transition-fast); }
.app-card:active { transform: scale(0.96); box-shadow: var(--shadow-sm); }
.app-card-icon { width: 64px; height: 64px; border-radius: 18px; object-fit: cover; background: var(--bg-surface-variant); }
.app-card-name { font-size: 0.9rem; font-weight: 700; color: var(--text-primary); line-height: 1.3; overflow-wrap: break-word; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.app-card-category { font-size: 0.72rem; font-weight: 700; color: var(--accent-green); text-transform: uppercase; letter-spacing: 0.3px; }
.apps-empty-state { text-align: center; color: var(--text-secondary); padding: 32px 16px; font-size: 0.95rem; }

/* App details pop-up (reuses .fullscreen-modal / .lang-modal-header base) */
.app-modal-top { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
.app-modal-icon { width: 76px; height: 76px; border-radius: 20px; object-fit: cover; background: var(--bg-surface-variant); flex-shrink: 0; }
.app-modal-titles h2 { font-size: 1.4rem; font-weight: 900; letter-spacing: -0.5px; margin-bottom: 4px; overflow-wrap: break-word; }
.app-modal-meta { font-size: 0.85rem; color: var(--text-secondary); font-weight: 600; }
.app-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 24px; }
.app-action-btn { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; }
.app-shots-scroll { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 8px; margin-bottom: 24px; scroll-snap-type: x mandatory; }
.app-shot { height: 340px; border-radius: 18px; border: 1px solid var(--border-color); scroll-snap-align: start; flex-shrink: 0; }
.app-about-title { font-size: 1.1rem; font-weight: 800; margin-bottom: 10px; }
.app-modal-desc { color: var(--text-secondary); line-height: 1.7; font-size: 0.95rem; overflow-wrap: break-word; white-space: pre-line; }

/* ==========================================================================
   FAQ ACCORDION (M3 Style)
   ========================================================================== */
.faq-section { margin: 8px 0 48px; }
.faq-list { display: flex; flex-direction: column; gap: 12px; }
.faq-item { background: var(--bg-surface); border: 1px solid var(--border-color); border-radius: var(--radius-md); overflow: hidden; }
.faq-question { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px; text-align: left; font-size: 1rem; font-weight: 700; color: var(--text-primary); }
.faq-caret { flex-shrink: 0; transition: transform var(--transition-fast); color: var(--accent-green); }
.faq-item.open .faq-caret { transform: rotate(180deg); }
.faq-answer { max-height: 0; overflow: hidden; transition: max-height var(--transition-fast); }
.faq-answer p { padding: 0 20px 18px; color: var(--text-secondary); font-size: 0.95rem; line-height: 1.6; overflow-wrap: break-word; }

/* ==========================================================================
   PROFESSIONAL SITE FOOTER (Grey surface + accent highlights)
   ========================================================================== */
.site-footer { background: var(--bg-surface-variant); border-top: 1px solid var(--border-color); margin-top: 40px; padding: 40px 20px calc(100px + env(safe-area-inset-bottom, 0px)); width: 100%; box-sizing: border-box; }
.footer-main { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: 28px; max-width: 800px; margin: 0 auto; }
@media (max-width: 640px) { .footer-main { grid-template-columns: 1fr 1fr; } }
@media (max-width: 460px) { .footer-main { grid-template-columns: 1fr; gap: 32px; } }
.footer-col { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.footer-col h4 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.6px; color: var(--accent-green); margin-bottom: 4px; }
.footer-col a { color: var(--text-secondary); font-size: 0.95rem; font-weight: 600; display: flex; align-items: center; gap: 8px; transition: color var(--transition-fast); }
.footer-col a i { flex-shrink: 0; }
.footer-col a span { overflow-wrap: break-word; min-width: 0; }
.footer-col a:hover, .footer-col a:active { color: var(--accent-green); }
.footer-brand-col .footer-brand { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 1.15rem; letter-spacing: -0.5px; margin-bottom: 4px; }
.footer-logo { width: 26px; height: 26px; opacity: 0.9; }
.footer-blurb { font-size: 0.9rem; color: var(--text-secondary); line-height: 1.6; margin-bottom: 4px; }
.footer-social { display: flex; gap: 12px; }
.footer-social a { width: 38px; height: 38px; border-radius: 50%; background: var(--bg-surface); display: flex; align-items: center; justify-content: center; font-size: 1.1rem; color: var(--text-secondary); }
.footer-social a:hover { color: var(--accent-green); background: var(--accent-green-alpha); }
.footer-bottom { max-width: 800px; margin: 28px auto 0; padding-top: 20px; border-top: 1px dashed var(--border-color); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; font-size: 0.8rem; color: var(--text-secondary); }


/* ==========================================================================
   BLOGS FEED & READER (M3 Standard)
   ========================================================================== */

/* Blog Cards (List View) */
#blog-feed-container { display: flex; flex-direction: column; gap: 20px; }
.blog-card { background: var(--bg-surface); border: 1px solid var(--border-color); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-sm); cursor: pointer; transition: transform var(--transition-fast), box-shadow var(--transition-fast); }
.blog-card:active { transform: scale(0.98); box-shadow: 0 0 0 transparent; }
.blog-img-container { width: 100%; height: 180px; background: var(--bg-surface-variant); overflow: hidden; }
.blog-img-container img { width: 100%; height: 100%; object-fit: cover; }
.blog-meta { padding: 20px; }
.blog-date { font-size: 0.8rem; color: var(--accent-green); font-weight: 800; margin-bottom: 8px; display: block; text-transform: uppercase; letter-spacing: 0.5px; }
.blog-meta h3 { font-size: 1.3rem; margin-bottom: 10px; line-height: 1.3; letter-spacing: -0.5px; }
.blog-content { font-size: 0.95rem; color: var(--text-secondary); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.6; }

/* Blog Reader (Full Post View) */
.reader-header { margin-bottom: 24px; }
.reader-date { font-size: 0.85rem; color: var(--accent-green); font-weight: 800; text-transform: uppercase; letter-spacing: 1px; display: block; margin-bottom: 12px;}
.reader-title { font-size: 2.2rem; font-weight: 900; line-height: 1.2; margin-bottom: 24px; letter-spacing: -1px; }
.reader-img { width: 100%; height: 250px; object-fit: cover; border-radius: var(--radius-lg); margin-bottom: 30px; box-shadow: var(--shadow-sm); }
.reader-body { font-size: 1.1rem; line-height: 1.8; color: var(--text-secondary); }
.reader-body p { margin-bottom: 20px; }
.reader-body h3 { color: var(--text-primary); margin: 32px 0 16px; letter-spacing: -0.5px; font-size: 1.5rem; }


/* ==========================================================================
   M3 BOTTOM NAV & SIDEBAR
   ========================================================================== */

/* M3 Bottom Navigation */
.bottom-nav { position: fixed; bottom: 0; left: 0; width: 100%; height: var(--bottom-nav-height); background: var(--bottom-nav-bg); display: flex; justify-content: space-around; align-items: center; padding-bottom: env(safe-area-inset-bottom); z-index: 50; box-shadow: 0 -1px 0 var(--border-color); transition: background-color var(--transition-fast); }
.bottom-nav-btn { position: relative; flex: 1; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--text-secondary); transition: color var(--transition-fast); }
.bottom-nav-btn i { font-size: 1.5rem; z-index: 2; transition: transform var(--transition-fast); }
.bottom-nav-btn span { font-size: 0.75rem; font-weight: 600; z-index: 2; margin-top: 4px; }
.icon-active { display: none; }
.icon-inactive { display: block; }

/* Active State */
.bottom-nav-btn.active { color: var(--text-primary); }
.bottom-nav-btn.active .icon-active { display: block; color: var(--accent-green); }
.bottom-nav-btn.active .icon-inactive { display: none; }

/* M3 Pill Indicator */
.nav-indicator { position: absolute; top: 12px; width: 64px; height: 32px; background: var(--accent-green-alpha); border-radius: 16px; opacity: 0; transform: scaleX(0.5); transition: all var(--transition-fast); z-index: 1; }
.bottom-nav-btn.active .nav-indicator { opacity: 1; transform: scaleX(1); }

/* Sidebar */
.overlay { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: rgba(0,0,0,0.55); opacity: 0; visibility: hidden; transition: opacity var(--transition-fast), visibility var(--transition-fast); will-change: opacity; z-index: 90; }
.overlay.active { opacity: 1; visibility: visible; }
.sidebar { position: fixed; top: 0; left: -320px; width: 300px; height: 100vh; background: var(--bg-surface); box-shadow: var(--shadow-md); transition: transform 0.3s cubic-bezier(0.2, 0, 0, 1); will-change: transform; z-index: 100; display: flex; flex-direction: column; }
.sidebar.active { transform: translateX(320px); }
.sidebar-header { display: flex; align-items: center; padding: 24px 20px; border-bottom: 1px solid var(--border-color); gap: 12px; }
.sidebar-logo { width: 40px; height: 40px; border-radius: var(--radius-sm); }
.sidebar-header h2 { flex: 1; font-size: 1.2rem; font-weight: 800; letter-spacing: -0.5px; }
.sidebar-content { flex: 1; overflow-y: auto; padding: 12px 12px calc(32px + env(safe-area-inset-bottom, 0px)); }
.sidebar-links { list-style: none; }
.menu-label { padding: 6px 16px 4px; font-size: 0.7rem; text-transform: uppercase; font-weight: 800; color: var(--text-secondary); letter-spacing: 0.5px; }
.sidebar-divider { border: none; border-top: 1px solid var(--border-color); margin: 8px 16px; }

/* Row sizing follows the Material Design 3 navigation-drawer spec:
   ~48dp compact row height, 12dp horizontal item padding, 24dp icons, and
   minimal gap between rows so the list reads as one tight, professional menu. */
.sidebar-links a, .theme-btn { display: flex; align-items: center; gap: 16px; padding: 10px 16px; min-height: 48px; box-sizing: border-box; color: var(--text-primary); font-weight: 600; font-size: 0.98rem; border-radius: 100px; transition: background var(--transition-fast), color var(--transition-fast); width: 100%; margin-bottom: 0; }
.sidebar-links a i, .theme-btn i { font-size: 1.4rem; width: 24px; text-align: center; color: var(--text-secondary); transition: color var(--transition-fast); }

/* M3 Sidebar Links */
.sidebar-links a:active, .theme-btn:active { background: var(--bg-surface-variant); }
.sidebar-links a.active { background: var(--accent-green-alpha); color: var(--accent-green); }
.sidebar-links a.active i { color: var(--accent-green); }
.external-icon { margin-left: auto; font-size: 1rem !important; opacity: 0.5; }