/* ═══════════════════════════════════════════════════════════
   ULTRACANALES — Canales Page — Premium TV Design
   ═══════════════════════════════════════════════════════════ */

:root {
    --bg:         #07070b;
    --bg-2:       #0c0c12;
    --surface:    #111118;
    --surface-2:  #16161f;
    --surface-3:  #1d1d28;
    --border:     rgba(255,255,255,0.07);
    --border-lit: rgba(255,255,255,0.14);
    --orange:     #ff8c00;
    --orange-dk:  #d97300;
    --orange-lt:  #ffaa33;
    --orange-glow:rgba(255,140,0,0.2);
    --live:       #ff1744;
    --live-glow:  rgba(255,23,68,0.35);
    --text:       #f0f0f2;
    --text-2:     #9090a0;
    --text-3:     #50505e;
    --r-sm:  8px;
    --r:    12px;
    --r-lg: 18px;
    --r-xl: 28px;
    --header-h: 62px;
}

*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }
html { scroll-behavior:smooth; }

body {
    font-family:'Inter',-apple-system,BlinkMacSystemFont,sans-serif;
    background:var(--bg);
    color:var(--text);
    overflow-x:hidden;
    min-height:100vh;
    -webkit-font-smoothing:antialiased;
}

/* ── HEADER ───────────────────────────────────────────── */
.header {
    height:var(--header-h);
    background:rgba(7,7,11,0.92);
    backdrop-filter:blur(20px) saturate(160%);
    -webkit-backdrop-filter:blur(20px) saturate(160%);
    border-bottom:1px solid var(--border);
    position:sticky;
    top:0;
    z-index:500;
}

.header-container {
    max-width:1600px;
    margin:0 auto;
    display:flex;
    align-items:center;
    height:100%;
    padding:0 2rem;
    gap:2rem;
}

.header-left {
    display:flex;
    align-items:center;
    gap:2.5rem;
    flex-shrink:0;
}

.logo-link {
    display:flex;
    align-items:center;
    gap:0.65rem;
    text-decoration:none;
    transition:transform .3s;
}

.logo-link:hover { transform:scale(1.04); }

.logo {
    height:38px;
    filter:drop-shadow(0 0 10px rgba(255,140,0,.35));
    transition:filter .3s;
}

.logo-link:hover .logo {
    filter:drop-shadow(0 0 22px rgba(255,140,0,.7));
}

.logo-text {
    font-family:'Space Grotesk',sans-serif;
    font-size:1.1rem;
    font-weight:800;
    letter-spacing:0.5px;
    background:linear-gradient(135deg,var(--orange),var(--orange-lt));
    -webkit-background-clip:text;
    -webkit-text-fill-color:transparent;
    background-clip:text;
}

/* Nav tabs */
.nav-tabs {
    display:flex;
    gap:0;
}

.nav-tab {
    background:transparent;
    border:none;
    color:var(--text-2);
    padding:0.65rem 1.05rem;
    font-weight:600;
    font-size:0.82rem;
    font-family:inherit;
    cursor:pointer;
    letter-spacing:0.3px;
    position:relative;
    transition:color .25s;
    white-space:nowrap;
}

.nav-tab::after {
    content:'';
    position:absolute;
    bottom:0;left:50%;right:50%;
    height:2px;
    background:var(--orange);
    border-radius:1px 1px 0 0;
    transition:all .3s cubic-bezier(.4,0,.2,1);
}

.nav-tab:hover { color:var(--text); }
.nav-tab:hover::after,
.nav-tab.active::after { left:0;right:0; }
.nav-tab.active { color:var(--orange);font-weight:700; }

/* Right */
.header-right {
    display:flex;
    align-items:center;
    gap:1.25rem;
    flex:0 1 auto;
}

.search-container {
    display:flex;
    align-items:center;
    background:var(--surface-2);
    border-radius:var(--r-xl);
    overflow:hidden;
    border:1px solid var(--border);
    transition:all .3s;
}

.search-container:focus-within {
    border-color:var(--orange);
    box-shadow:0 0 0 3px var(--orange-glow);
    background:var(--surface-3);
}

.search-svg {
    width:15px;height:15px;
    margin-left:1rem;
    flex-shrink:0;
    color:var(--text-3);
    transition:color .2s;
}

.search-container:focus-within .search-svg { color:var(--orange); }

.search-input {
    background:transparent;
    border:none;
    color:var(--text);
    padding:0.72rem 1rem 0.72rem 0.6rem;
    outline:none;
    font-size:0.88rem;
    font-family:inherit;
    min-width:180px;
}

.search-input::placeholder { color:var(--text-3); }

.login-btn {
    background:linear-gradient(135deg,var(--orange),var(--orange-dk));
    border:none;
    color:#fff;
    padding:0.68rem 1.4rem;
    border-radius:var(--r-xl);
    cursor:pointer;
    font-weight:700;
    font-size:0.87rem;
    font-family:inherit;
    transition:all .3s;
    box-shadow:0 4px 16px rgba(255,140,0,.22);
    white-space:nowrap;
}

.login-btn:hover {
    transform:translateY(-2px);
    box-shadow:0 10px 28px rgba(255,140,0,.4);
}

/* ── HERO — CINEMATIC ─────────────────────────────────── */
.hero-section {
    position:relative;
    min-height:min(90vh,700px);
    display:flex;
    align-items:center;
    justify-content:center;
    overflow:hidden;
    background:var(--bg);
}

/* Animated grid background */
.hero-bg-grid {
    position:absolute;
    inset:0;
    background-image:
        linear-gradient(rgba(255,140,0,0.04) 1px,transparent 1px),
        linear-gradient(90deg,rgba(255,140,0,0.04) 1px,transparent 1px);
    background-size:60px 60px;
    mask-image:radial-gradient(ellipse 80% 80% at 50% 50%,#000 20%,transparent 80%);
    -webkit-mask-image:radial-gradient(ellipse 80% 80% at 50% 50%,#000 20%,transparent 80%);
    animation:gridShift 20s linear infinite;
}

@keyframes gridShift {
    from { transform:translateY(0); }
    to   { transform:translateY(60px); }
}

/* Glow orbs */
.hero-orb {
    position:absolute;
    border-radius:50%;
    filter:blur(90px);
    pointer-events:none;
}

.hero-orb-1 {
    width:600px;height:600px;
    background:radial-gradient(circle,rgba(255,140,0,0.12) 0%,transparent 70%);
    top:-150px;left:-100px;
    animation:orbFloat 12s ease-in-out infinite;
}

.hero-orb-2 {
    width:500px;height:500px;
    background:radial-gradient(circle,rgba(255,23,68,0.08) 0%,transparent 70%);
    bottom:-100px;right:-80px;
    animation:orbFloat 14s ease-in-out infinite reverse;
}

@keyframes orbFloat {
    0%,100% { transform:translate(0,0) scale(1); }
    33%     { transform:translate(30px,-20px) scale(1.05); }
    66%     { transform:translate(-20px,30px) scale(0.97); }
}

.hero-inner {
    position:relative;
    z-index:1;
    text-align:center;
    padding:2rem;
    max-width:900px;
    animation:heroIn .8s cubic-bezier(.4,0,.2,1) both;
}

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

.hero-eyebrow {
    display:inline-flex;
    align-items:center;
    gap:8px;
    background:rgba(255,140,0,.1);
    border:1px solid rgba(255,140,0,.3);
    color:var(--orange-lt);
    font-size:0.7rem;
    font-weight:800;
    letter-spacing:2px;
    text-transform:uppercase;
    padding:0.42rem 1rem;
    border-radius:var(--r-xl);
    margin-bottom:2rem;
}

.eyebrow-dot {
    width:6px;height:6px;
    background:var(--orange);
    border-radius:50%;
    box-shadow:0 0 8px var(--orange);
    animation:blink 1.8s ease-in-out infinite;
}

@keyframes blink {
    0%,100%{opacity:1}
    50%{opacity:0.2}
}

.hero-title {
    font-family:'Space Grotesk',sans-serif;
    font-size:clamp(3rem,9vw,7rem);
    font-weight:800;
    line-height:.95;
    letter-spacing:-3px;
    color:#fff;
    margin-bottom:1.5rem;
}

.hero-title-accent {
    background:linear-gradient(135deg,var(--orange) 0%,var(--orange-lt) 50%,#fff4e0 100%);
    -webkit-background-clip:text;
    -webkit-text-fill-color:transparent;
    background-clip:text;
    display:inline-block;
}

.hero-desc {
    font-size:1.1rem;
    color:var(--text-2);
    font-weight:400;
    line-height:1.6;
    max-width:520px;
    margin:0 auto 2.5rem;
}

/* Stats row */
.hero-stats {
    display:inline-flex;
    align-items:center;
    background:rgba(255,255,255,.04);
    border:1px solid var(--border-lit);
    border-radius:var(--r-xl);
    padding:1rem 2rem;
    gap:2rem;
    backdrop-filter:blur(10px);
}

.hero-stat {
    display:flex;
    flex-direction:column;
    align-items:center;
    gap:4px;
}

.stat-num {
    font-family:'Space Grotesk',sans-serif;
    font-size:1.6rem;
    font-weight:800;
    color:#fff;
    line-height:1;
    letter-spacing:-0.5px;
}

.stat-num.live-stat {
    background:linear-gradient(135deg,var(--live),#ff6b8a);
    -webkit-background-clip:text;
    -webkit-text-fill-color:transparent;
    background-clip:text;
    font-size:1rem;
}

.stat-lbl {
    font-size:0.72rem;
    color:var(--text-3);
    font-weight:600;
    text-transform:uppercase;
    letter-spacing:0.8px;
}

.stat-divider {
    width:1px;
    height:40px;
    background:var(--border-lit);
}

/* Scroll hint */
.hero-scroll-hint {
    position:absolute;
    bottom:2rem;
    left:50%;
    transform:translateX(-50%);
    z-index:1;
}

.scroll-line {
    width:1px;
    height:50px;
    background:linear-gradient(180deg,var(--orange),transparent);
    margin:0 auto;
    animation:scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
    0%,100%{opacity:1;transform:scaleY(1);}
    50%{opacity:.4;transform:scaleY(.6);}
}

/* ── CATEGORY BAR ─────────────────────────────────────── */
.categories-section {
    background:rgba(7,7,11,.95);
    backdrop-filter:blur(20px);
    border-bottom:1px solid var(--border);
    position:sticky;
    top:var(--header-h);
    z-index:200;
}

.categories-container {
    max-width:1600px;
    margin:0 auto;
    display:flex;
    gap:0.4rem;
    padding:0.85rem 2rem;
    overflow-x:auto;
    scrollbar-width:none;
}

.categories-container::-webkit-scrollbar { display:none; }

.category-btn {
    display:inline-flex;
    align-items:center;
    gap:0.45rem;
    background:transparent;
    border:1px solid var(--border);
    color:var(--text-2);
    font-size:0.82rem;
    font-weight:600;
    font-family:inherit;
    padding:0.52rem 1.1rem;
    border-radius:var(--r-xl);
    cursor:pointer;
    white-space:nowrap;
    transition:all .25s cubic-bezier(.4,0,.2,1);
    flex-shrink:0;
}

.cat-icon { font-size:.9rem; }

.category-btn:hover {
    border-color:rgba(255,140,0,.4);
    color:var(--orange-lt);
    background:rgba(255,140,0,.07);
    transform:translateY(-2px);
}

.category-btn.active {
    background:var(--orange);
    border-color:var(--orange);
    color:#fff;
    font-weight:700;
    box-shadow:0 4px 18px rgba(255,140,0,.35);
}

/* ── PLAYER SECTION ───────────────────────────────────── */
.player-section {
    background:var(--bg-2);
    border-bottom:2px solid var(--orange);
    padding:2rem;
}

.player-section.hidden { display:none; }

.player-container {
    max-width:1100px;
    margin:0 auto;
    position:relative;
    animation:heroIn .4s cubic-bezier(.4,0,.2,1) both;
}

.close-player {
    position:absolute;
    top:-2.5rem;right:0;
    background:var(--live);
    border:none;
    color:#fff;
    width:40px;height:40px;
    border-radius:50%;
    cursor:pointer;
    display:flex;
    align-items:center;
    justify-content:center;
    transition:all .3s;
    z-index:10;
    box-shadow:0 4px 18px var(--live-glow);
}

.close-player svg { width:16px;height:16px; }
.close-player:hover { transform:scale(1.15) rotate(90deg); }

.player-wrapper {
    position:relative;
    padding-bottom:56.25%;
    height:0;
    border-radius:var(--r-lg);
    overflow:hidden;
    margin-bottom:1.25rem;
    box-shadow:0 24px 72px rgba(0,0,0,.7),0 0 0 1px rgba(255,140,0,.25);
}

.player-wrapper iframe {
    position:absolute;
    inset:0;
    width:100%;height:100%;
}

.player-info {
    background:var(--surface);
    padding:1.25rem 1.5rem;
    border-radius:var(--r-lg);
    border:1px solid var(--border);
}

.player-header {
    display:flex;
    align-items:center;
    justify-content:space-between;
    margin-bottom:1rem;
    gap:1rem;
    flex-wrap:wrap;
}

.player-channel-info { display:flex;flex-direction:column;gap:.35rem; }

.player-header h2 {
    font-family:'Space Grotesk',sans-serif;
    font-size:1.5rem;
    font-weight:800;
    letter-spacing:-.3px;
}

.channel-badge {
    display:inline-flex;
    align-items:center;
    gap:6px;
    background:rgba(255,23,68,.12);
    border:1px solid rgba(255,23,68,.35);
    color:#ff6b8a;
    font-size:0.68rem;
    font-weight:800;
    letter-spacing:1.2px;
    padding:0.28rem 0.75rem;
    border-radius:var(--r-xl);
    width:fit-content;
}

.cb-dot {
    width:5px;height:5px;
    background:var(--live);
    border-radius:50%;
    box-shadow:0 0 6px var(--live);
    animation:blink 1.2s ease-in-out infinite;
}

.player-actions {
    display:flex;
    gap:0.6rem;
    flex-wrap:wrap;
}

.action-btn {
    display:flex;
    align-items:center;
    gap:0.4rem;
    background:var(--surface-2);
    border:1px solid var(--border);
    color:var(--text-2);
    font-size:0.83rem;
    font-weight:600;
    font-family:inherit;
    padding:0.6rem 1.2rem;
    border-radius:var(--r-xl);
    cursor:pointer;
    transition:all .25s;
}

.action-btn svg { width:14px;height:14px;flex-shrink:0; }

.action-btn:hover {
    background:var(--orange);
    border-color:var(--orange);
    color:#fff;
    transform:translateY(-2px);
}

.source-buttons {
    display:flex;
    gap:0.5rem;
    flex-wrap:wrap;
    padding-top:1rem;
    border-top:1px solid var(--border);
}

.source-btn {
    background:var(--surface-2);
    border:1px solid var(--border);
    color:var(--text-2);
    font-size:0.82rem;
    font-weight:600;
    font-family:inherit;
    padding:0.58rem 1.2rem;
    border-radius:var(--r-xl);
    cursor:pointer;
    transition:all .25s;
}

.source-btn:hover { border-color:var(--orange);color:var(--orange); }

.source-btn.active {
    background:var(--orange);
    border-color:var(--orange);
    color:#fff;
    box-shadow:0 4px 16px rgba(255,140,0,.4);
}

/* ── MAIN / GRID ──────────────────────────────────────── */
.main-content {
    max-width:1600px;
    margin:0 auto;
    padding:3rem 2rem;
}

.grid-header { margin-bottom:2rem; }

.grid-title-row {
    display:flex;
    align-items:center;
    gap:1rem;
    flex-wrap:wrap;
}

.section-title {
    font-family:'Space Grotesk',sans-serif;
    font-size:1.75rem;
    font-weight:800;
    letter-spacing:-.5px;
}

.grid-count-badge {
    background:rgba(255,140,0,.12);
    border:1px solid rgba(255,140,0,.3);
    color:var(--orange-lt);
    font-size:0.77rem;
    font-weight:700;
    padding:0.32rem 0.85rem;
    border-radius:var(--r-xl);
}

/* ── CHANNEL CARDS ────────────────────────────────────── */
.channels-grid {
    display:grid;
    grid-template-columns:repeat(auto-fill,minmax(185px,1fr));
    gap:1rem;
    margin-bottom:4rem;
}

.channel-card {
    background:var(--surface);
    border:1px solid var(--border);
    border-radius:var(--r-lg);
    overflow:hidden;
    cursor:pointer;
    transition:all .3s cubic-bezier(.4,0,.2,1);
    position:relative;
    display:flex;
    flex-direction:column;
    animation:cardPop .4s cubic-bezier(.4,0,.2,1) both;
}

@keyframes cardPop {
    from { opacity:0;transform:translateY(10px) scale(.97); }
    to   { opacity:1;transform:translateY(0) scale(1); }
}

.channel-card::before {
    content:'';
    position:absolute;
    inset:0;
    border-radius:var(--r-lg);
    background:linear-gradient(135deg,rgba(255,140,0,.07),transparent 60%);
    opacity:0;
    transition:opacity .3s;
    pointer-events:none;
}

.channel-card:hover {
    transform:translateY(-10px);
    border-color:rgba(255,140,0,.4);
    background:var(--surface-2);
    box-shadow:
        0 24px 60px rgba(0,0,0,.55),
        0 0 0 1px rgba(255,140,0,.2),
        0 8px 32px rgba(255,140,0,.08);
}

.channel-card:hover::before { opacity:1; }

/* Image area */
.channel-card-image {
    width:100%;
    aspect-ratio:16/9;
    background:linear-gradient(135deg,var(--surface-2),var(--surface-3));
    display:flex;
    align-items:center;
    justify-content:center;
    position:relative;
    overflow:hidden;
}

/* Overlay on hover */
.channel-card-image::after {
    content:'';
    position:absolute;
    inset:0;
    background:rgba(0,0,0,.6);
    backdrop-filter:blur(3px);
    display:flex;
    align-items:center;
    justify-content:center;
    opacity:0;
    transition:opacity .25s;
}

.channel-card:hover .channel-card-image::after { opacity:1; }

/* Play icon */
.channel-card-image::before {
    content:'▶';
    position:absolute;
    z-index:1;
    font-size:1.8rem;
    color:#fff;
    opacity:0;
    transform:scale(.7);
    transition:all .28s cubic-bezier(.4,0,.2,1);
}

.channel-card:hover .channel-card-image::before {
    opacity:1;
    transform:scale(1);
}

.channel-card-image img {
    max-width:70%;
    max-height:70%;
    object-fit:contain;
    z-index:0;
    transition:transform .35s,filter .35s;
    filter:brightness(.9);
}

.channel-card:hover .channel-card-image img {
    transform:scale(1.08);
    filter:brightness(.4);
}

/* Card content */
.channel-card-content {
    padding:1rem;
    flex:1;
    display:flex;
    flex-direction:column;
    gap:0.4rem;
}

.channel-card-name {
    font-family:'Space Grotesk',sans-serif;
    font-size:0.93rem;
    font-weight:700;
    line-height:1.3;
    color:var(--text);
}

.channel-card-category {
    font-size:0.72rem;
    color:var(--text-3);
    font-weight:600;
    text-transform:uppercase;
    letter-spacing:.5px;
}

.channel-card-footer {
    display:flex;
    align-items:center;
    justify-content:space-between;
    margin-top:auto;
    padding-top:.5rem;
}

.channel-card-badge {
    display:inline-flex;
    align-items:center;
    gap:4px;
    background:var(--live);
    color:#fff;
    font-size:0.62rem;
    font-weight:800;
    letter-spacing:.8px;
    padding:.2rem .55rem;
    border-radius:4px;
    box-shadow:0 2px 10px var(--live-glow);
}

.channel-card-badge::before {
    content:'';
    width:4px;height:4px;
    background:#fff;
    border-radius:50%;
    animation:blink 1.2s ease-in-out infinite;
}

.channel-sources {
    font-size:0.7rem;
    color:var(--text-3);
    font-weight:600;
}

/* ── FOOTER ───────────────────────────────────────────── */
.footer {
    background:var(--surface);
    border-top:1px solid var(--border);
    padding:2.5rem 2rem;
}

.footer-content {
    max-width:1600px;
    margin:0 auto;
    display:flex;
    align-items:center;
    justify-content:center;
    flex-direction:column;
    gap:1rem;
    text-align:center;
}

.footer-logo { height:30px;opacity:.45; }

.footer-copy { color:var(--text-3);font-size:.82rem; }

.footer-links {
    display:flex;
    align-items:center;
    gap:0.75rem;
    font-size:.82rem;
    color:var(--text-3);
}

.footer-links a {
    color:var(--text-2);
    text-decoration:none;
    transition:color .2s;
}

.footer-links a:hover { color:var(--orange); }

/* Share notification */
.share-notification {
    position:fixed;
    bottom:2rem;left:50%;
    transform:translateX(-50%) translateY(20px);
    background:var(--surface-3);
    border:1px solid rgba(255,140,0,.4);
    color:var(--text);
    padding:.85rem 1.75rem;
    border-radius:var(--r-xl);
    font-size:.9rem;
    font-weight:600;
    z-index:9999;
    opacity:0;
    transition:all .3s cubic-bezier(.4,0,.2,1);
    box-shadow:0 16px 48px rgba(0,0,0,.6);
    white-space:nowrap;
}

.share-notification.show {
    opacity:1;
    transform:translateX(-50%) translateY(0);
}

/* ── SCROLLBAR ────────────────────────────────────────── */
::-webkit-scrollbar { width:5px;height:5px; }
::-webkit-scrollbar-track { background:var(--bg); }
::-webkit-scrollbar-thumb { background:var(--surface-3);border-radius:3px; }
::-webkit-scrollbar-thumb:hover { background:var(--orange); }

/* ── RESPONSIVE ───────────────────────────────────────── */
@media (max-width:1200px) {
    .header-container { gap:1.25rem; }
    .nav-tabs { display:none; }
}

@media (max-width:768px) {
    :root { --header-h:56px; }

    .header-container { padding:.75rem 1.1rem;gap:.75rem;flex-wrap:wrap; }
    .header-left { order:1;gap:.75rem; }
    .header-right { order:3;flex:1 1 100%;gap:.65rem; }
    .search-container { flex:1; }
    .search-input { min-width:auto;padding:.65rem .9rem .65rem .5rem; }

    .logo { height:34px; }
    .logo-text { font-size:.95rem; }
    .login-btn { padding:.62rem 1.1rem;font-size:.82rem; }

    .categories-section { top:var(--header-h); }
    .categories-container { padding:.7rem 1.1rem; }
    .category-btn { padding:.48rem 1rem; font-size:.78rem; }

    .hero-section { min-height:60vh; }
    .hero-title { font-size:clamp(2.2rem,9vw,4rem);letter-spacing:-1.5px; }
    .hero-stats { gap:1.25rem;padding:.8rem 1.25rem; }
    .stat-num { font-size:1.2rem; }

    .player-section { padding:1.25rem; }

    .main-content { padding:2rem 1.1rem; }
    .channels-grid { grid-template-columns:repeat(auto-fill,minmax(145px,1fr));gap:.8rem; }

    .section-title { font-size:1.4rem; }
    .player-header { flex-direction:column;align-items:flex-start; }
}

@media (max-width:480px) {
    .logo-text { display:none; }
    .logo { height:32px; }
    .hero-title { font-size:clamp(1.8rem,9vw,3rem);letter-spacing:-1px; }
    .hero-stats { flex-direction:column;gap:.75rem;width:100%; }
    .stat-divider { width:60px;height:1px; }
    .channels-grid { grid-template-columns:repeat(2,1fr);gap:.65rem; }
    .channel-card-content { padding:.75rem; }
    .channel-card-name { font-size:.83rem; }
}

@media (min-width:1920px) {
    .main-content { padding:4rem 3rem; }
    .channels-grid { grid-template-columns:repeat(auto-fill,minmax(210px,1fr));gap:1.25rem; }
}

@media (prefers-reduced-motion:reduce) {
    *,*::before,*::after {
        animation-duration:.01ms !important;
        transition-duration:.01ms !important;
    }
}
