/* ==========================================================================
   Showreel Section — 3D Orbital Carousel + Full Analytics Modal
   Three phone-mockup cards orbit in a shallow 3D ring. The active (center)
   card can be clicked to open a full campaign-analytics breakdown modal.
   ========================================================================== */

.portfolio-reels-section {
    position: relative;
    background: #06060c;
    padding: 6rem 0;
    overflow: hidden;
    border-top: 1px solid var(--border);
}

.reels-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    pointer-events: none;
}
.reels-glow-1 {
    top: 20%; left: 50%;
    transform: translate(-50%, -50%);
    width: 500px; height: 500px;
    background: rgba(255,107,26,0.14);
    animation: reelsGlowPulse 8s ease-in-out infinite;
}
.reels-glow-2 {
    bottom: 5%; left: 20%;
    width: 300px; height: 300px;
    background: rgba(255,107,26,0.06);
}
.reels-glow-3 {
    top: 45%; right: 5%;
    width: 250px; height: 250px;
    background: rgba(255,107,26,0.06);
}
@keyframes reelsGlowPulse {
    0%, 100% { opacity: 0.4; }
    50%      { opacity: 0.7; }
}

.reels-grid-overlay {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(to right, rgba(255,255,255,0.025) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255,255,255,0.025) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
}

.reels-inner { position: relative; z-index: 1; }

.portfolio-reels-section .section-header p { color: var(--text-secondary); }

/* ── Orbital ring background decoration ── */
.orbit-track-bg {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 0;
}
.orbit-ring { position: absolute; border-radius: 50%; }
.orbit-ring-outer {
    width: 680px; height: 680px;
    border: 1px dashed rgba(255,107,26,0.15);
    animation: reelsOrbitSpin 60s linear infinite;
}
.orbit-ring-inner {
    width: 480px; height: 480px;
    border: 1px solid rgba(255,255,255,0.05);
}
@keyframes reelsOrbitSpin { to { transform: rotate(360deg); } }
@media (max-width: 900px) {
    .orbit-ring-outer { width: 300px; height: 300px; }
    .orbit-ring-inner { width: 200px; height: 200px; }
}

/* ── Orbit stage: holds the 3 phone cards ── */
.reel-orbit-stage {
    position: relative;
    width: 100%;
    max-width: 900px;
    margin: 3rem auto 0;
    height: 560px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    perspective: 1200px;
}
@media (max-width: 900px) {
    .reel-orbit-stage { height: 530px; }
}

.reel-card {
    position: absolute;
    width: 220px;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1),
                opacity 0.6s ease,
                filter 0.6s ease;
}

.reel-card[data-offset="0"] {
    transform: translate(var(--parallax-x, 0px), calc(10px + var(--parallax-y, 0px))) scale(0.95) rotateY(0deg);
    opacity: 1;
    filter: blur(0px);
    z-index: 30;
}
.reel-card[data-offset="1"] {
    transform: translate(260px, -15px) scale(0.72) rotateY(-28deg);
    opacity: 0.55;
    filter: blur(1.5px);
    z-index: 10;
}
.reel-card[data-offset="2"] {
    transform: translate(-260px, -15px) scale(0.72) rotateY(28deg);
    opacity: 0.55;
    filter: blur(1.5px);
    z-index: 10;
}
@media (max-width: 900px) {
    .reel-card[data-offset="1"] { transform: translate(115px, -15px) scale(0.72) rotateY(-28deg); }
    .reel-card[data-offset="2"] { transform: translate(-115px, -15px) scale(0.72) rotateY(28deg); }
}

/* Floating tags — only visible on the active/center card */
.reel-tag {
    position: absolute;
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    background: rgba(5,7,10,0.9);
    border: 1px solid rgba(255,107,26,0.3);
    border-radius: 10px;
    padding: 0.35rem 0.6rem;
    font-family: var(--font-body);
    font-size: 0.6rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
    white-space: nowrap;
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(6px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}
.reel-card[data-offset="0"] .reel-tag {
    opacity: 1;
    animation: reelTagFloat 4s ease-in-out infinite;
}
.reel-tag-left { top: -1.75rem; left: -2.5rem; }
.reel-tag-right { bottom: -0.75rem; right: -2.5rem; animation-delay: 0.6s; }
.reel-tag-dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--saffron);
    animation: reelPulseDot 1.6s ease-in-out infinite;
}
@keyframes reelPulseDot { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }
@keyframes reelTagFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }

@media (max-width: 900px) {
    .reel-tag-left, .reel-tag-right { display: none; }
}

/* ── Phone mockup ── */
.reel-phone {
    width: 210px; height: 420px;
    background: #0c0f18;
    border-radius: 38px;
    padding: 0.6rem;
    border: 4px solid rgba(255,255,255,0.05);
    position: relative;
    overflow: hidden;
    transition: border-color 0.4s ease, box-shadow 0.4s ease;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
}
.reel-card[data-offset="0"] .reel-phone {
    border-color: rgba(255,107,26,0.4);
    box-shadow: 0 15px 40px rgba(255,107,26,0.15);
}
.reel-card:hover .reel-phone { border-color: rgba(255,255,255,0.14); }

.reel-phone-glass {
    position: absolute; inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.03) 50%, rgba(255,255,255,0) 100%);
    z-index: 5;
    pointer-events: none;
}
.reel-phone-notch {
    position: absolute;
    top: 1rem; left: 50%;
    transform: translateX(-50%);
    width: 96px; height: 20px;
    background: #000;
    border-radius: 999px;
    z-index: 6;
    border: 1px solid rgba(255,255,255,0.05);
}
.reel-phone-glow {
    position: absolute;
    inset-inline: 0; bottom: 0; top: 50%;
    background: linear-gradient(to top, rgba(255,107,26,0.15), transparent);
    z-index: 4;
    pointer-events: none;
}

.reel-mute-btn {
    position: absolute;
    bottom: 1rem; right: 1rem;
    z-index: 6;
    width: 30px; height: 30px;
    border-radius: 50%;
    border: none;
    background: rgba(0,0,0,0.6);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    backdrop-filter: blur(3px);
    transition: background 0.3s ease, color 0.3s ease;
}
.reel-mute-btn:hover { background: var(--saffron); color: #14100a; }

.reel-phone-screen {
    width: 100%; height: 100%;
    border-radius: 28px;
    overflow: hidden;
    background: #000;
    position: relative;
}
.reel-video { width: 100%; height: 100%; object-fit: cover; transform: scale(1.02); display: block; }
.reel-video-shade {
    position: absolute; inset: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0.2), transparent 40%, rgba(0,0,0,0.6));
    pointer-events: none;
}
.reel-video-info { position: absolute; bottom: 1rem; left: 1rem; right: 1rem; z-index: 3; pointer-events: none; }
.reel-video-client {
    display: block;
    font-family: var(--font-body);
    font-size: 0.6rem; font-weight: 700;
    letter-spacing: 0.08em; text-transform: uppercase;
    color: var(--saffron-light);
    margin-bottom: 0.2rem;
}
.reel-video-title {
    font-family: var(--font-head);
    font-size: 0.8rem; font-weight: 700;
    color: #fff; margin: 0;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.reel-video-tagline {
    font-size: 0.62rem;
    color: var(--text-secondary);
    margin: 0.25rem 0 0;
    line-height: 1.3;
}

/* ── Stats panel below the phone ── */
.reel-stats-panel { margin-top: 1.2rem; text-align: center; width: 260px; }
.reel-stats-client {
    font-family: var(--font-body);
    font-size: 0.6rem; letter-spacing: 0.1em; text-transform: uppercase;
    color: var(--text-muted);
}
.reel-stats-title {
    font-weight: 800; color: var(--text-primary);
    font-size: 0.9rem; margin-top: 0.2rem;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.reel-stats-pills { display: flex; justify-content: center; gap: 0.5rem; margin-top: 0.5rem; flex-wrap: wrap; }
.reel-pill {
    font-size: 0.65rem;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0.25rem 0.6rem;
    color: var(--text-secondary);
    white-space: nowrap;
}
.reel-pill strong { color: var(--saffron-light); }

/* ── Prev/next + dots controller ── */
.reel-controller {
    display: flex; align-items: center; justify-content: center;
    gap: 1.5rem;
    margin-top: 2rem;
    position: relative; z-index: 3;
}
.reel-nav-btn {
    width: 44px; height: 44px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: rgba(10,12,20,0.8);
    color: var(--text-secondary);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}
.reel-nav-btn:hover { background: var(--saffron); color: #14100a; border-color: var(--saffron); }
.reel-nav-btn:active { transform: scale(0.95); }

.reel-dots { display: flex; align-items: center; gap: 0.6rem; }
.reel-dot {
    width: 6px; height: 6px;
    border-radius: 999px;
    background: rgba(255,255,255,0.2);
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}
.reel-dot.active { width: 24px; background: var(--saffron); }
.reel-dot:hover { background: rgba(255,255,255,0.4); }

/* ==========================================================================
   Expanded Analytics Modal
   ========================================================================== */
.reel-modal-overlay {
    position: fixed; inset: 0; z-index: 999;
    display: none;
    align-items: center; justify-content: center;
    padding: 1rem;
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(16px);
    overflow-y: auto;
}
.reel-modal-overlay.active { display: flex; }

.reel-modal {
    background: #0a0c14;
    border: 1px solid rgba(255,107,26,0.3);
    border-radius: 24px;
    width: 100%; max-width: 1100px;
    height: 90vh; max-height: 800px;
    overflow: hidden;
    box-shadow: 0 0 80px rgba(255,107,26,0.22);
    position: relative;
    display: flex; flex-direction: column;
    z-index: 2;
}
@media (min-width: 768px) {
    .reel-modal { flex-direction: row; height: 80vh; }
}

.reel-modal-left {
    width: 100%; height: 45%;
    background: #000;
    position: relative;
    display: flex; align-items: center; justify-content: center;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
@media (min-width: 768px) {
    .reel-modal-left { width: 38%; height: 100%; border-bottom: none; border-right: 1px solid var(--border); }
}
.reel-modal-video { width: 100%; height: 100%; object-fit: cover; display: block; }
.reel-modal-video-shade {
    position: absolute; inset: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0.4), transparent 40%, rgba(0,0,0,0.75));
    pointer-events: none;
}
.reel-modal-video-info { position: absolute; bottom: 1.5rem; left: 1.5rem; right: 1.5rem; text-align: left; }
.reel-modal-badge {
    display: inline-block;
    background: var(--saffron); color: #14100a;
    font-size: 0.6rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
    padding: 0.25rem 0.55rem; border-radius: 4px;
}
.reel-modal-video-info h3 { font-size: 1.15rem; font-weight: 700; color: #fff; margin: 0.5rem 0 0.2rem; }
.reel-modal-video-info p { font-size: 0.72rem; color: var(--text-secondary); margin: 0; }

.reel-modal-right {
    width: 100%; height: 55%;
    background: #080b12;
    color: var(--text-primary);
    padding: 1.5rem;
    display: flex; flex-direction: column; justify-content: space-between;
    overflow-y: auto;
}
@media (min-width: 768px) {
    .reel-modal-right { width: 62%; height: 100%; padding: 2rem; }
}

.reel-modal-header {
    display: flex; align-items: flex-start; justify-content: space-between;
    border-bottom: 1px solid var(--border);
    padding-bottom: 1rem;
    gap: 1rem;
}
.reel-modal-kicker {
    display: block;
    font-family: var(--font-body);
    font-size: 0.6rem; color: var(--saffron);
    text-transform: uppercase; letter-spacing: 0.12em;
}
.reel-modal-header h2 { font-size: 1.25rem; font-weight: 800; text-transform: uppercase; margin: 0.3rem 0; letter-spacing: 0.01em; }
.reel-modal-sub { font-size: 0.72rem; color: var(--text-secondary); margin: 0; }
.reel-modal-close {
    flex-shrink: 0;
    padding: 0.5rem;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border);
    border-radius: 50%;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
}
.reel-modal-close:hover { border-color: var(--saffron); color: var(--saffron); }

.reel-modal-body { flex: 1; margin: 1.5rem 0; display: flex; flex-direction: column; gap: 1.5rem; }

.reel-kpi-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.75rem; }
.reel-kpi-card {
    background: #0b101c;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 1rem 0.5rem;
    text-align: center;
}
.reel-kpi-label {
    font-family: var(--font-body);
    font-size: 0.58rem; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 0.06em;
}
.reel-kpi-value { font-size: 1.25rem; font-weight: 800; color: var(--saffron-light); margin-top: 0.3rem; }
.reel-kpi-green { color: var(--emerald); }

.reel-retention-chart {
    background: #0b101c;
    border: 1px solid rgba(255,107,26,0.15);
    border-radius: 16px;
    padding: 1.2rem;
}
.reel-retention-head {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 0.75rem; flex-wrap: wrap; gap: 0.5rem;
}
.reel-retention-head span:first-child {
    font-size: 0.7rem; font-weight: 700; text-transform: uppercase;
    color: var(--text-secondary);
    display: flex; align-items: center; gap: 0.4rem;
}
.reel-retention-head i { color: var(--saffron); }
.reel-retention-badge {
    font-size: 0.6rem; color: var(--saffron);
    background: rgba(255,107,26,0.1);
    padding: 0.15rem 0.5rem; border-radius: 6px; font-weight: 700;
}
.reel-retention-bars {
    height: 64px;
    display: flex; align-items: flex-end; gap: 0.4rem;
    padding-top: 1rem;
    border-bottom: 1px solid var(--border);
}
.reel-bar {
    flex: 1;
    background: linear-gradient(to top, var(--saffron), var(--gold-light));
    border-radius: 3px 3px 0 0;
    position: relative;
    cursor: help;
    transition: opacity 0.2s ease;
}
.reel-bar:hover { opacity: 0.8; }
.reel-bar-dip { background: linear-gradient(to top, #C0392B, #ff6b6b); }
.reel-bar-end { background: linear-gradient(to top, var(--emerald), #34d399); }
.reel-retention-labels {
    display: flex; justify-content: space-between;
    font-family: var(--font-body);
    font-size: 0.55rem; color: var(--text-muted);
    margin-top: 0.4rem;
}

.reel-script-grid { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 768px) { .reel-script-grid { grid-template-columns: 1fr 1fr; } }
.reel-script-card { background: #0b101c; border: 1px solid var(--border); border-radius: 14px; padding: 1rem; }
.reel-script-label {
    display: flex; align-items: center; gap: 0.4rem;
    font-size: 0.68rem; font-weight: 700; text-transform: uppercase;
    margin-bottom: 0.4rem;
}
.reel-script-hook { color: var(--gold-light); }
.reel-script-retention { color: var(--emerald); }
.reel-script-card p { font-size: 0.75rem; color: var(--text-secondary); line-height: 1.55; margin: 0; }

.reel-results-card {
    background: rgba(255,107,26,0.05);
    border: 1px solid rgba(255,107,26,0.15);
    border-radius: 14px;
    padding: 1rem;
}
.reel-results-label {
    display: flex; align-items: center; gap: 0.4rem;
    font-size: 0.68rem; font-weight: 700; text-transform: uppercase;
    color: var(--saffron); margin-bottom: 0.4rem;
}
.reel-results-card p { font-size: 0.75rem; color: var(--text-secondary); line-height: 1.55; margin: 0; }

.reel-modal-footer {
    border-top: 1px solid var(--border);
    padding-top: 1rem;
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: 0.75rem;
    font-family: var(--font-body);
    font-size: 0.62rem; color: var(--text-muted);
}
.reel-modal-cta {
    display: flex; align-items: center; gap: 0.4rem;
    background: none; border: none;
    color: var(--saffron); font-weight: 700;
    cursor: pointer;
    font-size: 0.7rem; text-transform: uppercase;
    transition: color 0.3s ease;
}
.reel-modal-cta:hover { color: var(--text-primary); }

@media (prefers-reduced-motion: reduce) {
    .reels-glow-1, .orbit-ring-outer, .reel-tag, .reel-card {
        animation: none !important;
        transition: none !important;
    }
}
