/* ═══════════════════════════════════════════
   E-LEARNING UDD — style.css
═══════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Ubuntu:ital,wght@0,300;0,400;0,500;0,700;1,400&display=swap');

:root {
    --blue-primary: #0065A3;
    --blue-dark:    #004e80;
    --blue-light:   #e0eef8;
    --blue-mid:     #3a8ec4;
    --accent:       #00a8e8;
    --gray-bg:      #eef3f9;
    --card-shadow:  0 2px 14px rgba(0,101,163,0.09);
    --topbar-h:     68px;
    --radius:       0.9rem;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    font-family: 'Ubuntu', sans-serif;
    background: var(--gray-bg);
    color: #2d3748;
    line-height: 1.2;
    margin: 0; padding: 0;
    min-height: 100vh;
    font-size: 16px;
}

a { color: var(--blue-primary); text-decoration: none; }
a:hover { text-decoration: underline; }
strong { color: #1e3a5f; }

/* ── TOPBAR ── */
.topbar {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    height: var(--topbar-h);
    background: linear-gradient(160deg, var(--blue-dark) 0%, var(--blue-primary) 60%, var(--blue-mid) 100%);
    border-bottom: 3px solid var(--accent);
    padding: 0 2rem;
    display: flex; align-items: center; justify-content: space-between;
    box-shadow: 0 4px 20px rgba(0,50,110,0.22);
}
.topbar-brand h1 { font-size: 1.08rem; font-weight: 700; color: #fff; margin: 0; letter-spacing: -0.01em; line-height: 1.2; }
.topbar-brand .sub { font-size: 0.75rem; color: rgba(255,255,255,0.65); margin-top: 0.15rem; }
.topbar-logo { height: 2.8rem; filter: brightness(0) invert(1); }
.topbar-back {
    display: inline-flex; align-items: center; gap: 0.5rem;
    color: rgba(255,255,255,0.8); font-size: 0.85rem; font-weight: 500;
    background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2);
    padding: 0.35rem 0.9rem; border-radius: 999px; transition: background 0.15s;
}
.topbar-back:hover { background: rgba(255,255,255,0.2); text-decoration: none; color: #fff; }

/* ── WRAPS ── */
.page-wrap {
    padding-top: calc(var(--topbar-h) + 2.5rem);
    padding-bottom: 4rem;
    max-width: 1100px;
    margin: 0 auto;
    padding-left: 1.75rem;
    padding-right: 1.75rem;
}
.watch-wrap {
    padding-top: calc(var(--topbar-h) + 1.75rem);
    padding-bottom: 4rem;
    max-width: 1100px;
    margin: 0 auto;
    padding-left: 1.75rem;
    padding-right: 1.75rem;
}

/* ── HERO ── */
.hero { position: relative; border-radius: var(--radius); overflow: hidden; margin-bottom: 2.5rem; box-shadow: 0 12px 48px rgba(0,50,120,0.28); min-height: 42vh; display: flex; align-items: center; }
.hero-bg { position: absolute; inset: 0; background-size: cover; background-position: center; }
.hero-bg::before { content: ''; position: absolute; inset: 0; background: linear-gradient(160deg, rgba(0,30,65,0.93) 0%, rgba(0,78,128,0.82) 50%, rgba(0,140,210,0.65) 100%); }
.hero-bg::after { content: ''; position: absolute; inset: 0; background-image: radial-gradient(circle, rgba(255,255,255,0.05) 1px, transparent 1px); background-size: 28px 28px; }
.hero::after { content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 5px; background: linear-gradient(to right, var(--accent), #7dd4fc, var(--accent)); }
.hero-content { position: relative; z-index: 1; padding: 3rem 3.5rem; width: 100%; }
.hero-badge { display: inline-flex; align-items: center; gap: 0.45rem; background: rgba(0,168,232,0.22); border: 1px solid rgba(0,168,232,0.45); color: #7dd4fc; font-size: 0.75rem; font-weight: 700; padding: 0.28rem 0.9rem; border-radius: 999px; letter-spacing: 0.07em; text-transform: uppercase; margin-bottom: 1rem; backdrop-filter: blur(4px); }
.hero h2 { font-size: 2.4rem; font-weight: 700; color: #fff; margin: 0 0 0.85rem; line-height: 1.15; letter-spacing: -0.03em; }
.hero h2::after { content: ''; display: block; width: 4rem; height: 3px; background: linear-gradient(to right, var(--accent), transparent); border-radius: 2px; margin-top: 0.8rem; }
.hero p { font-size: 1rem; color: rgba(255,255,255,0.72); margin: 0; max-width: 540px; line-height: 1.65; }

/* ── SECTION HEADING ── */
.section-heading { font-size: 1rem; font-weight: 700; color: #94a3b8; text-transform: uppercase; letter-spacing: 0.09em; margin: 0 0 1.25rem; display: flex; align-items: center; gap: 0.75rem; }
.section-heading::after { content: ''; flex: 1; height: 1px; background: #dde8f0; }

/* ── GRID CARDS ── */
.segments-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1.25rem; }

/* ── SEG CARD ── */
.seg-card { background: #fff; border: 1px solid #ddeaf5; border-radius: var(--radius); box-shadow: var(--card-shadow); overflow: hidden; display: flex; flex-direction: column; transition: box-shadow 0.2s, transform 0.2s; text-decoration: none; color: inherit; }
.seg-card:hover { box-shadow: 0 8px 32px rgba(0,101,163,0.18); transform: translateY(-3px); text-decoration: none; }
.seg-card-stripe { height: 4px; background: linear-gradient(to right, var(--blue-primary), var(--accent)); }
.seg-card-thumb { position: relative; padding-bottom: 56.25%; background: #0a1628; overflow: hidden; }
.seg-card-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0.85; }
.seg-card-thumb-overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(0,30,65,0.35); transition: background 0.2s; }
.seg-card:hover .seg-card-thumb-overlay { background: rgba(0,30,65,0.15); }
.seg-card-play { width: 3.2rem; height: 3.2rem; border-radius: 50%; background: rgba(0,168,232,0.9); display: flex; align-items: center; justify-content: center; font-size: 1.1rem; color: #fff; box-shadow: 0 4px 20px rgba(0,168,232,0.5); transition: transform 0.2s, background 0.2s; }
.seg-card:hover .seg-card-play { transform: scale(1.1); background: var(--accent); }
.seg-card-time { position: absolute; bottom: 0.6rem; right: 0.7rem; background: rgba(0,0,0,0.75); color: #fff; font-size: 0.72rem; font-weight: 700; padding: 0.18rem 0.5rem; border-radius: 0.3rem; }
.seg-card-num { position: absolute; top: 0.6rem; left: 0.7rem; background: var(--blue-primary); color: #fff; font-size: 0.72rem; font-weight: 700; padding: 0.18rem 0.55rem; border-radius: 0.35rem; }
.seg-card-body { padding: 1.1rem 1.25rem; flex: 1; display: flex; flex-direction: column; gap: 0.4rem; }
.seg-card-title { font-size: 1rem; font-weight: 700; color: #1e3a5f; margin: 0; line-height: 1.3; }
.seg-card-desc { font-size: 0.87rem; color: #64748b; margin: 0; line-height: 1.6; flex: 1; }
.seg-card-footer { padding: 0.75rem 1.25rem; border-top: 1px solid #edf3fa; display: flex; align-items: center; justify-content: space-between; }
.seg-card-cta { font-size: 0.82rem; font-weight: 700; color: var(--blue-primary); display: flex; align-items: center; gap: 0.4rem; }

/* ── INFO BOX ── */
.info-box { background: linear-gradient(135deg, #e8f4fd, #f0f8ff); border-left: 4px solid var(--accent); padding: 1rem 1.3rem; border-radius: 0 0.65rem 0.65rem 0; border: 1px solid #c8e4f5; border-left-width: 4px; margin-bottom: 1.25rem; }
.info-box p { font-size: 0.95rem; color: #1e4a70; margin: 0; line-height: 1.68; }

/* ── PASSWORD GATE ── */
.gate-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 2rem; background: linear-gradient(160deg, var(--blue-dark) 0%, var(--blue-primary) 60%, #0a1628 100%); }
.gate-box { background: #fff; border-radius: 1rem; box-shadow: 0 20px 60px rgba(0,0,0,0.3); padding: 2.5rem 2.75rem; width: 100%; max-width: 420px; text-align: center; }
.gate-logo { height: 3rem; margin-bottom: 1.5rem; }
.gate-title { font-size: 1.35rem; font-weight: 700; color: #1e3a5f; margin: 0 0 0.4rem; }
.gate-sub { font-size: 0.9rem; color: #64748b; margin: 0 0 1.75rem; line-height: 1.55; }
.gate-input { width: 100%; padding: 0.8rem 1rem; border: 1.5px solid #c8d8e8; border-radius: 0.6rem; font-family: 'Ubuntu', sans-serif; font-size: 1rem; color: #1e3a5f; outline: none; transition: border-color 0.15s; margin-bottom: 1rem; text-align: center; letter-spacing: 0.1em; }
.gate-input:focus { border-color: var(--blue-primary); }
.gate-btn { width: 100%; padding: 0.85rem; background: linear-gradient(135deg, var(--blue-primary), var(--blue-mid)); color: #fff; font-family: 'Ubuntu', sans-serif; font-size: 1rem; font-weight: 700; border: none; border-radius: 0.6rem; cursor: pointer; transition: filter 0.15s, transform 0.1s; box-shadow: 0 4px 16px rgba(0,101,163,0.3); }
.gate-btn:hover { filter: brightness(1.1); transform: translateY(-1px); }
.gate-error { background: #fef2f2; border: 1px solid #fecaca; border-radius: 0.5rem; color: #b91c1c; font-size: 0.88rem; padding: 0.6rem 0.9rem; margin-bottom: 1rem; }

/* ── WATCH PAGE ── */
.watch-header { margin-bottom: 1.25rem; }
.watch-num-badge { display: inline-flex; align-items: center; gap: 0.4rem; background: var(--blue-light); border: 1px solid #b8d4ea; color: var(--blue-primary); font-size: 0.75rem; font-weight: 700; padding: 0.22rem 0.7rem; border-radius: 999px; margin-bottom: 0.6rem; }
.watch-title { font-size: 1.5rem; font-weight: 700; color: #1e3a5f; margin: 0 0 0.3rem; line-height: 1.25; }
.watch-grid { display: grid; grid-template-columns: 1fr 300px; gap: 1.5rem; align-items: start; }
.watch-player-col { display: flex; flex-direction: column; gap: 1rem; }
.watch-info-col { display: flex; flex-direction: column; gap: 1rem; }

/* ══════════════════════════════════════
   PLAYER — controles superpuestos
   Mismo comportamiento que YouTube
══════════════════════════════════════ */

/* El player-card es el contenedor relativo de todo */
.player-card {
    position: relative;
    background: #000;
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    /* cursor se oculta cuando controles están ocultos */
    cursor: none;
}
.player-card.controls-visible { cursor: default; }

/* iframe 16:9 */
.player-yt-wrap {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    height: 0;
    background: #000;
}
.player-yt-wrap iframe {
    position: absolute; top: 0; left: 0;
    width: 100%; height: 100%;
    border: none;
    pointer-events: none;
}
.player-yt-mask { position: absolute; inset: 0; z-index: 2; }

/* OVERLAY de inicio (thumbnail + botón play grande) */
.player-overlay {
    position: absolute;
    top: 0; left: 0; right: 0;
    padding-bottom: 56.25%;
    height: 0;
    z-index: 20;
    overflow: hidden;
    cursor: pointer;
    transition: opacity 0.3s ease;
}
.player-overlay-thumb {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    object-fit: cover;
}
.player-overlay-gradient {
    position: absolute; inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.1) 50%, rgba(0,0,0,0.35) 100%);
}
.player-overlay-center {
    position: absolute; inset: 0;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 1rem;
}
.player-big-play {
    width: 4.5rem; height: 4.5rem; border-radius: 50%;
    background: rgba(255,255,255,0.18);
    border: 2px solid rgba(255,255,255,0.5);
    color: #fff; font-size: 1.4rem;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; padding-left: 4px;
    transition: background 0.2s, transform 0.2s;
    backdrop-filter: blur(4px);
}
.player-big-play:hover { background: rgba(255,255,255,0.3); transform: scale(1.08); }
.player-overlay-info { display: flex; flex-direction: column; align-items: center; gap: 0.25rem; }
.player-overlay-title { font-size: 1rem; font-weight: 600; color: #fff; text-shadow: 0 2px 8px rgba(0,0,0,0.8); max-width: 360px; text-align: center; line-height: 1.3; }
.player-overlay-duration { font-size: 0.78rem; color: rgba(255,255,255,0.6); display: flex; align-items: center; gap: 0.3rem; }

/* Spinner */
.player-loading { position: absolute; inset: 0; z-index: 25; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,0.7); }
.player-spinner { width: 2.2rem; height: 2.2rem; border-radius: 50%; border: 3px solid rgba(255,255,255,0.1); border-top-color: #fff; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── CONTROLES SUPERPUESTOS ── */
.player-controls {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    z-index: 15;
    padding: 2rem 1rem 0.8rem;
    /* gradiente negro de abajo hacia arriba */
    background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.4) 60%, transparent 100%);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    /* transición de visibilidad */
    opacity: 1;
    transition: opacity 0.3s ease;
}
/* cuando se ocultan */
.player-card.controls-hidden .player-controls {
    opacity: 0;
    pointer-events: none;
}

/* Barra de progreso */
.ctrl-progress-row { display: flex; align-items: center; gap: 0.6rem; }
.ctrl-time {
    font-size: 0.72rem; color: rgba(255,255,255,0.85);
    font-variant-numeric: tabular-nums;
    min-width: 2.5rem;
    font-family: monospace;
    text-shadow: 0 1px 3px rgba(0,0,0,0.8);
}
.ctrl-time.right { text-align: right; }
.ctrl-track {
    flex: 1; height: 4px;
    background: rgba(255,255,255,0.25);
    border-radius: 999px; cursor: pointer;
    position: relative;
    transition: height 0.15s;
}
.ctrl-track:hover { height: 6px; }
.ctrl-fill {
    height: 100%; width: 0%;
    background: #fff;
    border-radius: 999px;
    pointer-events: none;
    transition: width 0.15s linear;
}
.ctrl-thumb {
    position: absolute; top: 50%; left: 0%;
    width: 13px; height: 13px; border-radius: 50%;
    background: #fff; box-shadow: 0 0 4px rgba(0,0,0,0.5);
    transform: translate(-50%, -50%);
    pointer-events: none; opacity: 0;
    transition: opacity 0.15s;
}
.ctrl-track:hover .ctrl-thumb { opacity: 1; }

/* Botones */
.ctrl-btns-row { display: flex; align-items: center; gap: 0.25rem; }
.ctrl-btn {
    background: none; border: none;
    color: rgba(255,255,255,0.9);
    width: 2.2rem; height: 2.2rem;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; font-size: 1rem;
    border-radius: 0.35rem;
    transition: color 0.15s, background 0.15s;
    flex-shrink: 0;
    position: relative;
}
.ctrl-btn:hover { color: #fff; background: rgba(255,255,255,0.12); }
.ctrl-btn-label {
    position: absolute; bottom: 1px; right: 3px;
    font-size: 0.48rem; color: rgba(255,255,255,0.6);
    line-height: 1; pointer-events: none;
}
.ctrl-btn.pp { width: 2.6rem; height: 2.6rem; font-size: 1.15rem; }
.ctrl-vol-group { display: flex; align-items: center; gap: 0.35rem; margin-left: 0.1rem; }
.ctrl-vol-track { width: 60px; height: 3px; background: rgba(255,255,255,0.25); border-radius: 999px; cursor: pointer; }
.ctrl-vol-fill { height: 100%; width: 80%; background: #fff; border-radius: 999px; pointer-events: none; }
.ctrl-btn.btn-fs { margin-left: auto; }

/* ── INFO CARDS ── */
.info-card { background: #fff; border: 1px solid #ddeaf5; border-radius: var(--radius); box-shadow: var(--card-shadow); overflow: hidden; }
.info-card-stripe { height: 4px; background: linear-gradient(to right, var(--blue-primary), var(--accent)); }
.info-card-body { padding: 1.25rem 1.4rem; }
.info-card-label { font-size: 0.68rem; font-weight: 700; color: #94a3b8; text-transform: uppercase; letter-spacing: 0.09em; margin-bottom: 0.65rem; display: flex; align-items: center; gap: 0.4rem; }
.info-card-title { font-size: 1rem; font-weight: 700; color: #1e3a5f; margin: 0 0 0.65rem; }
.info-card-text { font-size: 0.9rem; color: #475569; line-height: 1.7; margin: 0 0 0.85rem; }
.info-tip { background: var(--blue-light); border-left: 3px solid var(--blue-primary); border-radius: 0 0.5rem 0.5rem 0; padding: 0.7rem 0.9rem; font-size: 0.85rem; color: #1e4a70; line-height: 1.6; }

/* ── SEG NAV ── */
.seg-nav { display: flex; flex-direction: column; gap: 0.35rem; }
.seg-nav-item { display: flex; align-items: center; gap: 0.7rem; padding: 0.6rem 0.85rem; border-radius: 0.5rem; font-size: 0.88rem; font-weight: 500; color: #475569; text-decoration: none; border: 1px solid transparent; transition: all 0.15s; }
.seg-nav-item:hover { background: var(--blue-light); color: var(--blue-primary); text-decoration: none; }
.seg-nav-item.active { background: var(--blue-light); color: var(--blue-primary); font-weight: 700; border-color: #b8d4ea; border-left: 3px solid var(--blue-primary); }
.seg-nav-num { flex-shrink: 0; width: 1.6rem; height: 1.6rem; border-radius: 0.35rem; background: var(--blue-primary); color: #fff; font-size: 0.7rem; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.seg-nav-item.active .seg-nav-num { background: var(--blue-dark); }

/* ── WATCH NAV ── */
.watch-nav { display: flex; gap: 0.75rem; justify-content: space-between; }
.watch-nav-btn { display: inline-flex; align-items: center; gap: 0.5rem; background: #fff; border: 1.5px solid #c8d8e8; color: var(--blue-primary); font-family: 'Ubuntu', sans-serif; font-size: 0.88rem; font-weight: 700; padding: 0.6rem 1.1rem; border-radius: 0.55rem; cursor: pointer; transition: all 0.15s; text-decoration: none; box-shadow: var(--card-shadow); }
.watch-nav-btn:hover { background: var(--blue-light); border-color: var(--blue-primary); text-decoration: none; }
.watch-nav-btn.disabled { opacity: 0.4; pointer-events: none; }
.watch-nav-btn.next { background: var(--blue-primary); color: #fff; border-color: var(--blue-primary); }
.watch-nav-btn.next:hover { filter: brightness(1.1); }

/* ── FOOTER ── */
.app-footer { text-align: center; font-size: 0.79rem; color: #94a3b8; margin-top: 2.5rem; padding-top: 1.25rem; border-top: 1px solid #dde8f0; }

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
    .watch-grid { grid-template-columns: 1fr; }
    .watch-info-col { order: -1; }
}
@media (max-width: 640px) {
    .hero-content { padding: 2rem 1.5rem; }
    .hero h2 { font-size: 1.7rem; }
    .page-wrap, .watch-wrap { padding-left: 1rem; padding-right: 1rem; }
    .segments-grid { grid-template-columns: 1fr; }
    .gate-box { padding: 2rem 1.5rem; }
    .ctrl-vol-group { display: none; }
}

