/* ==========================================================
   DeyLabs CyberHUB — Glassmorphism UI Layer
   ----------------------------------------------------------
   Adds a modern "frosted glass" treatment on top of the base
   theme. Semi-transparent panels, blurred backdrop, aurora
   glow orbs, gradient borders and subtle shine animations.

   Loaded AFTER styles.css. Remove the <link> in index.html
   to fully revert to the original flat design.
   ========================================================== */

:root {
    --glass-bg: linear-gradient(160deg, rgba(148,163,255,0.10) 0%, rgba(255,255,255,0.035) 45%, rgba(99,102,241,0.06) 100%);
    --glass-border: linear-gradient(160deg, rgba(129,140,248,0.55) 0%, rgba(34,211,238,0.22) 45%, rgba(255,255,255,0.05) 100%);
    --glass-highlight: inset 0 1px 0 rgba(255,255,255,0.10);
    --glass-shadow: 0 10px 40px rgba(2,6,23,0.55), 0 2px 8px rgba(2,6,23,0.4);
    --glass-blur: 20px;
    --glow-indigo: rgba(99,102,241,0.35);
    --glow-cyan: rgba(34,211,238,0.28);
}

/* ----------------------------------------------------------
   1) AURORA BACKGROUND — animated glow orbs behind content
   ---------------------------------------------------------- */
body { position: relative; }

body::before,
body::after {
    content: '';
    position: fixed;
    inset: auto;
    z-index: -1;
    pointer-events: none;
    border-radius: 50%;
    filter: blur(90px);
    will-change: transform;
}

body::before {
    width: 55vw;
    height: 55vw;
    top: -18vw;
    left: -12vw;
    background: radial-gradient(circle at 30% 30%, rgba(99,102,241,0.55), transparent 62%);
    animation: aurora-drift-1 26s ease-in-out infinite alternate;
}

body::after {
    width: 48vw;
    height: 48vw;
    bottom: -16vw;
    right: -10vw;
    background: radial-gradient(circle at 60% 40%, rgba(34,211,238,0.40), rgba(52,211,153,0.18) 55%, transparent 70%);
    animation: aurora-drift-2 32s ease-in-out infinite alternate;
}

@keyframes aurora-drift-1 {
    0%   { transform: translate(0, 0) scale(1); }
    50%  { transform: translate(9vw, 6vh) scale(1.12); }
    100% { transform: translate(-4vw, 12vh) scale(0.96); }
}

@keyframes aurora-drift-2 {
    0%   { transform: translate(0, 0) scale(1); }
    50%  { transform: translate(-8vw, -7vh) scale(1.08); }
    100% { transform: translate(5vw, -12vh) scale(0.94); }
}

/* Subtle grid overlay for a "tech glass" feel */
body::marker { display: none; }
main { position: relative; }

/* ----------------------------------------------------------
   2) SITE HEADER — frosted glass with gradient edge
   ---------------------------------------------------------- */
.site-header {
    background: linear-gradient(180deg, rgba(10,14,30,0.72), rgba(10,14,30,0.45));
    backdrop-filter: blur(24px) saturate(160%);
    -webkit-backdrop-filter: blur(24px) saturate(160%);
    border-bottom: 1px solid transparent;
    background-clip: padding-box;
    box-shadow: inset 0 -1px 0 rgba(255,255,255,0.06), 0 8px 32px rgba(2,6,23,0.45);
}

.nav-link {
    position: relative;
}
.nav-link:hover { background: rgba(99,102,241,0.12); }
.nav-link.active {
    background: linear-gradient(160deg, rgba(99,102,241,0.28), rgba(34,211,238,0.10));
    box-shadow: inset 0 0 0 1px rgba(129,140,248,0.35), 0 0 16px rgba(99,102,241,0.25);
}

/* ----------------------------------------------------------
   3) GLASS PANEL PRIMITIVE
   Gradient border + translucent body + top highlight
   ---------------------------------------------------------- */
.glass-panel,
.featured-card,
.highlight-card,
.news-card,
.news-card.alt,
.news-featured-card,
.research-card,
.step-card,
.feature-card,
.card,
.assessment-card,
.about-feature-card,
.hero-stats-card,
.topic-cloud,
.tl-legend,
.card.vendor-card,
.workbench-card {
    background: var(--glass-bg) padding-box, var(--glass-border) border-box;
    border: 1px solid transparent;
    backdrop-filter: blur(var(--glass-blur)) saturate(160%);
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(160%);
    box-shadow: var(--glass-highlight), var(--glass-shadow);
    transition: transform 0.28s ease, box-shadow 0.28s ease, border-color 0.28s ease, background 0.28s ease;
}

/* Hover: lift + glow */
.featured-card:hover,
.highlight-card:hover,
.news-card:hover,
.news-card.alt:hover,
.news-featured-card:hover,
.research-card:hover,
.step-card:hover,
.feature-card:hover,
.card:hover,
.assessment-card:hover,
.about-feature-card:hover,
.hero-stats-card:hover,
.card.vendor-card:hover,
.workbench-card:hover {
    transform: translateY(-3px);
    box-shadow:
        var(--glass-highlight),
        0 0 0 1px rgba(129,140,248,0.28),
        0 0 34px rgba(99,102,241,0.28),
        0 18px 50px rgba(2,6,23,0.6);
}

/* Category-tinted hover borders for news cards */
.news-card:hover { border-color: transparent; }

/* ----------------------------------------------------------
   4) FEATURED STORY — hero card gets the full glass treatment
   ---------------------------------------------------------- */
.featured-story {
    background: radial-gradient(ellipse 70% 90% at 50% 0%, rgba(99,102,241,0.14) 0%, transparent 65%);
}

.featured-card {
    padding: 44px 48px;
    border-radius: 22px;
    background:
        linear-gradient(160deg, rgba(30,34,74,0.55), rgba(13,18,40,0.35)) padding-box,
        linear-gradient(120deg, rgba(129,140,248,0.7), rgba(34,211,238,0.35), rgba(248,113,113,0.35)) border-box;
}

.featured-card::before {
    height: 4px;
    background: linear-gradient(90deg, rgba(248,113,113,0.9), rgba(99,102,241,0.9), rgba(34,211,238,0.9));
    box-shadow: 0 0 18px rgba(99,102,241,0.6);
}

.featured-title {
    background: linear-gradient(120deg, #ffffff 0%, #c7d2fe 50%, #a5f3fc 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Compact featured story tile */
.featured-story { padding: 24px 0 20px; }
.featured-card { padding: 26px 30px; border-radius: 18px; }
.featured-card::before { height: 3px; }
.featured-title { font-size: 26px; line-height: 1.25; margin-bottom: 10px; }
.featured-summary { font-size: 14px; line-height: 1.55; margin-bottom: 14px; max-width: 680px; }
.featured-badge { margin-bottom: 10px; }
.featured-meta { gap: 16px; font-size: 12px; }

/* ----------------------------------------------------------
   5) BREAKING BAR — glass ribbon
   ---------------------------------------------------------- */
.breaking-bar {
    background: linear-gradient(90deg, rgba(190,24,60,0.22), rgba(30,27,46,0.55) 55%, rgba(30,27,46,0.4));
    backdrop-filter: blur(14px) saturate(150%);
    -webkit-backdrop-filter: blur(14px) saturate(150%);
    border-bottom: 1px solid transparent;
    background-clip: padding-box;
    box-shadow: inset 0 -1px 0 rgba(255,255,255,0.05);
}

.breaking-label {
    background: linear-gradient(135deg, #ef4444, #b91c1c);
    box-shadow: 0 0 16px rgba(239,68,68,0.5);
}

/* Breaking ticker — airport-board vertical rotation */
.breaking-ticker {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.breaking-rotator {
    display: flex;
    flex-direction: column;
    transition: transform 0.6s cubic-bezier(0.45, 0, 0.2, 1);
    will-change: transform;
}

.breaking-slide {
    display: block;
    flex-shrink: 0;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.breaking-slide:hover,
.breaking-slide.active { color: var(--text); }

/* Cyber stock ticker — thin scrolling tape above the breaking bar */
.stock-ticker {
    height: 28px;
    background: linear-gradient(90deg, rgba(8,16,38,0.7), rgba(12,22,52,0.45));
    border-bottom: 1px solid rgba(129,140,248,0.16);
    overflow: hidden;
    font-size: 12px;
    line-height: 28px;
    white-space: nowrap;
}

/* Same-width content container as the header & breaking bar */
.stock-ticker-inner {
    display: flex;
    align-items: center;
    height: 100%;
}

.stock-ticker-label {
    flex-shrink: 0;
    padding-right: 16px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.6px;
    color: var(--accent);
}

.stock-ticker-track {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
}

.stock-ticker-content {
    display: inline-block;
    white-space: nowrap;
    animation: stock-marquee 42s linear infinite;
    will-change: transform;
}

.stock-ticker:hover .stock-ticker-content { animation-play-state: paused; }

.stock-item {
    display: inline-block;
    margin-right: 26px;
    color: var(--text-secondary);
}

.stock-sym { font-weight: 700; color: var(--text); margin-right: 8px; }
.stock-price { margin-right: 8px; font-variant-numeric: tabular-nums; }
.stock-pct { font-weight: 600; font-variant-numeric: tabular-nums; }
.stock-item.up .stock-pct { color: var(--success); }
.stock-item.down .stock-pct { color: var(--danger); }

@keyframes stock-marquee {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}

/* ----------------------------------------------------------
   6) TOPIC CLOUD + TIMELINE — glass containers
   ---------------------------------------------------------- */
.topic-cloud-section,
.timeline-bar-section {
    background: linear-gradient(180deg, rgba(10,18,48,0.35), rgba(8,12,26,0.2));
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.topic-cloud {
    gap: 10px 16px;
    padding: 20px 24px;
    border-radius: 16px;
}

.cloud-item {
    color: color-mix(in srgb, var(--clr, var(--primary)) 68%, #ffffff);
    text-shadow: 0 0 12px color-mix(in srgb, var(--clr, var(--primary)) 45%, transparent);
    border: 1px solid color-mix(in srgb, var(--clr, var(--primary)) 40%, transparent);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.cloud-item:hover {
    box-shadow: 0 6px 18px color-mix(in srgb, var(--clr, var(--primary)) 35%, transparent);
    transform: translateY(-2px) scale(1.04);
}

.tl-legend { border-radius: 12px; }

.timeline-track {
    background: rgba(14,26,58,0.55);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.06), 0 4px 16px rgba(2,6,23,0.4);
}

/* Compact topic cloud + category demand timeline */
.topic-cloud-section { padding: 14px 0 12px; }
.timeline-bar-section { padding: 12px 0 16px; }
.topic-cloud { gap: 6px 10px; padding: 12px 16px; }
.cloud-item { padding: 2px 11px; font-size: 13px; }
.timeline-bar-wrap { gap: 4px; }
.timeline-month { gap: 10px; }
.timeline-track { height: 14px; }
.timeline-label { min-width: 56px; font-size: 11px; }
.timeline-count { font-size: 12px; }
.tl-legend { gap: 10px 18px; margin-bottom: 10px; padding: 6px 12px; }
.tl-legend-item { font-size: 11px; }
.tl-legend-dot { width: 7px; height: 7px; }
.topic-cloud-section .section-header-row,
.timeline-bar-section .section-header-row { margin-bottom: 6px; }
.topic-cloud-section .section-title,
.timeline-bar-section .section-title { font-size: 16px; }
.topic-cloud-section .section-badge,
.timeline-bar-section .section-badge { font-size: 10px; padding: 1px 8px; }

/* Reader Insights button + modal */
.section-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.insight-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    font-size: 11px;
    font-weight: 600;
    color: var(--accent);
    background: rgba(34,211,238,0.12);
    border: 1px solid rgba(34,211,238,0.3);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s;
}
.insight-btn:hover {
    background: rgba(34,211,238,0.22);
    box-shadow: 0 0 12px rgba(34,211,238,0.3);
    transform: translateY(-1px);
}

.insight-modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.insight-modal.open { display: flex; }

.insight-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(4,8,18,0.72);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.insight-modal-panel {
    position: relative;
    width: 100%;
    max-width: 760px;
    max-height: 82vh;
    overflow-y: auto;
    padding: 28px;
    border-radius: 18px;
    background: var(--glass-bg) padding-box, var(--glass-border) border-box;
    border: 1px solid transparent;
    backdrop-filter: blur(20px) saturate(160%);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
    box-shadow: var(--glass-highlight), 0 20px 60px rgba(2,6,23,0.7);
}

.insight-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    border: 1px solid rgba(129,140,248,0.3);
    background: rgba(14,26,58,0.6);
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
}
.insight-modal-close:hover { color: var(--text); border-color: var(--danger); }

.insight-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

@media (max-width: 600px) {
    .insight-modal-panel { padding: 20px 16px; }
    .insight-modal-header { flex-direction: column; align-items: flex-start; gap: 6px; }
}

/* ----------------------------------------------------------
   7) HIGHLIGHT CARDS — richer tints with glass
   ---------------------------------------------------------- */
.highlight-card {
    border-radius: 16px;
}
.highlight-card.critical {
    background: linear-gradient(160deg, rgba(190,18,60,0.22), rgba(30,16,32,0.35)) padding-box, var(--glass-border) border-box;
}
.highlight-card.trending {
    background: linear-gradient(160deg, rgba(245,158,11,0.16), rgba(20,24,40,0.35)) padding-box, var(--glass-border) border-box;
}
.highlight-card.innovation {
    background: linear-gradient(160deg, rgba(34,211,238,0.16), rgba(12,20,40,0.35)) padding-box, var(--glass-border) border-box;
}

/* ----------------------------------------------------------
   8) SECTION HEADERS & BADGES — glass chips
   ---------------------------------------------------------- */
.section-badge {
    background: rgba(14,26,58,0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(129,140,248,0.25);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
}

.section-link {
    padding: 6px 14px;
    border-radius: 20px;
    background: linear-gradient(160deg, rgba(99,102,241,0.18), rgba(34,211,238,0.08));
    border: 1px solid rgba(129,140,248,0.3);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
    transition: all 0.2s ease;
}
.section-link:hover {
    background: linear-gradient(160deg, rgba(99,102,241,0.3), rgba(34,211,238,0.14));
    box-shadow: 0 0 18px rgba(99,102,241,0.3);
    transform: translateY(-1px);
}

/* ----------------------------------------------------------
   9) BUTTONS — gradient glow + shine sweep
   ---------------------------------------------------------- */
.btn-primary,
.btn-next {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 55%, #22d3ee 130%);
    background-size: 160% 160%;
    position: relative;
    overflow: hidden;
    box-shadow: 0 6px 20px rgba(99,102,241,0.4), inset 0 1px 0 rgba(255,255,255,0.2);
}

.btn-primary:hover,
.btn-next:hover {
    background-position: 100% 100%;
    box-shadow: 0 10px 30px rgba(99,102,241,0.55), 0 0 22px rgba(34,211,238,0.35), inset 0 1px 0 rgba(255,255,255,0.25);
    transform: translateY(-2px);
}

.btn-primary::after,
.btn-next::after {
    content: '';
    position: absolute;
    top: 0; left: -80%;
    width: 60%;
    height: 100%;
    background: linear-gradient(100deg, transparent, rgba(255,255,255,0.45), transparent);
    transform: skewX(-20deg);
    animation: btn-shine 3.6s ease-in-out infinite;
}

@keyframes btn-shine {
    0%   { left: -80%; }
    55%  { left: 130%; }
    100% { left: 130%; }
}

.btn-outline {
    background: rgba(14,26,58,0.45);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(148,163,255,0.35);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
}
.btn-outline:hover {
    border-color: rgba(148,163,255,0.6);
    background: rgba(99,102,241,0.14);
    box-shadow: 0 0 20px rgba(99,102,241,0.25), inset 0 1px 0 rgba(255,255,255,0.1);
}

/* ----------------------------------------------------------
   10) MISC MODERN TOUCHES
   ---------------------------------------------------------- */
/* Logo mark glow */
.logo-icon {
    filter: drop-shadow(0 0 10px rgba(99,102,241,0.6));
}

/* Header tagline divider */
.header-tagline { border-left-color: rgba(129,140,248,0.3); }

/* Gradient text shimmer on hero/headings */
.gradient-text {
    background: linear-gradient(120deg, #818cf8 0%, #a5b4fc 35%, #22d3ee 70%, #818cf8 100%);
    background-size: 220% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: text-shimmer 7s linear infinite;
}

@keyframes text-shimmer {
    0%   { background-position: 0% center; }
    100% { background-position: 220% center; }
}

/* Footer glass top edge */
.site-footer {
    background: linear-gradient(180deg, rgba(10,18,48,0.55), rgba(8,12,26,0.75));
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid rgba(129,140,248,0.18);
    box-shadow: 0 -12px 40px rgba(2,6,23,0.5);
}

/* Modern scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: rgba(10,14,30,0.4); }
::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(99,102,241,0.6), rgba(34,211,238,0.5));
    border-radius: 6px;
    border: 2px solid rgba(6,11,24,0.6);
}
::-webkit-scrollbar-thumb:hover { background: linear-gradient(180deg, #6366f1, #22d3ee); }

::selection {
    background: rgba(99,102,241,0.4);
    color: #fff;
}

/* ----------------------------------------------------------
   11) MOTION SAFETY — respect reduced-motion
   ---------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    body::before, body::after { animation: none; }
    .gradient-text { animation: none; }
    .btn-primary::after, .btn-next::after { animation: none; }
    .stock-ticker-content { animation: none; }
    .featured-card, .highlight-card, .news-card { transition: box-shadow 0.2s ease; }
}

/* ----------------------------------------------------------
   12) MOBILE TUNING
   ---------------------------------------------------------- */
@media (max-width: 720px) {
    .featured-card { padding: 20px 18px; }
    .breaking-slide { font-size: 12px; }
    body::before { width: 90vw; height: 90vw; }
    body::after { width: 80vw; height: 80vw; }
    .hero { padding: 56px 0 72px; }
}
