/**
 * Jewelry AR Platform - 3D Showcase Section
 * File: assets/css/jewel-3d-section.css
 * 
 * Features:
 * - Original model colors preserved
 * - Beautiful gradient backgrounds
 * - Fully responsive (all devices)
 * - Smooth animations
 * 
 * Version: 1.0.0
 */

/* ============================================
   RESET & VARIABLES
   ============================================ */
.jewel-3d-hero,
.jewel-3d-hero * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.jewel-3d-hero {
    /* Dynamic colors - changed by JS */
    --jewel-bg1: #1a1a2e;
    --jewel-bg2: #4a3f6b;
    --jewel-bg3: #2d2d44;
    --jewel-accent: #9d4edd;
    
    /* Static colors */
    --jewel-white: #ffffff;
    --jewel-dark: #0f0f1a;
    --jewel-gold: #d4af37;
    --jewel-glass: rgba(255, 255, 255, 0.12);
    --jewel-glass-border: rgba(255, 255, 255, 0.18);
    --jewel-transition: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   MAIN SECTION
   ============================================ */
.jewel-3d-hero {
    width: 100%;
    position: relative;
    min-height: 100vh;
    overflow: hidden;
    background: linear-gradient(
        145deg,
        var(--jewel-bg1) 0%,
        var(--jewel-bg2) 50%,
        var(--jewel-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
   ============================================ */
.jewel-3d-overlay {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 50% at 50% 0%, rgba(157, 78, 221, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse 60% 40% at 90% 90%, rgba(212, 175, 55, 0.1) 0%, transparent 40%),
        radial-gradient(ellipse 60% 40% at 10% 90%, rgba(100, 100, 255, 0.08) 0%, transparent 40%),
        radial-gradient(ellipse 100% 60% at 50% 100%, rgba(0, 0, 0, 0.4) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* ============================================
   SPARKLE PARTICLES
   ============================================ */
.jewel-3d-particles {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.jewel-3d-particles span {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
    animation: jewel-sparkle 4s infinite ease-in-out;
}

.jewel-3d-particles span:nth-child(1) { left: 15%; top: 25%; animation-delay: 0s; }
.jewel-3d-particles span:nth-child(2) { left: 85%; top: 20%; animation-delay: 0.5s; }
.jewel-3d-particles span:nth-child(3) { left: 25%; top: 75%; animation-delay: 1s; }
.jewel-3d-particles span:nth-child(4) { left: 75%; top: 70%; animation-delay: 1.5s; }
.jewel-3d-particles span:nth-child(5) { left: 50%; top: 15%; animation-delay: 2s; }
.jewel-3d-particles span:nth-child(6) { left: 10%; top: 50%; animation-delay: 2.5s; }
.jewel-3d-particles span:nth-child(7) { left: 90%; top: 45%; animation-delay: 3s; }
.jewel-3d-particles span:nth-child(8) { left: 40%; top: 85%; animation-delay: 3.5s; }

@keyframes jewel-sparkle {
    0%, 100% {
        transform: scale(0) rotate(0deg);
        opacity: 0;
    }
    50% {
        transform: scale(1) rotate(180deg);
        opacity: 1;
    }
}

/* ============================================
   CONTAINER
   ============================================ */
.jewel-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
   ============================================ */
.jewel-3d-title {
    position: relative;
    text-align: center;
    z-index: 1;
    text-transform: uppercase;
    font-weight: 800;
    font-size: clamp(45px, 5vw, 130px);
    line-height: 1;
    letter-spacing: 2px;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 
        0 0 40px rgba(157, 78, 221, 0.3),
        0 4px 20px rgba(0, 0, 0, 0.3);
    margin-bottom: 0;
    user-select: none;
}

/* ============================================
   MODEL VIEWER WRAPPER
   ============================================ */
.jewel-3d-model-wrap {
    position: relative;
    z-index: 3;
    margin-top: -80px;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    /* Isolate model from background */
    isolation: isolate;
}

/* ============================================
   MODEL VIEWER - ORIGINAL COLORS PRESERVED
   ============================================ */
.jewel-3d-viewer {
    width: min(700px, 90vw);
    height: min(500px, 50vh);
    
    /* ✅ CRITICAL: Transparent background */
    background: transparent !important;
    
    /* ✅ No filters that affect colors */
    filter: none !important;
    
    /* ✅ Normal blend mode */
    mix-blend-mode: normal !important;
    
    /* Hardware acceleration */
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    
    touch-action: pan-y;
}

/* Hide default model-viewer UI */
.jewel-3d-viewer::part(default-progress-bar),
.jewel-3d-viewer::part(progress-bar),
.jewel-3d-viewer::part(prompt),
.jewel-3d-viewer::part(default-ar-button) {
    display: none !important;
}

/* ============================================
   360° BADGE
   ============================================ */
.jewel-3d-badge {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    background: var(--jewel-glass);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid var(--jewel-glass-border);
    border-radius: 30px;
    color: var(--jewel-white);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 1px;
    z-index: 10;
    animation: jewel-badge-pulse 3s ease-in-out infinite;
}

.jewel-3d-badge svg {
    width: 18px;
    height: 18px;
    stroke: var(--jewel-gold);
}

@keyframes jewel-badge-pulse {
    0%, 100% { 
        box-shadow: 0 0 20px rgba(212, 175, 55, 0.2);
    }
    50% { 
        box-shadow: 0 0 30px rgba(212, 175, 55, 0.4);
    }
}

/* ============================================
   GLASSMORPHISM PILL
   ============================================ */
.jewel-3d-pill {
    position: relative;
    z-index: 4;
    margin-top: -20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    width: min(480px, 90vw);
    padding: 16px 18px 16px 32px;
    background: var(--jewel-glass);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid var(--jewel-glass-border);
    border-radius: 999px;
    box-shadow:
        0 15px 50px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.jewel-3d-pill-name {
    font-size: 17px;
    font-weight: 600;
    color: var(--jewel-white);
    letter-spacing: 0.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.jewel-3d-pill-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;
    border-radius: 999px;
    background: linear-gradient(
        135deg,
        var(--jewel-accent) 0%,
        #7b2cbf 100%
    );
    color: var(--jewel-white);
    font-weight: 700;
    font-size: 15px;
    text-decoration: none;
    white-space: nowrap;
    box-shadow: 
        0 8px 25px rgba(157, 78, 221, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transition: var(--jewel-transition);
}

.jewel-3d-pill-btn:hover {
    transform: translateY(-3px);
    box-shadow: 
        0 12px 35px rgba(157, 78, 221, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.jewel-3d-pill-btn svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    fill: none;
}

/* ============================================
   THUMBNAILS
   ============================================ */
.jewel-3d-thumbs {
    position: relative;
    z-index: 4;
    margin-top: 45px;
    display: flex;
    gap: 20px;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

.jewel-3d-thumb {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 2px solid transparent;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 
        0 8px 30px rgba(0, 0, 0, 0.25),
        inset 0 -2px 5px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--jewel-transition);
    padding: 0;
    position: relative;
    overflow: hidden;
}

.jewel-3d-thumb::before {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    border: 3px solid transparent;
    transition: var(--jewel-transition);
}

.jewel-3d-thumb:hover {
    transform: translateY(-6px) scale(1.08);
    box-shadow: 
        0 15px 40px rgba(0, 0, 0, 0.3),
        0 0 20px rgba(212, 175, 55, 0.3);
}

.jewel-3d-thumb img {
    width: 55px;
    height: 55px;
    object-fit: contain;
}

/* Active Thumbnail */
.jewel-3d-thumb.is-active {
    border-color: var(--jewel-gold);
    box-shadow: 
        0 10px 35px rgba(0, 0, 0, 0.3),
        0 0 25px rgba(212, 175, 55, 0.4);
    transform: scale(1.05);
}

.jewel-3d-thumb.is-active::before {
    border-color: rgba(212, 175, 55, 0.5);
}

/* ============================================
   RESPONSIVE - TABLET (max-width: 992px)
   ============================================ */
@media (max-width: 992px) {
    .jewel-3d-hero {
        min-height: 90vh;
    }

    .jewel-3d-container {
        padding: 40px 20px 50px;
    }

    .jewel-3d-title {
        font-size: clamp(36px, 8vw, 90px);
    }

    .jewel-3d-model-wrap {
        margin-top: -60px;
    }

    .jewel-3d-viewer {
        width: 95vw;
        height: 45vh;
    }

    .jewel-3d-badge {
        padding: 8px 14px;
        font-size: 13px;
    }

    .jewel-3d-pill {
        width: min(440px, 92vw);
        padding: 14px 16px 14px 26px;
    }

    .jewel-3d-pill-name {
        font-size: 15px;
    }

    .jewel-3d-pill-btn {
        padding: 12px 22px;
        font-size: 14px;
    }

    .jewel-3d-thumbs {
        gap: 16px;
        margin-top: 35px;
    }

    .jewel-3d-thumb {
        width: 72px;
        height: 72px;
    }

    .jewel-3d-thumb img {
        width: 50px;
        height: 50px;
    }
}

/* ============================================
   RESPONSIVE - MOBILE (max-width: 768px)
   ============================================ */
@media (max-width: 768px) {
    .jewel-3d-hero {
        min-height: 100vh;
        min-height: 100svh;
    }

    .jewel-3d-container {
        padding: 30px 16px 40px;
        min-height: 100vh;
        min-height: 100svh;
        justify-content: flex-start;
        padding-top: 80px;
    }

    .jewel-3d-title {
        font-size: clamp(32px, 10vw, 55px);
        letter-spacing: 1px;
        line-height: 1.1;
    }

    .jewel-3d-model-wrap {
        margin-top: -40px;
        flex: 1;
        min-height: 0;
    }

    .jewel-3d-viewer {
        width: 100vw;
        height: 42vh;
        max-height: 350px;
    }

    .jewel-3d-badge {
        top: 15px;
        right: 15px;
        padding: 6px 12px;
        font-size: 11px;
        gap: 4px;
    }

    .jewel-3d-badge svg {
        width: 14px;
        height: 14px;
    }

    /* Pill - Horizontal on mobile */
    .jewel-3d-pill {
        margin-top: -5px;
        width: calc(100% - 24px);
        max-width: 380px;
        display: grid;
        grid-template-columns: 1fr auto;
        align-items: center;
        gap: 12px;
        padding: 12px 14px 12px 20px;
    }

    .jewel-3d-pill-name {
        font-size: 14px;
        text-align: left;
    }

    .jewel-3d-pill-btn {
        padding: 10px 18px;
        font-size: 13px;
        gap: 6px;
    }

    .jewel-3d-pill-btn svg {
        width: 16px;
        height: 16px;
    }

    /* Thumbnails */
    .jewel-3d-thumbs {
        margin-top: 28px;
        gap: 14px;
        padding: 0 12px;
    }

    .jewel-3d-thumb {
        width: 65px;
        height: 65px;
    }

    .jewel-3d-thumb img {
        width: 45px;
        height: 45px;
    }
}

/* ============================================
   RESPONSIVE - SMALL MOBILE (max-width: 480px)
   ============================================ */
@media (max-width: 480px) {
    .jewel-3d-container {
        padding-top: 70px;
    }

    .jewel-3d-title {
        font-size: clamp(28px, 9vw, 45px);
    }

    .jewel-3d-model-wrap {
        margin-top: -30px;
    }

    .jewel-3d-viewer {
        height: 38vh;
        max-height: 300px;
    }

    .jewel-3d-pill {
        width: calc(100% - 20px);
        padding: 10px 12px 10px 16px;
        gap: 10px;
    }

    .jewel-3d-pill-name {
        font-size: 13px;
    }

    .jewel-3d-pill-btn {
        padding: 9px 14px;
        font-size: 12px;
    }

    .jewel-3d-thumbs {
        gap: 12px;
    }

    .jewel-3d-thumb {
        width: 58px;
        height: 58px;
    }

    .jewel-3d-thumb img {
        width: 40px;
        height: 40px;
    }
}

/* ============================================
   RESPONSIVE - VERY SMALL (max-width: 380px)
   ============================================ */
@media (max-width: 380px) {
    .jewel-3d-title {
        font-size: clamp(24px, 8vw, 38px);
    }

    .jewel-3d-viewer {
        height: 35vh;
        max-height: 260px;
    }

    .jewel-3d-pill-name {
        font-size: 12px;
    }

    .jewel-3d-pill-btn {
        padding: 8px 12px;
        font-size: 11px;
    }

    .jewel-3d-thumb {
        width: 52px;
        height: 52px;
    }

    .jewel-3d-thumb img {
        width: 36px;
        height: 36px;
    }
}

/* ============================================
   RESPONSIVE - LANDSCAPE MOBILE
   ============================================ */
@media (max-height: 500px) and (orientation: landscape) {
    .jewel-3d-hero {
        min-height: 140vh;
    }

    .jewel-3d-container {
        padding: 20px 24px 30px;
        min-height: auto;
    }

    .jewel-3d-title {
        font-size: clamp(26px, 5vw, 45px);
    }

    .jewel-3d-model-wrap {
        margin-top: -20px;
    }

    .jewel-3d-viewer {
        height: 50vh;
        width: 40vw;
    }

    .jewel-3d-badge {
        top: 10px;
        right: 10px;
    }

    .jewel-3d-pill {
        margin-top: 15px;
        width: auto;
        max-width: 400px;
        padding: 10px 14px 10px 22px;
    }

    .jewel-3d-thumbs {
        margin-top: 20px;
        gap: 10px;
    }

    .jewel-3d-thumb {
        width: 50px;
        height: 50px;
    }

    .jewel-3d-thumb img {
        width: 35px;
        height: 35px;
    }
}

/* ============================================
   RESPONSIVE - LARGE SCREENS (min-width: 1400px)
   ============================================ */
@media (min-width: 1400px) {
    .jewel-3d-title {
        font-size: 140px;
    }

    .jewel-3d-viewer {
        width: 850px;
        height: 580px;
    }

    .jewel-3d-pill {
        width: 540px;
        padding: 18px 20px 18px 36px;
    }

    .jewel-3d-pill-name {
        font-size: 19px;
    }

    .jewel-3d-pill-btn {
        padding: 16px 32px;
        font-size: 16px;
    }

    .jewel-3d-thumbs {
        gap: 24px;
        margin-top: 55px;
    }

    .jewel-3d-thumb {
        width: 90px;
        height: 90px;
    }

    .jewel-3d-thumb img {
        width: 65px;
        height: 65px;
    }
}

/* ============================================
   REDUCED MOTION
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    .jewel-3d-particles span,
    .jewel-3d-badge {
        animation: none;
    }

    .jewel-3d-hero,
    .jewel-3d-pill-btn,
    .jewel-3d-thumb {
        transition: none;
    }
}

/* ============================================
   TOUCH DEVICES
   ============================================ */
@media (hover: none) and (pointer: coarse) {
    .jewel-3d-thumb:active {
        transform: scale(0.95);
    }

    .jewel-3d-pill-btn:active {
        transform: scale(0.97);
    }
}