/* ═══════════════════════════════════════════════════════════════
   TRADING RESULTS — Live Video Section
   Premium dark fintech aesthetic with glassmorphism, animated
   borders, scanline FX, and staggered scroll-reveal entrances.
   Scoped to .trading-results-section so it embeds anywhere.
   ═══════════════════════════════════════════════════════════════ */

.trading-results-section {
    /* ── local tokens ── */
    --tr-bg:            #0a0f1c;
    --tr-bg-2:          #0d1424;
    --tr-bg-3:          #111a2e;
    --tr-card:          rgba(255,255,255,0.045);
    --tr-card-hi:       rgba(255,255,255,0.075);
    --tr-border:        rgba(255,255,255,0.10);
    --tr-border-hi:     rgba(255,255,255,0.18);

    --tr-gold:          #FCB42D;
    --tr-gold-2:        #ffd36b;
    --tr-gold-soft:     rgba(252,180,45,0.14);
    --tr-green:         #3BD297;
    --tr-green-soft:    rgba(59,210,151,0.14);
    --tr-blue:          #1980EC;
    --tr-blue-soft:     rgba(25,128,236,0.14);
    --tr-red:           #EE4F6F;
    --tr-red-soft:      rgba(238,79,111,0.14);

    --tr-text:          #ffffff;
    --tr-text-2:        #d7dce8;
    --tr-text-dim:      #8c95a8;

    --tr-radius:        12px;
    --tr-radius-lg:     16px;
    --tr-shadow-sm:     0 4px 18px rgba(0,0,0,0.30);
    --tr-shadow-gold:   0 12px 48px rgba(252,180,45,0.18);

    position: relative;
    overflow: hidden;
    padding: 80px 0 100px;
    color: var(--tr-text);

    /* layered background: subtle grid + radial colour washes */
    background:
        /* faint grid pattern */
        linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px),
        /* colour washes */
        radial-gradient(1100px 600px at 20% 0%,   rgba(252,180,45,0.09), transparent 60%),
        radial-gradient(900px  500px at 85% 20%,  rgba(59,210,151,0.06), transparent 60%),
        radial-gradient(800px  500px at 50% 100%, rgba(25,128,236,0.06), transparent 60%),
        linear-gradient(180deg, var(--tr-bg) 0%, var(--tr-bg-2) 50%, var(--tr-bg) 100%);
    background-size:
        60px 60px,
        60px 60px,
        100% 100%,
        100% 100%,
        100% 100%,
        100% 100%;
}

/* subtle top/bottom fade to blend with adjacent sections */
.trading-results-section::before,
.trading-results-section::after {
    content: '';
    position: absolute;
    left: 0; right: 0;
    height: 120px;
    pointer-events: none;
    z-index: 1;
}
.trading-results-section::before {
    top: 0;
    background: linear-gradient(180deg, var(--tr-bg), transparent);
}
.trading-results-section::after {
    bottom: 0;
    background: linear-gradient(0deg, var(--tr-bg), transparent);
}


/* ═══════════════════════════════════════════════════════════════
   HEADER
   ═══════════════════════════════════════════════════════════════ */
.tr-header {
    position: relative;
    z-index: 2;
    text-align: center;
    margin-bottom: 48px;
    animation: trFadeSlideUp 0.8s ease both;
}

/* pill badge */
.tr-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 16px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--tr-gold-2);
    background: var(--tr-gold-soft);
    border: 1px solid rgba(252,180,45,0.28);
    border-radius: 100px;
    margin-bottom: 16px;
    position: relative;
    overflow: hidden;
    animation: trFadeSlideUp 0.6s ease both;
}
/* shimmer sweep */
.tr-badge::after {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(
        105deg,
        transparent 40%,
        rgba(252,180,45,0.30) 50%,
        transparent 60%
    );
    animation: trShimmer 3.5s ease-in-out infinite;
}

/* section title */
.tr-header h2 {
    font-size: clamp(32px, 5vw, 56px);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.02em;
    margin: 0 0 12px;
    color: var(--tr-text);
    animation: trFadeSlideUp 0.8s 0.1s ease both;
}

/* gold gradient highlight */
.tr-highlight {
    background: linear-gradient(135deg, var(--tr-gold) 0%, var(--tr-gold-2) 50%, #fff1c7 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    filter: drop-shadow(0 4px 14px rgba(252,180,45,0.30));
}

/* subtitle */
.tr-subtitle {
    font-size: clamp(14px, 1.4vw, 17px);
    color: var(--tr-text-2);
    max-width: 620px;
    margin: 0 auto;
    line-height: 1.6;
    animation: trFadeSlideUp 0.8s 0.2s ease both;
}


/* ═══════════════════════════════════════════════════════════════
   SHARED VIDEO CARD GLASS
   ═══════════════════════════════════════════════════════════════ */
.tr-main-video,
.tr-video-card {
    position: relative;
    background: linear-gradient(170deg, var(--tr-card-hi), var(--tr-card));
    border: 1px solid var(--tr-border);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    transition:
        transform 0.4s cubic-bezier(.22,1,.36,1),
        box-shadow 0.4s ease,
        border-color 0.4s ease;
}
/* glass top-edge shine */
.tr-main-video::before,
.tr-video-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(180deg, rgba(255,255,255,0.10), transparent 50%);
    -webkit-mask:
        linear-gradient(#fff,#fff) content-box,
        linear-gradient(#fff,#fff);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    z-index: 1;
}


/* ═══════════════════════════════════════════════════════════════
   MAIN / LIVE VIDEO CARD
   ═══════════════════════════════════════════════════════════════ */
.tr-main-video {
    position: relative;
    z-index: 2;
    border-radius: var(--tr-radius-lg);
    padding: 1px;
    margin-top: 36px;
    box-shadow:
        0 0 60px -12px rgba(252,180,45,0.14),
        var(--tr-shadow-sm);
    animation: trFadeSlideUp 0.8s 0.55s ease both;
    isolation: isolate;
}

/* ── animated gradient border ──
   A conic gradient spins behind the card, masked so only
   the 2px "border" is visible. GPU-friendly: only transform. */
.tr-main-video::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: calc(var(--tr-radius-lg) + 2px);
    background: conic-gradient(
        from var(--tr-border-angle, 0deg),
        var(--tr-gold),
        rgba(252,180,45,0.20),
        var(--tr-gold-2),
        rgba(252,180,45,0.10),
        var(--tr-gold)
    );
    animation: trBorderSpin 6s linear infinite;
    z-index: -1;
    opacity: 0.65;
}
@property --tr-border-angle {
    syntax: '<angle>';
    initial-value: 0deg;
    inherits: false;
}
@keyframes trBorderSpin {
    to { --tr-border-angle: 360deg; }
}

/* inner card surface — clips content, hides rotating gradient */
.tr-main-video > * {
    position: relative;
    z-index: 1;
}
.tr-main-video .tr-video-label,
.tr-main-video .tr-video-container {
    background: var(--tr-bg-2);
}
.tr-main-video .tr-video-label {
    border-radius: var(--tr-radius-lg) var(--tr-radius-lg) 0 0;
    padding: 14px 20px;
}
.tr-main-video .tr-video-container {
    border-radius: 0 0 var(--tr-radius-lg) var(--tr-radius-lg);
}

/* gold radial glow behind main card */
.tr-main-video-wrapper {
    position: relative;
    z-index: 2;
}
.tr-main-video-wrapper::before {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    width: 110%; height: 130%;
    transform: translate(-50%, -50%);
    background: radial-gradient(ellipse at center, rgba(252,180,45,0.08) 0%, transparent 70%);
    pointer-events: none;
    z-index: -1;
}

/* hover lift */
.tr-main-video:hover {
    transform: translateY(-4px);
    box-shadow:
        0 0 80px -8px rgba(252,180,45,0.22),
        0 20px 60px rgba(0,0,0,0.40);
    border-color: rgba(252,180,45,0.30);
}


/* ═══════════════════════════════════════════════════════════════
   VIDEO LABEL (shared)
   ═══════════════════════════════════════════════════════════════ */
.tr-video-label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--tr-text-dim);
    border-bottom: 1px solid var(--tr-border);
}
.tr-video-label i,
.tr-video-label [uk-icon] {
    font-size: 14px;
    opacity: 0.7;
}


/* ═══════════════════════════════════════════════════════════════
   LIVE DOT — pulsing red indicator
   ═══════════════════════════════════════════════════════════════ */
.tr-live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--tr-red);
    box-shadow: 0 0 8px rgba(238,79,111,0.70);
    animation: trLivePulse 1.6s ease-in-out infinite;
    flex-shrink: 0;
}
@keyframes trLivePulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(238,79,111,0.55); }
    50%      { box-shadow: 0 0 0 6px rgba(238,79,111,0.00); }
}


/* ═══════════════════════════════════════════════════════════════
   VIDEO CONTAINER — aspect ratio (16:9 main, 9:16 small)
   ═══════════════════════════════════════════════════════════════ */
.tr-video-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 default (main live stream) */
    overflow: hidden;
    background: var(--tr-bg-3);
}
/* Small cards use 9:16 portrait ratio for YouTube Shorts / TikTok */
.tr-video-card .tr-video-container {
    padding-bottom: 177.78%; /* 9:16 */
}

.tr-video-container iframe {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* subtle inner vignette */
.tr-video-container::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 2;
    box-shadow: inset 0 0 40px rgba(0,0,0,0.30);
    border-radius: inherit;
}

/* radius modifiers */
.tr-video-main .tr-video-container {
    border-radius: 0 0 var(--tr-radius-lg) var(--tr-radius-lg);
}
.tr-video-small .tr-video-container {
    border-radius: 0 0 var(--tr-radius) var(--tr-radius);
}


/* ═══════════════════════════════════════════════════════════════
   SCANLINE FX — very subtle horizontal sweep on main video
   ═══════════════════════════════════════════════════════════════ */
.tr-video-main .tr-video-container::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 3;
    pointer-events: none;
    background: linear-gradient(
        180deg,
        transparent 0%,
        rgba(252,180,45,0.03) 50%,
        transparent 100%
    );
    background-size: 100% 12px;
    animation: trScanline 8s linear infinite;
    opacity: 0.45;
}
@keyframes trScanline {
    0%   { transform: translateY(-100%); }
    100% { transform: translateY(100%); }
}


/* ═══════════════════════════════════════════════════════════════
   SMALL VIDEO GRID
   ═══════════════════════════════════════════════════════════════ */
.tr-grid {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}


/* ═══════════════════════════════════════════════════════════════
   SMALL VIDEO CARDS
   ═══════════════════════════════════════════════════════════════ */
.tr-video-card {
    border-radius: var(--tr-radius);
    overflow: hidden;
    box-shadow: var(--tr-shadow-sm);
    opacity: 0;
    animation: trFadeSlideUp 0.8s ease forwards;
}
/* staggered entrance */
.tr-video-card:nth-child(1) { animation-delay: 0.15s; }
.tr-video-card:nth-child(2) { animation-delay: 0.25s; }
.tr-video-card:nth-child(3) { animation-delay: 0.35s; }

.tr-video-card .tr-video-label {
    background: linear-gradient(180deg, var(--tr-card-hi), var(--tr-card));
}
.tr-video-card .tr-video-container {
    background: var(--tr-bg-3);
}

/* hover: lift + glow */
.tr-video-card:hover {
    transform: translateY(-5px);
    border-color: var(--tr-border-hi);
}

/* per-card accent hover colours */
/* card 1 — Yesterday — gold */
.tr-video-card:nth-child(1):hover {
    border-color: rgba(252,180,45,0.35);
    box-shadow:
        0 0 40px -6px rgba(252,180,45,0.18),
        0 16px 48px rgba(0,0,0,0.35);
}
.tr-video-card:nth-child(1):hover .tr-video-label {
    color: var(--tr-gold-2);
}

/* card 2 — Last Week — blue */
.tr-video-card:nth-child(2):hover {
    border-color: rgba(25,128,236,0.35);
    box-shadow:
        0 0 40px -6px rgba(25,128,236,0.18),
        0 16px 48px rgba(0,0,0,0.35);
}
.tr-video-card:nth-child(2):hover .tr-video-label {
    color: var(--tr-blue);
}

/* card 3 — Last Month — green */
.tr-video-card:nth-child(3):hover {
    border-color: rgba(59,210,151,0.35);
    box-shadow:
        0 0 40px -6px rgba(59,210,151,0.18),
        0 16px 48px rgba(0,0,0,0.35);
}
.tr-video-card:nth-child(3):hover .tr-video-label {
    color: var(--tr-green);
}


/* ═══════════════════════════════════════════════════════════════
   PLACEHOLDER (loading / fallback state)
   ═══════════════════════════════════════════════════════════════ */
.tr-video-placeholder {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: var(--tr-bg-3);
    color: var(--tr-text-dim);
    animation: trPlaceholderPulse 2.4s ease-in-out infinite;
}
.tr-video-placeholder i,
.tr-video-placeholder [uk-icon] {
    font-size: 36px;
    opacity: 0.4;
}
.tr-video-placeholder span {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.10em;
    text-transform: uppercase;
}
@keyframes trPlaceholderPulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.55; }
}


/* ═══════════════════════════════════════════════════════════════
   KEYFRAMES — entrance & FX
   ═══════════════════════════════════════════════════════════════ */
@keyframes trFadeSlideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes trShimmer {
    0%   { left: -100%; }
    35%  { left: 100%; }
    100% { left: 100%; }
}

/* subtle ambient glow pulse on main card */
@keyframes trGlowPulse {
    0%, 100% { box-shadow: 0 0 60px -12px rgba(252,180,45,0.14), 0 8px 32px rgba(0,0,0,0.30); }
    50%      { box-shadow: 0 0 80px -8px rgba(252,180,45,0.22), 0 8px 32px rgba(0,0,0,0.30); }
}


/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════ */

/* tablet — 2-column small cards */
@media (max-width: 960px) {
    .trading-results-section {
        padding: 60px 0 80px;
    }
    .tr-header {
        margin-bottom: 36px;
    }
    .tr-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
    /* third card spans full width on 2-col */
    .tr-video-card:nth-child(3) {
        grid-column: 1 / -1;
        max-width: 320px;
        justify-self: center;
        width: 100%;
    }
    .tr-main-video .tr-video-label {
        padding: 12px 16px;
    }
}

/* mobile — single column */
@media (max-width: 640px) {
    .trading-results-section {
        padding: 48px 0 64px;
        background-size:
            40px 40px,
            40px 40px,
            100% 100%,
            100% 100%,
            100% 100%,
            100% 100%;
    }
    .tr-header h2 {
        font-size: clamp(26px, 8vw, 36px);
    }
    .tr-header {
        margin-bottom: 28px;
    }
    .tr-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }
    .tr-main-video {
        margin-bottom: 24px;
    }
    .tr-main-video .tr-video-label,
    .tr-video-card .tr-video-label {
        padding: 10px 14px;
        font-size: 10px;
    }
    .tr-badge {
        font-size: 10px;
        padding: 6px 12px;
    }
    .tr-subtitle {
        padding: 0 8px;
    }
}

/* accessibility — respect reduced motion */
@media (prefers-reduced-motion: reduce) {
    .trading-results-section *,
    .trading-results-section *::before,
    .trading-results-section *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
