/**
 * Clothes AR Platform - 3D Showcase Section
 * File: assets/css/cloth-3d-section.css
 * 
 * Features:
 * - Original model colors preserved
 * - Fashion-themed gradient backgrounds
 * - Fully responsive (all devices)
 * - Smooth animations
 * 
 * Version: 1.0.0
 */

/* ============================================
   RESET & VARIABLES
   ============================================ */
.cloth-3d-hero,
.cloth-3d-hero * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.cloth-3d-hero {
    /* Dynamic colors - changed by JS */
    --cloth-bg1: #1a1a2e;
    --cloth-bg2: #3d5a80;
    --cloth-bg3: #293241;
    --cloth-accent: #ee6c4d;
    
    /* Static colors */
    --cloth-white: #ffffff;
    --cloth-dark: #0f0f1a;
    --cloth-glass: rgba(255, 255, 255, 0.12);
    --cloth-glass-border: rgba(255, 255, 255, 0.18);
    --cloth-transition: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   MAIN SECTION
   ============================================ */
.cloth-3d-hero {
    width: 100%;
    position: relative;
    min-height: 100vh;
    overflow: hidden;
    background: linear-gradient(
        145deg,
        var(--cloth-bg1) 0%,
        var(--cloth-bg2) 50%,
        var(--cloth-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
   ============================================ */
.cloth-3d-overlay {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 50% at 50% 0%, rgba(238, 108, 77, 0.12) 0%, transparent 50%),
        radial-gradient(ellipse 60% 40% at 90% 90%, rgba(61, 90, 128, 0.15) 0%, transparent 40%),
        radial-gradient(ellipse 60% 40% at 10% 90%, rgba(152, 193, 217, 0.1) 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;
}

/* ============================================
   FLOATING PARTICLES
   ============================================ */
.cloth-3d-particles {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.cloth-3d-particles span {
    position: absolute;
    width: 6px;
    height: 6px;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    animation: cloth-float 10s infinite ease-in-out;
}

.cloth-3d-particles span:nth-child(1) { left: 12%; top: 20%; animation-delay: 0s; }
.cloth-3d-particles span:nth-child(2) { left: 88%; top: 25%; animation-delay: 1s; }
.cloth-3d-particles span:nth-child(3) { left: 20%; top: 70%; animation-delay: 2s; }
.cloth-3d-particles span:nth-child(4) { left: 80%; top: 75%; animation-delay: 3s; }
.cloth-3d-particles span:nth-child(5) { left: 45%; top: 10%; animation-delay: 4s; }
.cloth-3d-particles span:nth-child(6) { left: 8%; top: 45%; animation-delay: 5s; }
.cloth-3d-particles span:nth-child(7) { left: 92%; top: 50%; animation-delay: 6s; }
.cloth-3d-particles span:nth-child(8) { left: 55%; top: 88%; animation-delay: 7s; }

@keyframes cloth-float {
    0%, 100% {
        transform: translateY(0) translateX(0) scale(1);
        opacity: 0.3;
    }
    25% {
        transform: translateY(-30px) translateX(10px) scale(1.2);
        opacity: 0.6;
    }
    50% {
        transform: translateY(-50px) translateX(-15px) scale(0.8);
        opacity: 0.4;
    }
    75% {
        transform: translateY(-25px) translateX(20px) scale(1.1);
        opacity: 0.5;
    }
}

/* ============================================
   CONTAINER
   ============================================ */
.cloth-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
   ============================================ */
.cloth-3d-title {
    position: relative;
    text-align: center;
    z-index: 1;
    text-transform: uppercase;
    font-weight: 800;
    font-size: clamp(50px, 5vw, 130px);
    line-height: 1;
    letter-spacing: 3px;
    color: rgba(255, 255, 255, 0.92);
    text-shadow: 
        0 0 40px rgba(238, 108, 77, 0.25),
        0 4px 20px rgba(0, 0, 0, 0.3);
    margin-bottom: 0;
    user-select: none;
}

/* ============================================
   MODEL VIEWER WRAPPER
   ============================================ */
.cloth-3d-model-wrap {
    position: relative;
    z-index: 3;
    margin-top: -80px;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    isolation: isolate;
}

/* ============================================
   MODEL VIEWER - ORIGINAL COLORS PRESERVED
   ============================================ */
.cloth-3d-viewer {
    width: min(750px, 92vw);
    height: min(550px, 55vh);
    
    /* ✅ 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 */
.cloth-3d-viewer::part(default-progress-bar),
.cloth-3d-viewer::part(progress-bar),
.cloth-3d-viewer::part(prompt),
.cloth-3d-viewer::part(default-ar-button) {
    display: none !important;
}

/* ============================================
   360° BADGE
   ============================================ */
.cloth-3d-badge {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    background: var(--cloth-glass);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid var(--cloth-glass-border);
    border-radius: 30px;
    color: var(--cloth-white);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 1px;
    z-index: 10;
    animation: cloth-badge-glow 3s ease-in-out infinite;
}

.cloth-3d-badge svg {
    width: 18px;
    height: 18px;
    stroke: var(--cloth-accent);
}

@keyframes cloth-badge-glow {
    0%, 100% { 
        box-shadow: 0 0 15px rgba(238, 108, 77, 0.2);
    }
    50% { 
        box-shadow: 0 0 25px rgba(238, 108, 77, 0.4);
    }
}

/* ============================================
   GLASSMORPHISM PILL
   ============================================ */
.cloth-3d-pill {
    position: relative;
    z-index: 4;
    margin-top: -20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    width: min(500px, 90vw);
    padding: 16px 18px 16px 32px;
    background: var(--cloth-glass);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid var(--cloth-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);
}

.cloth-3d-pill-name {
    font-size: 17px;
    font-weight: 600;
    color: var(--cloth-white);
    letter-spacing: 0.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.cloth-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(--cloth-accent) 0%,
        #d35400 100%
    );
    color: var(--cloth-white);
    font-weight: 700;
    font-size: 15px;
    text-decoration: none;
    white-space: nowrap;
    box-shadow: 
        0 8px 25px rgba(238, 108, 77, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transition: var(--cloth-transition);
}

.cloth-3d-pill-btn:hover {
    transform: translateY(-3px);
    box-shadow: 
        0 12px 35px rgba(238, 108, 77, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.cloth-3d-pill-btn svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    fill: none;
}

/* ============================================
   THUMBNAILS
   ============================================ */
.cloth-3d-thumbs {
    position: relative;
    z-index: 4;
    margin-top: 45px;
    display: flex;
    gap: 20px;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

.cloth-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.2),
        inset 0 -2px 5px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--cloth-transition);
    padding: 0;
    position: relative;
    overflow: hidden;
}

.cloth-3d-thumb::before {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    border: 3px solid transparent;
    transition: var(--cloth-transition);
}

.cloth-3d-thumb:hover {
    transform: translateY(-6px) scale(1.08);
    box-shadow: 
        0 15px 40px rgba(0, 0, 0, 0.25),
        0 0 20px rgba(238, 108, 77, 0.25);
}

.cloth-3d-thumb img {
    width: 55px;
    height: 55px;
    object-fit: contain;
}

/* Active Thumbnail */
.cloth-3d-thumb.is-active {
    border-color: var(--cloth-accent);
    box-shadow: 
        0 10px 35px rgba(0, 0, 0, 0.25),
        0 0 25px rgba(238, 108, 77, 0.35);
    transform: scale(1.05);
}

.cloth-3d-thumb.is-active::before {
    border-color: rgba(238, 108, 77, 0.4);
}

/* ============================================
   RESPONSIVE - TABLET (max-width: 992px)
   ============================================ */
@media (max-width: 992px) {
    .cloth-3d-hero {
        min-height: 90vh;
    }

    .cloth-3d-container {
        padding: 40px 20px 50px;
    }

    .cloth-3d-title {
        font-size: clamp(36px, 8vw, 90px);
    }

    .cloth-3d-model-wrap {
        margin-top: -60px;
    }

    .cloth-3d-viewer {
        width: 95vw;
        height: 48vh;
    }

    .cloth-3d-badge {
        padding: 8px 14px;
        font-size: 13px;
    }

    .cloth-3d-pill {
        width: min(460px, 92vw);
        padding: 14px 16px 14px 26px;
    }

    .cloth-3d-pill-name {
        font-size: 15px;
    }

    .cloth-3d-pill-btn {
        padding: 12px 22px;
        font-size: 14px;
    }

    .cloth-3d-thumbs {
        gap: 16px;
        margin-top: 35px;
    }

    .cloth-3d-thumb {
        width: 72px;
        height: 72px;
    }

    .cloth-3d-thumb img {
        width: 50px;
        height: 50px;
    }
}

/* ============================================
   RESPONSIVE - MOBILE (max-width: 768px)
   ============================================ */
@media (max-width: 768px) {
    .cloth-3d-hero {
        min-height: 100vh;
        min-height: 100svh;
    }

    .cloth-3d-container {
        padding: 30px 16px 40px;
        min-height: 100vh;
        min-height: 100svh;
        justify-content: flex-start;
        padding-top: 80px;
    }

    .cloth-3d-title {
        font-size: clamp(32px, 10vw, 55px);
        letter-spacing: 1px;
        line-height: 1.1;
    }

    .cloth-3d-model-wrap {
        margin-top: -40px;
        flex: 1;
        min-height: 0;
    }

    .cloth-3d-viewer {
        width: 100vw;
        height: 44vh;
        max-height: 370px;
    }

    .cloth-3d-badge {
        top: 15px;
        right: 15px;
        padding: 6px 12px;
        font-size: 11px;
        gap: 4px;
    }

    .cloth-3d-badge svg {
        width: 14px;
        height: 14px;
    }

    /* Pill - Horizontal on mobile */
    .cloth-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;
    }

    .cloth-3d-pill-name {
        font-size: 14px;
        text-align: left;
    }

    .cloth-3d-pill-btn {
        padding: 10px 18px;
        font-size: 13px;
        gap: 6px;
    }

    .cloth-3d-pill-btn svg {
        width: 16px;
        height: 16px;
    }

    /* Thumbnails */
    .cloth-3d-thumbs {
        margin-top: 28px;
        gap: 14px;
        padding: 0 12px;
    }

    .cloth-3d-thumb {
        width: 65px;
        height: 65px;
    }

    .cloth-3d-thumb img {
        width: 45px;
        height: 45px;
    }
}

/* ============================================
   RESPONSIVE - SMALL MOBILE (max-width: 480px)
   ============================================ */
@media (max-width: 480px) {
    .cloth-3d-container {
        padding-top: 70px;
    }

    .cloth-3d-title {
        font-size: clamp(28px, 9vw, 45px);
    }

    .cloth-3d-model-wrap {
        margin-top: -30px;
    }

    .cloth-3d-viewer {
        height: 40vh;
        max-height: 320px;
    }

    .cloth-3d-pill {
        width: calc(100% - 20px);
        padding: 10px 12px 10px 16px;
        gap: 10px;
    }

    .cloth-3d-pill-name {
        font-size: 13px;
    }

    .cloth-3d-pill-btn {
        padding: 9px 14px;
        font-size: 12px;
    }

    .cloth-3d-thumbs {
        gap: 12px;
    }

    .cloth-3d-thumb {
        width: 58px;
        height: 58px;
    }

    .cloth-3d-thumb img {
        width: 40px;
        height: 40px;
    }
}

/* ============================================
   RESPONSIVE - VERY SMALL (max-width: 380px)
   ============================================ */
@media (max-width: 380px) {
    .cloth-3d-title {
        font-size: clamp(24px, 8vw, 38px);
    }

    .cloth-3d-viewer {
        height: 36vh;
        max-height: 280px;
    }

    .cloth-3d-pill-name {
        font-size: 12px;
    }

    .cloth-3d-pill-btn {
        padding: 8px 12px;
        font-size: 11px;
    }

    .cloth-3d-thumb {
        width: 52px;
        height: 52px;
    }

    .cloth-3d-thumb img {
        width: 36px;
        height: 36px;
    }
}

/* ============================================
   RESPONSIVE - LANDSCAPE MOBILE
   ============================================ */
@media (max-height: 500px) and (orientation: landscape) {
    .cloth-3d-hero {
        min-height: 140vh;
    }

    .cloth-3d-container {
        padding: 20px 24px 30px;
        min-height: auto;
    }

    .cloth-3d-title {
        font-size: clamp(26px, 5vw, 45px);
    }

    .cloth-3d-model-wrap {
        margin-top: -20px;
    }

    .cloth-3d-viewer {
        height: 55vh;
        width: 42vw;
    }

    .cloth-3d-badge {
        top: 10px;
        right: 10px;
    }

    .cloth-3d-pill {
        margin-top: 15px;
        width: auto;
        max-width: 400px;
        padding: 10px 14px 10px 22px;
    }

    .cloth-3d-thumbs {
        margin-top: 20px;
        gap: 10px;
    }

    .cloth-3d-thumb {
        width: 50px;
        height: 50px;
    }

    .cloth-3d-thumb img {
        width: 35px;
        height: 35px;
    }
}

/* ============================================
   RESPONSIVE - LARGE SCREENS (min-width: 1400px)
   ============================================ */
@media (min-width: 1400px) {
    .cloth-3d-title {
        font-size: 140px;
    }

    .cloth-3d-viewer {
        width: 900px;
        height: 620px;
    }

    .cloth-3d-pill {
        width: 560px;
        padding: 18px 20px 18px 36px;
    }

    .cloth-3d-pill-name {
        font-size: 19px;
    }

    .cloth-3d-pill-btn {
        padding: 16px 32px;
        font-size: 16px;
    }

    .cloth-3d-thumbs {
        gap: 24px;
        margin-top: 55px;
    }

    .cloth-3d-thumb {
        width: 90px;
        height: 90px;
    }

    .cloth-3d-thumb img {
        width: 65px;
        height: 65px;
    }
}

/* ============================================
   REDUCED MOTION
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    .cloth-3d-particles span,
    .cloth-3d-badge {
        animation: none;
    }

    .cloth-3d-hero,
    .cloth-3d-pill-btn,
    .cloth-3d-thumb {
        transition: none;
    }
}

/* ============================================
   TOUCH DEVICES
   ============================================ */
@media (hover: none) and (pointer: coarse) {
    .cloth-3d-thumb:active {
        transform: scale(0.95);
    }

    .cloth-3d-pill-btn:active {
        transform: scale(0.97);
    }
}