/* =========================================================
   Medscope Visuals — Custom CSS
   (Tailwind handles the heavy lifting, this file adds
    any custom keyframes, utilities, or overrides)
   ========================================================= */

/* ── Smooth Scrolling ─────────────────────────────────── */
html { scroll-behavior: smooth; }

/* ── Custom Scrollbar ─────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #f1f5f9; }
::-webkit-scrollbar-thumb { background: #00b4d8; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #0a66c2; }

/* ── Gradient Text Utility ────────────────────────────── */
.gradient-text {
    background: linear-gradient(135deg, #0a66c2, #00b4d8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ── Blue Gradient Background Utility ─────────────────── */
.gradient-bg {
    background: linear-gradient(135deg, #0a66c2 0%, #00b4d8 100%);
}

/* ── Scroll Reveal Animation ──────────────────────────── */
.reveal {
    opacity: 1;
    transform: none;
}
.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ── Hero ECG Pulse Line ──────────────────────────────── */
.ecg-path {
    stroke-dasharray: 600;
    stroke-dashoffset: 600;
    animation: ecgDraw 3s ease-in-out infinite;
}
@keyframes ecgDraw {
    0%   { stroke-dashoffset: 600; opacity: 0.2; }
    50%  { stroke-dashoffset: 0;   opacity: 0.7; }
    100% { stroke-dashoffset: -600; opacity: 0.2; }
}

/* ── Floating Animation ───────────────────────────────── */
@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50%       { transform: translateY(-12px); }
}
.animate-float { animation: float 5s ease-in-out infinite; }

/* ── Glass Card ───────────────────────────────────────── */
.glass-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.9);
}

/* ── Video Card Hover ─────────────────────────────────── */
.video-card { transition: transform 0.3s ease, box-shadow 0.3s ease; }
.video-card:hover { transform: translateY(-4px); }

/* ── Category Card ────────────────────────────────────── */
.category-card { transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease; }
.category-card:hover { transform: translateY(-4px); }

/* ── Line Clamp Utility (for video titles) ────────────── */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ── Stat Counter Number ──────────────────────────────── */
.stat-number { font-variant-numeric: tabular-nums; }

/* ── Focus Outline (Accessibility) ───────────────────── */
:focus-visible {
    outline: 2px solid #0a66c2;
    outline-offset: 3px;
    border-radius: 4px;
}

/* ── Mobile Menu Transition ───────────────────────────── */
#mobile-menu {
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease;
    max-height: 0;
    opacity: 0;
}
#mobile-menu.open {
    max-height: 400px;
    opacity: 1;
}
#menu-icon-open.hidden,
#menu-icon-close.hidden {
    display: none !important;
}

/* ── Sticky Header Shadow on Scroll ──────────────────── */
#site-header.scrolled {
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.08);
}

/* ── Hero Section ─────────────────────────────────────── */
.hero-section { min-height: calc(100vh - 80px); }

.hero-bg-light {
    background:
        linear-gradient(180deg, rgba(248, 250, 252, 0.8), rgba(255, 255, 255, 1) 62%),
        radial-gradient(circle at top right, rgba(14, 165, 233, 0.05), transparent 42%),
        radial-gradient(circle at bottom left, rgba(59, 130, 246, 0.05), transparent 42%),
        #ffffff;
}

.floating-badge {
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.04);
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

.ring-gradient {
    background: linear-gradient(135deg, #0a66c2 0%, #0ea5e9 100%);
    -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 35px), #fff calc(100% - 34px));
    mask: radial-gradient(farthest-side, transparent calc(100% - 35px), #fff calc(100% - 34px));
}

@keyframes float-slow {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

@keyframes float-medium {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

@keyframes float-fast {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-25px); }
}

/* ── Active Nav Dot ───────────────────────────────────── */
nav a[aria-current="page"] { position: relative; }

.shorts-rail {
    scrollbar-width: thin;
    scrollbar-color: #fecaca transparent;
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
