/* ==========================================================================
   MINERA PAICAVÍ S.A. - SMART MEDIA PLAYER & VIDEO PORTAL
   ========================================================================== */

:root {
    --bg-dark: #090d16;
    --bg-card: #111827;
    --bg-card-hover: #1f2937;
    --header-bg: rgba(15, 23, 42, 0.88);
    --gold: #f59e0b;
    --gold-glow: rgba(245, 158, 11, 0.35);
    --blue: #2563eb;
    --blue-light: #38bdf8;
    --green: #10b981;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border-color: rgba(255, 255, 255, 0.08);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* NAVBAR SUPERIOR CORPORATIVA */
.player-navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--header-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-color);
    padding: 14px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
    color: var(--text-primary);
}

.navbar-brand img {
    height: 42px;
    object-fit: contain;
}

.brand-title {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.3px;
    color: #ffffff;
}

.brand-subtitle {
    font-size: 0.72rem;
    color: var(--gold);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.navbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* BOTONES TÁCTILES PRO */
.btn-paicavi {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.88rem;
    text-decoration: none !important;
    border: none;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
}

.btn-gold {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #000000;
    font-weight: 700;
    box-shadow: 0 4px 15px var(--gold-glow);
}

.btn-gold:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.5);
}

.btn-blue {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.35);
}

.btn-blue:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.5);
}

.btn-glass {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-glass:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
}

/* CONTENEDOR PRINCIPAL */
.main-container {
    flex: 1;
    max-width: 1320px;
    width: 100%;
    margin: 0 auto;
    padding: 30px 20px 60px 20px;
}

/* HERO SECTION INDEX */
.hero-portal {
    background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 32px;
    margin-bottom: 35px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
}

.hero-portal::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, var(--gold-glow) 0%, transparent 70%);
    pointer-events: none;
}

.hero-title {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 8px;
    color: #ffffff;
}

.hero-desc {
    color: var(--text-secondary);
    font-size: 0.95rem;
    max-width: 650px;
    line-height: 1.5;
}

/* BUSCADOR DE VIDEOS */
.search-box-wrapper {
    margin-top: 20px;
    position: relative;
    max-width: 450px;
}

.search-box-input {
    width: 100%;
    padding: 12px 16px 12px 44px;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid var(--border-color);
    color: #ffffff;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s;
}

.search-box-input:focus {
    border-color: var(--blue-light);
    box-shadow: 0 0 15px rgba(56, 189, 248, 0.25);
}

.search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

/* GRID DE VIDEOS */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

/* TARJETA DE VIDEO */
.video-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
    position: relative;
}

.video-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
    border-color: rgba(245, 158, 11, 0.4);
    background: var(--bg-card-hover);
}

.video-thumb-container {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #020617;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.video-thumb-container img, .video-thumb-container video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.play-overlay-btn {
    position: absolute;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.85);
    border: 2px solid var(--gold);
    color: var(--gold);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    padding-left: 4px;
    transition: transform 0.2s, background 0.2s;
    backdrop-filter: blur(8px);
}

.video-card:hover .play-overlay-btn {
    transform: scale(1.15);
    background: var(--gold);
    color: #000000;
}

.badge-size {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(15, 23, 42, 0.9);
    color: var(--blue-light);
    font-weight: 700;
    font-size: 0.75rem;
    padding: 4px 8px;
    border-radius: 6px;
    border: 1px solid rgba(56, 189, 248, 0.3);
}

.badge-format {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(245, 158, 11, 0.9);
    color: #000;
    font-weight: 800;
    font-size: 0.7rem;
    padding: 3px 8px;
    border-radius: 6px;
    text-transform: uppercase;
}

.video-card-body {
    padding: 18px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.video-card-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 8px;
    line-height: 1.3;
}

.video-card-meta {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.video-card-actions {
    margin-top: auto;
    display: flex;
    gap: 8px;
}

.video-card-actions .btn-paicavi {
    flex: 1;
    justify-content: center;
    padding: 8px 10px;
    font-size: 0.82rem;
}

/* SMART PLAYER CONTAINER (WATCH VIEW) */
.theater-wrapper {
    background: #000000;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
    border: 1px solid var(--border-color);
    margin-bottom: 25px;
    position: relative;
}

.theater-player {
    width: 100%;
    max-height: 75vh;
    aspect-ratio: 16 / 9;
    background: #000000;
    display: block;
    outline: none;
}

/* BARRA DE DETECCION DE RED Y CALIDAD INTELIGENTE */
.smart-quality-bar {
    background: rgba(15, 23, 42, 0.95);
    padding: 12px 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.83rem;
}

.connection-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
}

.dot-status {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 8px var(--green);
}

.quality-selector-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.quality-select {
    background: #1e293b;
    color: #ffffff;
    border: 1px solid var(--border-color);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    outline: none;
    cursor: pointer;
}

/* HOJA DE METADATOS Y ACCIONES (WATCH VIEW) */
.watch-info-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    padding: 24px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 20px;

}

.watch-title-block h1 {
    font-size: 1.5rem;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 6px;
}

.watch-title-block p {
    color: var(--text-secondary);
    font-size: 0.88rem;
}

.watch-action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

/* NOTIFICACION TOAST */
.toast-notification {
    position: fixed;
    bottom: 25px;
    right: 25px;
    background: #10b981;
    color: #ffffff;
    font-weight: 700;
    padding: 14px 22px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(16, 185, 129, 0.4);
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 9999;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.toast-notification.show {
    opacity: 1;
    transform: translateY(0);
}

/* FOOTER */
.player-footer {
    border-top: 1px solid var(--border-color);
    padding: 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.82rem;
    background: rgba(15, 23, 42, 0.5);
    margin-top: auto;
}

/* RESPONSIVO MÓVIL (< 768px) */
@media (max-width: 768px) {
    .player-navbar {
        padding: 12px 16px;
    }
    
    .brand-title {
        font-size: 1rem;
    }

    .main-container {
        padding: 16px 12px 40px 12px;
    }

    .hero-portal {
        padding: 20px;
    }

    .hero-title {
        font-size: 1.35rem;
    }

    .video-grid {
        grid-template-columns: 1fr;
    }

    .watch-info-panel {
        flex-direction: column;
        align-items: flex-start;
    }

    .watch-action-buttons {
        width: 100%;
    }

    .watch-action-buttons .btn-paicavi {
        flex: 1;
        justify-content: center;
    }
}
