/* ============================================
   ASTRO AUREUM — MOBILE APP EXPERIENCE
   Native-like mobile design (inspired by Horos)
   ============================================ */

/* ===== SAFE AREAS (iPhone notch + Android nav) ===== */
:root {
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-left: env(safe-area-inset-left, 0px);
    --safe-right: env(safe-area-inset-right, 0px);
    --bottom-nav-h: 68px;
}

/* ===== SPLASH SCREEN ===== */
.splash-screen {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: radial-gradient(ellipse at center, #1a0a3e 0%, #08011B 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: opacity 0.6s ease, visibility 0.6s;
    pointer-events: all;
}
.splash-screen.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}
.splash-logo {
    font-family: 'Playfair Display', serif;
    font-size: 2.2rem;
    font-weight: 800;
    color: #FFED8A;
    text-shadow: 0 0 30px rgba(255, 237, 138, 0.6);
    letter-spacing: 2px;
    animation: splashPulse 1.5s ease-in-out infinite;
}
.splash-logo::before {
    content: '\2726';
    display: block;
    font-size: 3rem;
    margin-bottom: 10px;
    animation: splashSpin 3s linear infinite;
}
.splash-tagline {
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    color: #FFD6F5;
    letter-spacing: 4px;
    text-transform: uppercase;
    margin-top: 15px;
    font-weight: 500;
}
@keyframes splashPulse {
    0%, 100% { transform: scale(1); text-shadow: 0 0 30px rgba(255, 237, 138, 0.6); }
    50% { transform: scale(1.05); text-shadow: 0 0 50px rgba(255, 237, 138, 0.9); }
}
@keyframes splashSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ===== BOTTOM NAVIGATION (5 tabs native app style) ===== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9000;
    display: none;
    background: rgba(8, 1, 27, 0.92);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border-top: 1px solid rgba(255, 237, 138, 0.12);
    padding: 8px 0 calc(8px + var(--safe-bottom));
    height: calc(var(--bottom-nav-h) + var(--safe-bottom));
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.5);
}
.bottom-nav-inner {
    display: flex;
    justify-content: space-around;
    align-items: center;
    max-width: 500px;
    margin: 0 auto;
    height: 100%;
}
.bottom-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 8px 4px;
    min-width: 56px;
    min-height: 48px;
    text-decoration: none;
    color: rgba(255, 249, 234, 0.55);
    transition: all 0.2s;
    font-family: 'Inter', sans-serif;
    position: relative;
}
.bottom-nav a:active {
    transform: scale(0.92);
}
.bottom-nav a.active {
    color: #FFED8A;
}
.bottom-nav a.active::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 2px;
    background: linear-gradient(90deg, transparent, #FFED8A, transparent);
    border-radius: 2px;
}
.bottom-nav-icon {
    font-size: 1.4rem;
    line-height: 1;
    filter: drop-shadow(0 0 6px rgba(255, 237, 138, 0.2));
}
.bottom-nav a.active .bottom-nav-icon {
    filter: drop-shadow(0 0 10px rgba(255, 237, 138, 0.6));
}
.bottom-nav-label {
    font-size: 0.65rem;
    font-weight: 500;
    letter-spacing: 0.3px;
}

/* ===== PAGE TRANSITIONS ===== */
body {
    animation: pageEnter 0.5s ease-out;
}
@keyframes pageEnter {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== SCROLL IMPROVEMENTS (mobile) ===== */
html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: rgba(255, 237, 138, 0.15);
}
body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overscroll-behavior-y: contain;
}
* {
    -webkit-overflow-scrolling: touch;
}

/* ===== TOUCH TARGETS (min 48x48) ===== */
@media (hover: none) and (pointer: coarse) {
    button, a, input[type="submit"], .btn-cta, .btn-secondary, .share-btn, .faq-item, .pricing-card {
        min-height: 48px;
    }
    /* Remove hover effects on touch devices */
    a:hover, button:hover, .glass-card:hover, .pricing-card:hover,
    .sign-card:hover, .discover-card:hover, .blog-card:hover, .card:hover,
    .faq-item:hover, .cta-card:hover {
        transform: none !important;
    }
}

/* ===== SKELETON LOADING ===== */
.skeleton {
    background: linear-gradient(90deg,
        rgba(255, 249, 234, 0.03) 0%,
        rgba(255, 237, 138, 0.08) 50%,
        rgba(255, 249, 234, 0.03) 100%);
    background-size: 200% 100%;
    animation: skeletonShine 1.5s ease-in-out infinite;
    border-radius: 16px;
}
@keyframes skeletonShine {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ===== SCROLL SNAP CAROUSEL (for sign grids) ===== */
.carousel-scroll {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding: 10px 16px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.carousel-scroll::-webkit-scrollbar { display: none; }
.carousel-scroll > * {
    scroll-snap-align: start;
    flex: 0 0 auto;
}

/* ===== PULL TO REFRESH INDICATOR ===== */
.ptr-indicator {
    position: fixed;
    top: -60px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(8, 1, 27, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 237, 138, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #FFED8A;
    font-size: 1.2rem;
    z-index: 9500;
    transition: top 0.3s;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}
.ptr-indicator.active {
    top: calc(12px + var(--safe-top));
    animation: ptrSpin 1s linear infinite;
}
@keyframes ptrSpin {
    from { transform: translateX(-50%) rotate(0deg); }
    to { transform: translateX(-50%) rotate(360deg); }
}

/* ===== MOBILE-SPECIFIC BREAKPOINTS ===== */

/* Small phones (≤480px) */
@media (max-width: 480px) {
    h1 { font-size: clamp(1.7rem, 7vw, 2.3rem) !important; }
    h2 { font-size: clamp(1.3rem, 5vw, 1.8rem) !important; }
    .hero { padding: 90px 15px 30px !important; min-height: auto !important; }
    .hero p { font-size: 0.95rem !important; }
    .section { padding: 30px 15px 40px !important; }
    nav { padding: 12px 15px !important; }
    .nav-logo { font-size: 1.25rem !important; }
    .btn-cta { font-size: 0.9rem !important; padding: 14px 28px !important; }
    body { padding-bottom: calc(var(--bottom-nav-h) + var(--safe-bottom)) !important; }
    .bottom-nav { display: block; }
    footer { padding-bottom: calc(50px + var(--bottom-nav-h) + var(--safe-bottom)) !important; }
}

/* Phones (481-600px) */
@media (min-width: 481px) and (max-width: 600px) {
    body { padding-bottom: calc(var(--bottom-nav-h) + var(--safe-bottom)) !important; }
    .bottom-nav { display: block; }
    footer { padding-bottom: calc(50px + var(--bottom-nav-h) + var(--safe-bottom)) !important; }
    nav { padding: 14px 18px !important; }
}

/* Tablets / large phones (601-768px) */
@media (min-width: 601px) and (max-width: 768px) {
    body { padding-bottom: calc(var(--bottom-nav-h) + var(--safe-bottom)) !important; }
    .bottom-nav { display: block; }
    footer { padding-bottom: calc(50px + var(--bottom-nav-h) + var(--safe-bottom)) !important; }
}

/* Tablets (769-1024px) — show bottom nav but smaller */
@media (min-width: 769px) and (max-width: 1024px) and (hover: none) {
    body { padding-bottom: calc(var(--bottom-nav-h) + var(--safe-bottom)) !important; }
    .bottom-nav { display: block; }
    .bottom-nav-inner { max-width: 600px; }
}

/* Desktop — hide bottom nav */
@media (min-width: 1025px), (hover: hover) {
    .bottom-nav { display: none !important; }
}

/* ===== FORM IMPROVEMENTS (mobile) ===== */
@media (max-width: 768px) {
    input, select, textarea {
        font-size: 16px !important; /* prevents iOS zoom */
        min-height: 48px;
    }
    .form-input {
        padding: 14px 16px !important;
    }
}

/* ===== INSTALL PROMPT BANNER ===== */
.install-prompt {
    position: fixed;
    bottom: calc(var(--bottom-nav-h) + var(--safe-bottom) + 12px);
    left: 15px;
    right: 15px;
    background: linear-gradient(135deg, rgba(8, 1, 27, 0.95), rgba(26, 10, 62, 0.95));
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 237, 138, 0.3);
    border-radius: 16px;
    padding: 16px;
    display: none;
    align-items: center;
    gap: 12px;
    z-index: 8500;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.4s ease-out;
}
.install-prompt.show { display: flex; }
.install-prompt-icon {
    font-size: 2rem;
    filter: drop-shadow(0 0 10px rgba(255, 237, 138, 0.5));
}
.install-prompt-text {
    flex: 1;
    color: #FFF9EA;
    font-size: 0.85rem;
    line-height: 1.3;
}
.install-prompt-text strong { color: #FFED8A; display: block; font-size: 0.95rem; }
.install-prompt-btn {
    background: linear-gradient(135deg, #FFED8A, #FFB3D1);
    color: #000;
    border: none;
    padding: 10px 18px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.8rem;
    cursor: pointer;
    white-space: nowrap;
}
.install-prompt-close {
    background: none;
    border: none;
    color: rgba(255, 249, 234, 0.6);
    cursor: pointer;
    font-size: 1.2rem;
    padding: 4px;
}
@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* ===== STATUS BAR FOR PWA (iOS) ===== */
@supports (padding: env(safe-area-inset-top)) {
    nav { padding-top: calc(15px + var(--safe-top)) !important; }
}
