/**
 * Glasses AR Platform - 3D Showcase Section
 * File: assets/css/glass-3d-section.css
 * 
 * Features:
 * - Original model colors preserved
 * - Beautiful gradient backgrounds (Green theme)
 * - Fully responsive (all devices)
 * - Smooth animations
 * 
 * Version: 1.0.0
 */

/* ============================================
   RESET & VARIABLES
   ============================================ */
.glass-3d-hero,
.glass-3d-hero * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.glass-3d-hero {
    /* Dynamic colors - changed by JS */
    --glass-bg1: #1a6b4a;
    --glass-bg2: #2d8f65;
    --glass-bg3: #45a578;
    --glass-accent: #7c3aed;
    
    /* Static colors */
    --glass-white: #ffffff;
    --glass-dark: #0f1a14;
    --glass-glass: rgba(255, 255, 255, 0.15);
    --glass-glass-border: rgba(255, 255, 255, 0.25);
    --glass-transition: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   MAIN SECTION
   ============================================ */
.glass-3d-hero {
    width: 100%;
    position: relative;
    min-height: 100vh;
    overflow: hidden;
    background: linear-gradient(
        160deg,
        var(--glass-bg1) 0%,
        var(--glass-bg2) 50%,
        var(--glass-bg3) 100%
    );
    transition: background 0.8s ease;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ============================================
   GRADIENT OVERLAY
   ============================================ */
.glass-3d-overlay {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 100% 60% at 50% 0%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse 80% 50% at 80% 80%, rgba(45, 143, 101, 0.2) 0%, transparent 50%),
        radial-gradient(ellipse 80% 50% at 20% 80%, rgba(26, 107, 74, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse 120% 80% at 50% 100%, rgba(0, 0, 0, 0.25) 0%, transparent 60%);
    pointer-events: none;
    z-index: 0;
}

/* ============================================
   FLOATING PARTICLES
   ============================================ */
.glass-3d-particles {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.glass-3d-particles span {
    position: absolute;
    width: 5px;
    height: 5px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    animation: glass-float 12s infinite ease-in-out;
}

.glass-3d-particles span:nth-child(1) { left: 10%; top: 25%; animation-delay: 0s; }
.glass-3d-particles span:nth-child(2) { left: 90%; top: 20%; animation-delay: 2s; }
.glass-3d-particles span:nth-child(3) { left: 25%; top: 75%; animation-delay: 4s; }
.glass-3d-particles span:nth-child(4) { left: 75%; top: 70%; animation-delay: 1s; }
.glass-3d-particles span:nth-child(5) { left: 50%; top: 10%; animation-delay: 3s; }
.glass-3d-particles span:nth-child(6) { left: 5%; top: 50%; animation-delay: 5s; }

@keyframes glass-float {
    0%, 100% {
        transform: translateY(0) translateX(0) scale(1);
        opacity: 0.4;
    }
    25% {
        transform: translateY(-25px) translateX(8px) scale(1.2);
        opacity: 0.7;
    }
    50% {
        transform: translateY(-40px) translateX(-12px) scale(0.9);
        opacity: 0.5;
    }
    75% {
        transform: translateY(-20px) translateX(15px) scale(1.1);
        opacity: 0.6;
    }
}

/* ============================================
   CONTAINER
   ============================================ */
.glass-3d-container {
    position: relative;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 50px 24px 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 2;
    min-height: 100vh;
}

/* ============================================
   MAIN TITLE
   ============================================ */
.glass-3d-title {
    position: relative;
    text-align: center;
    z-index: 1;
    text-transform: uppercase;
    font-weight: 950;
    font-size: clamp(42px, 5vw, 135px);
    line-height: 1;
    letter-spacing: 2px;
    color: rgba(255, 255, 255, 0.95);
    text-shadow: 
        0 4px 30px rgba(0, 0, 0, 0.2),
        0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 0;
    user-select: none;
}

/* ============================================
   MODEL VIEWER WRAPPER
   ============================================ */
.glass-3d-model-wrap {
    position: relative;
    z-index: 3;
    margin-top: -70px;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    isolation: isolate;
}

/* ============================================
   MODEL VIEWER - ORIGINAL COLORS PRESERVED
   ============================================ */
.glass-3d-viewer {
    width: min(650px, 90vw);
    height: min(400px, 45vh);
    
    /* ✅ CRITICAL: Transparent background */
    background: transparent !important;
    
    /* ✅ No filters */
    filter: none !important;
    
    /* ✅ Normal blend */
    mix-blend-mode: normal !important;
    
    /* Hardware acceleration */
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    
    touch-action: pan-y;
}

/* Hide default model-viewer UI */
.glass-3d-viewer::part(default-progress-bar),
.glass-3d-viewer::part(progress-bar),
.glass-3d-viewer::part(prompt),
.glass-3d-viewer::part(default-ar-button) {
    display: none !important;
}

/* ============================================
   360° BADGE
   ============================================ */
.glass-3d-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 8px 14px;
    background: var(--glass-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-glass-border);
    border-radius: 25px;
    color: var(--glass-white);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.5px;
    z-index: 10;
    animation: glass-badge-pulse 3s ease-in-out infinite;
}

.glass-3d-badge svg {
    width: 16px;
    height: 16px;
    stroke: var(--glass-white);
}

@keyframes glass-badge-pulse {
    0%, 100% { 
        opacity: 1;
        box-shadow: 0 0 15px rgba(255, 255, 255, 0.15);
    }
    50% { 
        opacity: 0.85;
        box-shadow: 0 0 25px rgba(255, 255, 255, 0.25);
    }
}

/* ============================================
   GLASSMORPHISM PILL
   ============================================ */
.glass-3d-pill {
    position: relative;
    z-index: 4;
    margin-top: -10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    width: min(460px, 88vw);
    padding: 14px 16px 14px 30px;
    background: var(--glass-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-glass-border);
    border-radius: 999px;
    box-shadow:
        0 12px 40px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.glass-3d-pill-name {
    font-size: 17px;
    font-weight: 600;
    color: var(--glass-dark);
    letter-spacing: 0.3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.glass-3d-pill-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 26px;
    border-radius: 999px;
    background: linear-gradient(
        135deg,
        var(--glass-accent) 0%,
        #6d28d9 100%
    );
    color: var(--glass-white);
    font-weight: 700;
    font-size: 15px;
    text-decoration: none;
    white-space: nowrap;
    box-shadow: 
        0 6px 20px rgba(124, 58, 237, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transition: var(--glass-transition);
}

.glass-3d-pill-btn:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 10px 30px rgba(124, 58, 237, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.glass-3d-pill-btn svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    fill: none;
}

/* ============================================
   THUMBNAILS
   ============================================ */
.glass-3d-thumbs {
    position: relative;
    z-index: 4;
    margin-top: 40px;
    display: flex;
    gap: 18px;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

.glass-3d-thumb {
    width: 75px;
    height: 75px;
    border-radius: 50%;
    border: 3px solid transparent;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 
        0 6px 25px rgba(0, 0, 0, 0.15),
        inset 0 -2px 5px rgba(0, 0, 0, 0.03);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--glass-transition);
    padding: 0;
    position: relative;
    overflow: hidden;
}

.glass-3d-thumb::before {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 3px solid transparent;
    transition: var(--glass-transition);
}

.glass-3d-thumb:hover {
    transform: translateY(-5px) scale(1.08);
    box-shadow: 
        0 12px 35px rgba(0, 0, 0, 0.2),
        0 0 15px rgba(124, 58, 237, 0.2);
}

.glass-3d-thumb img {
    width: 50px;
    height: 50px;
    object-fit: contain;
}

/* Active Thumbnail */
.glass-3d-thumb.is-active {
    border-color: var(--glass-accent);
    box-shadow: 
        0 8px 30px rgba(0, 0, 0, 0.18),
        0 0 20px rgba(124, 58, 237, 0.3);
    transform: scale(1.05);
}

.glass-3d-thumb.is-active::before {
    border-color: rgba(124, 58, 237, 0.3);
}

/* ============================================
   RESPONSIVE - TABLET (max-width: 992px)
   ============================================ */
@media (max-width: 992px) {
    .glass-3d-hero {
        min-height: 90vh;
    }

    .glass-3d-container {
        padding: 40px 20px 50px;
    }

    .glass-3d-title {
        font-size: clamp(38px, 8vw, 95px);
    }

    .glass-3d-model-wrap {
        margin-top: -55px;
    }

    .glass-3d-viewer {
        width: 92vw;
        height: 40vh;
    }

    .glass-3d-badge {
        padding: 7px 12px;
        font-size: 12px;
    }

    .glass-3d-pill {
        width: min(420px, 90vw);
        padding: 12px 14px 12px 24px;
    }

    .glass-3d-pill-name {
        font-size: 15px;
    }

    .glass-3d-pill-btn {
        padding: 11px 20px;
        font-size: 14px;
    }

    .glass-3d-thumbs {
        gap: 14px;
        margin-top: 32px;
    }

    .glass-3d-thumb {
        width: 68px;
        height: 68px;
    }

    .glass-3d-thumb img {
        width: 45px;
        height: 45px;
    }
}

/* ============================================
   RESPONSIVE - MOBILE (max-width: 768px)
   ============================================ */
@media (max-width: 768px) {
    .glass-3d-hero {
        min-height: 100vh;
        min-height: 100svh;
    }

    .glass-3d-container {
        padding: 30px 16px 40px;
        min-height: 100vh;
        min-height: 100svh;
        justify-content: flex-start;
        padding-top: 70px;
    }

    .glass-3d-title {
        font-size: clamp(32px, 11vw, 58px);
        letter-spacing: 1px;
        line-height: 1.1;
    }

    .glass-3d-model-wrap {
        margin-top: -35px;
        flex: 1;
        min-height: 0;
    }

    .glass-3d-viewer {
        width: 100vw;
        height: 38vh;
        max-height: 320px;
    }

    .glass-3d-badge {
        top: 12px;
        right: 12px;
        padding: 5px 10px;
        font-size: 11px;
        gap: 4px;
    }

    .glass-3d-badge svg {
        width: 13px;
        height: 13px;
    }

    /* Pill */
    .glass-3d-pill {
        margin-top: 0;
        width: calc(100% - 24px);
        max-width: 360px;
        display: grid;
        grid-template-columns: 1fr auto;
        align-items: center;
        gap: 12px;
        padding: 11px 12px 11px 18px;
    }

    .glass-3d-pill-name {
        font-size: 14px;
        text-align: left;
    }

    .glass-3d-pill-btn {
        padding: 10px 16px;
        font-size: 13px;
        gap: 6px;
    }

    .glass-3d-pill-btn svg {
        width: 15px;
        height: 15px;
    }

    /* Thumbnails */
    .glass-3d-thumbs {
        margin-top: 28px;
        gap: 12px;
        padding: 0 10px;
    }

    .glass-3d-thumb {
        width: 62px;
        height: 62px;
    }

    .glass-3d-thumb img {
        width: 42px;
        height: 42px;
    }
}

/* ============================================
   RESPONSIVE - SMALL MOBILE (max-width: 480px)
   ============================================ */
@media (max-width: 480px) {
    .glass-3d-container {
        padding-top: 60px;
    }

    .glass-3d-title {
        font-size: clamp(28px, 10vw, 48px);
    }

    .glass-3d-model-wrap {
        margin-top: -25px;
    }

    .glass-3d-viewer {
        height: 34vh;
        max-height: 280px;
    }

    .glass-3d-pill {
        width: calc(100% - 20px);
        padding: 9px 10px 9px 14px;
        gap: 10px;
    }

    .glass-3d-pill-name {
        font-size: 13px;
    }

    .glass-3d-pill-btn {
        padding: 9px 14px;
        font-size: 12px;
    }

    .glass-3d-thumbs {
        gap: 10px;
    }

    .glass-3d-thumb {
        width: 56px;
        height: 56px;
    }

    .glass-3d-thumb img {
        width: 38px;
        height: 38px;
    }
}

/* ============================================
   RESPONSIVE - VERY SMALL (max-width: 380px)
   ============================================ */
@media (max-width: 380px) {
    .glass-3d-title {
        font-size: clamp(24px, 9vw, 40px);
    }

    .glass-3d-viewer {
        height: 30vh;
        max-height: 240px;
    }

    .glass-3d-pill-name {
        font-size: 12px;
    }

    .glass-3d-pill-btn {
        padding: 8px 12px;
        font-size: 11px;
    }

    .glass-3d-thumb {
        width: 50px;
        height: 50px;
    }

    .glass-3d-thumb img {
        width: 34px;
        height: 34px;
    }
}

/* ============================================
   RESPONSIVE - LANDSCAPE MOBILE
   ============================================ */
@media (max-height: 500px) and (orientation: landscape) {
    .glass-3d-hero {
        min-height: 130vh;
    }

    .glass-3d-container {
        padding: 20px 24px 30px;
        min-height: auto;
    }

    .glass-3d-title {
        font-size: clamp(26px, 5vw, 48px);
    }

    .glass-3d-model-wrap {
        margin-top: -15px;
    }

    .glass-3d-viewer {
        height: 50vh;
        width: 38vw;
    }

    .glass-3d-badge {
        top: 8px;
        right: 8px;
    }

    .glass-3d-pill {
        margin-top: 12px;
        width: auto;
        max-width: 380px;
        padding: 9px 12px 9px 20px;
    }

    .glass-3d-thumbs {
        margin-top: 18px;
        gap: 10px;
    }

    .glass-3d-thumb {
        width: 48px;
        height: 48px;
    }

    .glass-3d-thumb img {
        width: 32px;
        height: 32px;
    }
}

/* ============================================
   RESPONSIVE - LARGE SCREENS (min-width: 1400px)
   ============================================ */
@media (min-width: 1400px) {
    .glass-3d-title {
        font-size: 145px;
    }

    .glass-3d-viewer {
        width: 780px;
        height: 480px;
    }

    .glass-3d-pill {
        width: 520px;
        padding: 16px 18px 16px 34px;
    }

    .glass-3d-pill-name {
        font-size: 18px;
    }

    .glass-3d-pill-btn {
        padding: 14px 30px;
        font-size: 16px;
    }

    .glass-3d-thumbs {
        gap: 22px;
        margin-top: 50px;
    }

    .glass-3d-thumb {
        width: 85px;
        height: 85px;
    }

    .glass-3d-thumb img {
        width: 58px;
        height: 58px;
    }
}

/* ============================================
   REDUCED MOTION
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    .glass-3d-particles span,
    .glass-3d-badge {
        animation: none;
    }

    .glass-3d-hero,
    .glass-3d-pill-btn,
    .glass-3d-thumb {
        transition: none;
    }
}

/* ============================================
   TOUCH DEVICES
   ============================================ */
@media (hover: none) and (pointer: coarse) {
    .glass-3d-thumb:active {
        transform: scale(0.95);
    }

    .glass-3d-pill-btn:active {
        transform: scale(0.97);
    }
}