/* ===== Helix 3D Orbit Carousel - Ultimate v4 ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --hx-bg: #1E1511;
    --hx-card-w: 380px;
    --hx-card-h: 300px;
    --hx-radius: 18px;
    --hx-gold: #AD8B73;
    --hx-gold-light: #CEAB93;
    --hx-accent1: #E3CAA5;
    --hx-accent2: #FFFBE9;
    --hx-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

body {
    font-family: var(--font-secondary, 'DecoType Naskh', Tahoma, Arial, sans-serif);
    background: var(--hx-bg);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ===== Canvas ===== */
.hx-bg-canvas {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* ===== Section ===== */
.hx-section {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background:
        radial-gradient(ellipse at 50% 0%, rgba(173, 139, 115,0.35) 0%, transparent 55%),
        radial-gradient(ellipse at 20% 100%, rgba(173, 139, 115,0.04) 0%, transparent 40%),
        linear-gradient(180deg, #1E1511 0%, #2D211B 40%, #1E1511 70%, #1E1511 100%);
}

/* ===== Header ===== */
.hx-header {
    text-align: center;
    margin-bottom: 1.2rem;
}

.hx-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 1rem;
    background: rgba(173, 139, 115,0.06);
    border: 1px solid rgba(173, 139, 115,0.2);
    border-radius: 8px;
    color: var(--hx-gold);
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.3px;
    margin-bottom: 0.7rem;
    animation: hxFadeDown 0.5s var(--hx-ease) forwards;
}

@keyframes hxFadeDown {
    from { opacity: 0; transform: translateY(-12px); }
    to { opacity: 1; transform: translateY(0); }
}

.hx-title {
    font-family: var(--font-primary, 'Hacen Egypt', Tahoma, Arial, sans-serif);
    font-size: clamp(1.5rem, 3.2vw, 2.2rem);
    font-weight: 900;
    color: #FFFBE9;
    animation: hxFadeUp 0.5s var(--hx-ease) 0.1s both;
}

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

.hx-gold {
    background: linear-gradient(135deg, var(--hx-gold), var(--hx-gold-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hx-sub {
    font-family: var(--font-secondary, 'DecoType Naskh', Tahoma, Arial, sans-serif);
    font-size: 0.85rem;
    color: var(--hx-accent1);
    opacity: 0.55;
    font-weight: 300;
    margin-top: 0.3rem;
    animation: hxFadeUp 0.5s var(--hx-ease) 0.15s both;
}

/* ===== Stage ===== */
.hx-platform {
    position: relative;
    width: 100%;
    max-width: 900px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex: 1;
    min-height: 350px;
}

.hx-stage {
    position: relative;
    width: 100%;
    height: var(--hx-card-h);
    display: flex;
    align-items: center;
    justify-content: center;
    perspective: 2000px;
    perspective-origin: 50% 50%;
}

.hx-carousel {
    position: relative;
    width: var(--hx-card-w);
    height: var(--hx-card-h);
    transform-style: preserve-3d;
}

/* Orbit Ring */
.hx-orbit-ring {
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%) rotateX(75deg);
    width: 600px;
    height: 120px;
    border-radius: 50%;
    border: 1px solid rgba(173, 139, 115,0.08);
    background: radial-gradient(ellipse at center, rgba(173, 139, 115,0.03) 0%, transparent 70%);
    pointer-events: none;
}

/* ===== Cards ===== */
.hx-card {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: var(--hx-radius);
    overflow: hidden;
    cursor: pointer;
    will-change: transform, opacity, filter;
    transition: filter 0.15s ease;
    box-shadow: 0 15px 50px rgba(0,0,0,0.6);
}

.hx-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: var(--hx-radius);
    overflow: hidden;
}

.hx-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Reflection effect below active card */
.hx-card-reflection {
    position: absolute;
    bottom: -40%;
    left: 0;
    width: 100%;
    height: 40%;
    background: linear-gradient(to bottom, rgba(0,0,0,0.15), transparent);
    transform: scaleY(-0.3);
    opacity: 0.15;
    pointer-events: none;
}

/* Number badge */
.hx-card-num {
    position: absolute;
    top: 0.8rem;
    right: 0.8rem;
    padding: 0.2rem 0.6rem;
    background: rgba(0,0,0,0.6);
    border: 1px solid rgba(173, 139, 115,0.4);
    border-radius: 6px;
    color: var(--hx-gold);
    font-size: 0.7rem;
    font-weight: 700;
    backdrop-filter: blur(5px);
    z-index: 3;
}

/* Eye button */
.hx-card-eye {
    position: absolute;
    top: 0.8rem;
    left: 0.8rem;
    width: 34px;
    height: 34px;
    background: rgba(0,0,0,0.5);
    border: 1px solid rgba(173, 139, 115,0.4);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transform: scale(0.7);
    transition: all 0.3s var(--hx-ease);
    z-index: 4;
}

.hx-card-eye svg { width: 16px; height: 16px; fill: var(--hx-gold); }

.hx-card.active .hx-card-eye,
.hx-card:hover .hx-card-eye {
    opacity: 1;
    transform: scale(1);
}

.hx-card-eye:hover {
    background: var(--hx-gold);
    transform: scale(1.15);
}
.hx-card-eye:hover svg { fill: var(--hx-bg); }

/* Text overlay */
.hx-card-text {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 2rem 1rem 0.8rem;
    background: linear-gradient(transparent, rgba(0,0,0,0.95));
    transform: translateY(100%);
    transition: transform 0.4s var(--hx-ease);
    z-index: 3;
}

.hx-card.active .hx-card-text,
.hx-card:hover .hx-card-text {
    transform: translateY(0);
}

.hx-card-text h3 {
    color: #FFFBE9;
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 0.15rem;
}

.hx-card-text p {
    color: var(--hx-accent1);
    font-size: 0.7rem;
    opacity: 0.8;
}

/* Glow effect for active */
.hx-card.active::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: calc(var(--hx-radius) + 2px);
    border: 2px solid rgba(173, 139, 115,0.4);
    box-shadow: 0 0 40px rgba(173, 139, 115,0.15), inset 0 0 40px rgba(173, 139, 115,0.05);
    pointer-events: none;
    z-index: 5;
    animation: hxPulse 2s ease infinite;
}

@keyframes hxPulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* ===== Controls ===== */
.hx-controls {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    margin-top: 2rem;
    flex-wrap: wrap;
    justify-content: center;
}

.hx-btn-group {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.hx-btn {
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s var(--hx-ease);
    background: transparent;
    color: var(--hx-gold);
}

.hx-btn svg { width: 18px; height: 18px; fill: currentColor; }

.hx-btn-circle {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: 1px solid rgba(173, 139, 115,0.25);
    background: rgba(173, 139, 115,0.04);
}

.hx-btn-circle:hover {
    background: rgba(173, 139, 115,0.12);
    border-color: var(--hx-gold);
    transform: translateY(-2px);
}

.hx-btn-play {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--hx-gold), var(--hx-gold-light));
    box-shadow: 0 4px 20px rgba(173, 139, 115,0.3);
}

.hx-btn-play svg { width: 22px; height: 22px; fill: var(--hx-bg); }

.hx-btn-play:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 30px rgba(173, 139, 115,0.4);
}

.hx-btn-expand {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 1px solid rgba(173, 139, 115,0.2);
    background: rgba(173, 139, 115,0.04);
}

.hx-btn-expand svg { width: 16px; height: 16px; }
.hx-btn-expand:hover {
    background: rgba(173, 139, 115,0.12);
    border-color: var(--hx-gold);
}

/* Progress */
.hx-progress-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
}

.hx-progress-track {
    width: 180px;
    height: 2px;
    background: rgba(255,255,255,0.06);
    border-radius: 1px;
    overflow: hidden;
}

.hx-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--hx-gold), var(--hx-gold-light));
    border-radius: 1px;
    transition: width 0.5s var(--hx-ease);
}

.hx-counter {
    font-size: 0.7rem;
    color: var(--hx-accent1);
    opacity: 0.6;
    font-variant-numeric: tabular-nums;
}

.hx-counter #hxNum {
    color: var(--hx-gold);
    font-weight: 700;
    font-size: 0.85rem;
}

/* Dots */
.hx-dots {
    display: flex;
    gap: 0.35rem;
    margin-top: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

.hx-dot {
    width: 24px;
    height: 24px;
    min-width: 24px;
    min-height: 24px;
    display: grid;
    place-items: center;
    position: relative;
    border-radius: 50%;
    background: transparent;
    border: 0;
    cursor: pointer;
    transition: all 0.35s var(--hx-ease);
    padding: 0;
}

.hx-dot::before {
    content: "";
    display: block;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: rgba(255,255,255,0.12);
    transition: all 0.35s var(--hx-ease);
}

.hx-dot.active {
    width: 24px;
    min-width: 24px;
    background: transparent;
    box-shadow: none;
}

.hx-dot.active::before {
    width: 20px;
    height: 5px;
    border-radius: 3px;
    background: var(--hx-gold);
    box-shadow: 0 0 8px rgba(173, 139, 115,0.5);
}

.hx-dot:hover:not(.active)::before {
    background: rgba(173, 139, 115,0.35);
    transform: scale(1.5);
}

/* ===== Info Card ===== */
.hx-info-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 450px;
    margin-top: 1.2rem;
    padding: 1rem 1.5rem;
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(173, 139, 115,0.12);
    border-radius: 12px;
    backdrop-filter: blur(15px);
}

.hx-info-left {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.hx-info-num {
    font-size: 1.4rem;
    font-weight: 900;
    color: var(--hx-gold);
    font-variant-numeric: tabular-nums;
    opacity: 0.8;
}

.hx-info-text h3 {
    color: #FFFBE9;
    font-size: 0.9rem;
    font-weight: 700;
}

.hx-info-text p {
    color: var(--hx-accent1);
    font-size: 0.7rem;
    opacity: 0.55;
    margin-top: 0.1rem;
}

.hx-btn-eye {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid rgba(173, 139, 115,0.3);
    background: rgba(173, 139, 115,0.06);
}

.hx-btn-eye:hover {
    background: var(--hx-gold);
    transform: scale(1.1);
}
.hx-btn-eye:hover svg { fill: var(--hx-bg); }

/* ===== Lightbox ===== */
.hx-lightbox {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.96);
    opacity: 0;
    visibility: hidden;
    transition: all 0.35s ease;
}

.hx-lightbox.open {
    opacity: 1;
    visibility: visible;
}

.hx-lb-img {
    max-width: 90vw;
    max-height: 82vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 14px;
    box-shadow: 0 0 0 1px rgba(173, 139, 115,0.3), 0 20px 80px rgba(0,0,0,0.7);
    transition: transform 0.35s var(--hx-ease);
}

.hx-lightbox.open .hx-lb-img {
    animation: hxZoomIn 0.35s var(--hx-ease);
}

@keyframes hxZoomIn {
    from { transform: scale(0.85); opacity: 0.5; }
    to { transform: scale(1); opacity: 1; }
}

.hx-lb-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    width: 44px;
    height: 44px;
    background: rgba(173, 139, 115,0.08);
    border: 1px solid rgba(173, 139, 115,0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.25s ease;
    color: var(--hx-gold);
    font-size: 1.4rem;
    z-index: 10;
}

.hx-lb-close:hover {
    background: var(--hx-gold);
    color: var(--hx-bg);
    transform: scale(1.1) rotate(90deg);
}

.hx-lb-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    background: rgba(173, 139, 115,0.08);
    border: 1px solid rgba(173, 139, 115,0.25);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.25s ease;
    color: var(--hx-gold);
    z-index: 10;
}

.hx-lb-nav svg { width: 20px; height: 20px; fill: currentColor; }
.hx-lb-nav:hover { background: var(--hx-gold); color: var(--hx-bg); transform: translateY(-50%) scale(1.15); }
.hx-lb-prev { left: 1.5rem; }
.hx-lb-next { right: 1.5rem; }

.hx-lb-caption {
    position: absolute;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    white-space: nowrap;
}

.hx-lb-caption h4 { color: #FFFBE9; font-size: 1rem; font-weight: 700; }
.hx-lb-caption p { color: var(--hx-accent1); font-size: 0.75rem; opacity: 0.6; margin-top: 0.2rem; }

/* ===== Responsive ===== */
@media (min-width: 1400px) {
    :root { --hx-card-w: 440px; --hx-card-h: 340px; }
}
@media (max-width: 1200px) {
    :root { --hx-card-w: 380px; --hx-card-h: 300px; }
}
@media (max-width: 992px) {
    :root { --hx-card-w: 330px; --hx-card-h: 260px; }
    .hx-platform { min-height: 280px; }
    .hx-orbit-ring { width: 450px; }
}
@media (max-width: 768px) {
    :root { --hx-card-w: 270px; --hx-card-h: 210px; }
    .hx-platform { min-height: 240px; overflow: hidden; }
    .hx-stage { overflow: visible; justify-content: center; }
    .hx-orbit-ring { width: 300px; bottom: -20px; }
    .hx-controls { gap: 0.8rem; margin-top: 1.5rem; }
    .hx-btn-circle { width: 38px; height: 38px; }
    .hx-btn-play { width: 46px; height: 46px; }
    .hx-info-card { padding: 0.8rem 1rem; }
    .hx-lb-prev { left: 0.5rem; }
    .hx-lb-next { right: 0.5rem; }
    .hx-lb-nav { width: 36px; height: 36px; }
    .hx-lb-close { top: 0.8rem; right: 0.8rem; width: 36px; height: 36px; }
}
@media (max-width: 480px) {
    :root { --hx-card-w: 220px; --hx-card-h: 175px; }
    .hx-platform { overflow: hidden; }
    .hx-title { font-size: 1.3rem; }
    .hx-progress-track { width: 120px; }
    .hx-info-card { flex-direction: column; gap: 0.6rem; text-align: center; }
    .hx-info-left { justify-content: center; }
    .hx-progress-wrap { order: -1; }
}
@media (max-width: 360px) {
    :root { --hx-card-w: 210px; --hx-card-h: 165px; }
}
@media (max-height: 500px) and (orientation: landscape) {
    .hx-header { display: none; }
    .hx-info-card { display: none; }
    .hx-section { padding: 0.5rem; }
    .hx-platform { min-height: 60vh; }
}
@media (prefers-reduced-motion: reduce) {
    * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
