/* BasketStats Live - Main Stylesheet */
/* Design System: Tech/Gaming with Dark Theme */

/* ============================================
   CSS Variables & Custom Properties
   ============================================ */
:root {
    --app-dark: #1a2332;
    --app-darker: #0f1419;
    --app-green: #8bc34a;
    --app-orange: #ff9800;
    --app-purple: #8e24aa;
    --app-cyan: #00bcd4;
    --text-primary: #ffffff;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    --border-color: #374151;
}

/* ============================================
   Base Styles
   ============================================ */
* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    line-height: 1.6;
}

/* ============================================
   Navigation Styles
   ============================================ */
.nav-fixed {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
}

/* ============================================
   Device Mockup Styles
   ============================================ */
.device-mockup {
    position: relative;
    max-width: 280px;
    margin: 0 auto;
}

.device-mockup::before {
    content: '';
    position: absolute;
    top: -12px;
    left: -12px;
    right: -12px;
    bottom: -12px;
    background: linear-gradient(145deg, #2a3444, #1a2332);
    border-radius: 32px;
    z-index: -1;
    box-shadow:
        0 25px 50px -12px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.device-mockup::after {
    content: '';
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 6px;
    background: #374151;
    border-radius: 3px;
}

.device-mockup img {
    border-radius: 20px;
    width: 100%;
    height: auto;
    display: block;
}

/* ============================================
   Screenshot Carousel Styles
   ============================================ */
.screenshot-section {
    max-height: 500px;
    padding: 40px 0;
    overflow: hidden;
}

.screenshot-carousel {
    position: relative;
    max-width: 320px;
    margin: 0 auto;
    height: 400px;
}

.carousel-container {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.carousel-track {
    display: flex;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    height: 100%;
}

.carousel-slide {
    min-width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 10px;
}

.carousel-slide img {
    max-height: 350px;
    width: auto;
    max-width: 100%;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    cursor: pointer;
    transition: transform 0.3s ease, opacity 0.3s ease;
    filter: blur(0);
}

.carousel-slide img.loading {
    filter: blur(5px);
}

.carousel-slide img:hover {
    transform: scale(1.02);
}

/* Carousel Navigation */
.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(139, 195, 74, 0.9);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.carousel-btn:hover {
    background: var(--app-green);
    transform: translateY(-50%) scale(1.1);
}

.carousel-btn.prev {
    left: -50px;
}

.carousel-btn.next {
    right: -50px;
}

@media (max-width: 480px) {
    .carousel-btn.prev {
        left: 5px;
    }
    .carousel-btn.next {
        right: 5px;
    }
    .carousel-btn {
        width: 36px;
        height: 36px;
        background: rgba(139, 195, 74, 0.8);
    }
}

/* Carousel Dots */
.carousel-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
}

.carousel-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--border-color);
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.carousel-dot.active {
    background: var(--app-green);
    transform: scale(1.2);
}

.carousel-dot:hover {
    background: var(--app-cyan);
}

/* ============================================
   Lightbox Styles
   ============================================ */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lightbox.active {
    display: flex;
    opacity: 1;
}

.lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 85vh;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--app-green);
    color: white;
    border: none;
    cursor: pointer;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.lightbox-close:hover {
    background: #7cb342;
    transform: scale(1.1);
}

.lightbox-caption {
    text-align: center;
    color: white;
    margin-top: 16px;
    font-size: 14px;
}

/* ============================================
   Hero Section Styles
   ============================================ */
.hero-device-mockup {
    position: relative;
    max-width: 300px;
    margin: 0 auto;
}

@media (min-width: 1024px) {
    .hero-device-mockup {
        max-width: 350px;
    }
}

.hero-device-mockup::before {
    content: '';
    position: absolute;
    top: -16px;
    left: -16px;
    right: -16px;
    bottom: -16px;
    background: linear-gradient(145deg, #2a3444, #1a2332);
    border-radius: 40px;
    z-index: -1;
    box-shadow:
        0 30px 60px -15px rgba(0, 0, 0, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        0 0 80px rgba(139, 195, 74, 0.15);
}

.hero-device-mockup::after {
    content: '';
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 8px;
    background: #374151;
    border-radius: 4px;
}

.hero-device-mockup img {
    border-radius: 28px;
    width: 100%;
    height: auto;
    display: block;
}

/* ============================================
   Privacy Accept Button
   ============================================ */
.privacy-accept-btn {
    position: fixed;
    bottom: 20px;
    bottom: calc(20px + env(safe-area-inset-bottom, 0px));
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    min-width: 280px;
    padding: 16px 32px;
    font-size: 18px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* When in WebView mode (button visible), hide nav and footer, add bottom padding */
body.webview-mode nav,
body.webview-mode footer {
    display: none !important;
}

body.webview-mode main {
    padding-top: 16px !important;
    padding-bottom: calc(100px + env(safe-area-inset-bottom, 0px)) !important;
}

/* ============================================
   Button Centering (Critical)
   ============================================ */
.btn-centered {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

/* ============================================
   Content Text Alignment
   ============================================ */
.content-left-align {
    text-align: left;
}

.content-left-align p,
.content-left-align li,
.content-left-align ul,
.content-left-align ol {
    text-align: left;
}

/* ============================================
   Feature Cards
   ============================================ */
.feature-card {
    text-align: left;
}

.feature-card h3,
.feature-card p {
    text-align: left;
}

/* ============================================
   Responsive Adjustments
   ============================================ */
@media (max-width: 768px) {
    .screenshot-section {
        max-height: 400px;
        padding: 30px 0;
    }

    .screenshot-carousel {
        height: 320px;
        max-width: 260px;
    }

    .carousel-slide img {
        max-height: 280px;
    }

    .device-mockup {
        max-width: 220px;
    }

    .hero-device-mockup {
        max-width: 240px;
    }
}

@media (max-width: 480px) {
    .screenshot-section {
        max-height: 350px;
    }

    .screenshot-carousel {
        height: 280px;
        max-width: 220px;
    }

    .carousel-slide img {
        max-height: 240px;
    }
}

/* ============================================
   Animation Classes
   ============================================ */
.fade-in {
    animation: fadeIn 0.5s ease forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Progressive image loading */
.img-loading {
    filter: blur(5px);
    transition: filter 0.3s ease;
}

.img-loaded {
    filter: blur(0);
}

/* ============================================
   Utility Classes
   ============================================ */
.text-app-green {
    color: var(--app-green);
}

.bg-app-green {
    background-color: var(--app-green);
}

.border-app-green {
    border-color: var(--app-green);
}
