/* =========================================
   ESTILOS GENERALES (TEMA DARK/HACKER)
   ========================================= */
body {
    font-family: 'Courier New', Courier, monospace;
    background-color: #1a1a1a;
    color: #eee;
    padding: 20px;
    margin: 0;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    background-color: #2d2d2d;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

/* =========================================
   TIPOGRAFÍA
   ========================================= */
h1 {
    text-align: center;
    color: #ff0050; /* Rosa TikTok */
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 30px;
    border-bottom: 1px solid #444;
    padding-bottom: 20px;
}

h2 {
    color: #eee;
    margin-top: 30px;
    border-bottom: 1px solid #444;
    padding-bottom: 10px;
}

/* =========================================
   FORMULARIOS
   ========================================= */
label {
    font-weight: bold;
    margin-top: 20px;
    display: block;
    color: #00f2ea; /* Cyan futurista */
    margin-bottom: 8px;
}

input[type="text"],
input[type="number"] {
    width: 100%;
    padding: 12px;
    background-color: #333;
    border: 1px solid #444;
    color: white;
    border-radius: 4px;
    font-family: inherit;
    box-sizing: border-box;
    transition: border-color 0.3s;
}

input:focus {
    border-color: #ff0050;
    outline: none;
}

.config-row {
    display: flex;
    gap: 20px;
    margin-top: 10px;
}

.config-col {
    flex: 1;
}

/* =========================================
   BOTONES
   ========================================= */
button {
    width: 100%;
    background-color: #ff0050;
    color: white;
    border: none;
    padding: 15px;
    font-size: 18px;
    font-weight: bold;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 25px;
    text-transform: uppercase;
}

button:hover {
    background-color: #d60045;
    transform: scale(1.02);
    box-shadow: 0 0 15px rgba(255, 0, 80, 0.4);
}

button:disabled {
    background-color: #555;
    color: #888;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Botón secundario para PDF (Verde) */
.btn-secondary {
    background-color: #00b894; 
    margin-top: 20px;
}
.btn-secondary:hover {
    background-color: #00a383;
    box-shadow: 0 0 15px rgba(0, 184, 148, 0.4);
}

/* =========================================
   CONSOLA (LOGS)
   ========================================= */
#console-container {
    background-color: #000;
    border: 1px solid #444;
    border-radius: 6px;
    padding: 15px;
    height: 300px;
    overflow-y: auto;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 13px;
    margin-top: 30px;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.8);
    display: none;
}

.console-header {
    color: #666;
    text-align: center;
    border-bottom: 1px dashed #333;
    margin-bottom: 10px;
    padding-bottom: 5px;
}

.log-line {
    margin: 4px 0;
    border-bottom: 1px solid #111;
    line-height: 1.4;
    word-wrap: break-word;
}

.log-info { color: #0f0; }      
.log-warn { color: #ffeb3b; }   
.log-error { color: #ff4444; }  

/* Scrollbar dark */
#console-container::-webkit-scrollbar { width: 10px; }
#console-container::-webkit-scrollbar-track { background: #111; }
#console-container::-webkit-scrollbar-thumb { background: #444; border-radius: 5px; }
#console-container::-webkit-scrollbar-thumb:hover { background: #ff0050; }

/* =========================================
   RESULTADOS Y RESALTADO
   ========================================= */
.results-area {
    margin-top: 40px;
}

.result-box {
    background-color: #333;
    padding: 20px;
    border-left: 5px solid #00f2ea;
    margin-bottom: 20px;
    border-radius: 4px;
    animation: fadeIn 0.5s ease-in-out;
}

.result-url a {
    color: #00f2ea;
    text-decoration: none;
    font-weight: bold;
}
.result-url a:hover { text-decoration: underline; }

.result-text {
    font-style: italic;
    color: #bbb;
    margin-top: 10px;
    background: #222;
    padding: 15px;
    border-radius: 4px;
    line-height: 1.6;
}

/* CLASE CRÍTICA PARA EL RESALTADO */
.highlight {
    background-color: #ff0050; /* Rosa Intenso */
    color: white;
    padding: 2px 5px;
    border-radius: 3px;
    font-weight: bold;
    text-transform: uppercase;
    box-shadow: 0 0 5px rgba(255, 0, 80, 0.5);
    display: inline-block;
}

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

/* =========================================
   ESTILOS PARA EL PDF (OCULTO PERO RENDERIZABLE)
   ========================================= */
#reporte-pdf-container {
    /* Truco: No usar display:none, sino sacarlo de la vista */
    position: absolute;
    top: -10000px; 
    left: 0;
    
    /* Forzar dimensiones A4 aproximadas */
    width: 750px; 
    
    /* FORZAR COLORES: Evitar letras blancas sobre fondo blanco */
    background-color: #ffffff !important;
    color: #000000 !important;
    
    padding: 40px;
    font-family: Helvetica, Arial, sans-serif;
    z-index: -1;
}

/* Forzar que TODO el texto dentro sea negro */
#reporte-pdf-container * {
    color: #000000 !important;
}

#reporte-pdf-container h1 {
    color: #333 !important;
    border-bottom: 2px solid #ff0050;
    text-align: left;
    margin-bottom: 20px;
}

#reporte-pdf-container .pdf-item {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #ccc;
    page-break-inside: avoid; /* Evita cortar un video a mitad de página */
}

#reporte-pdf-container a {
    color: #0066cc !important;
    text-decoration: underline;
}

/* El resaltado DEBE tener fondo rosa y letra blanca */
#reporte-pdf-container .highlight {
    background-color: #ff0050 !important; 
    color: #ffffff !important; /* Aquí sí queremos letra blanca */
    padding: 2px 5px;
    border-radius: 3px;
    font-weight: bold;
    display: inline-block;
}

:root {
          --primary:#00f2ea;
          --secondary:#ff0050;
          --bg:#0b0b0b;
          --card:#151515;
          --glass:rgba(255,255,255,0.05);
        }

        body {
          margin:0;
          font-family:'Segoe UI',sans-serif;
          background:radial-gradient(circle at top,#111,#000);
          color:white;
        }

        .container {
          max-width:950px;
          margin:auto;
          padding:25px;
        }

        .panel {
          background:linear-gradient(135deg,#151515,#0f0f0f);
          border:1px solid #222;
          border-radius:16px;
          padding:25px;
          box-shadow:0 20px 40px rgba(0,0,0,.5);
        }

        h1 {
          display:flex;
          gap:10px;
          align-items:center;
          color:var(--primary);
          margin-top:0;
        }

        label {
          font-size:13px;
          color:#aaa;
        }

        input {
          width:100%;
          padding:12px;
          background:#0d0d0d;
          border:1px solid #333;
          border-radius:8px;
          color:white;
          margin-bottom: 10px;
        }

        .row {
          display:flex;
          gap:15px;
        }

        button {
          width:100%;
          padding:14px;
          margin-top:15px;
          border:none;
          border-radius:10px;
          font-weight:bold;
          cursor:pointer;
          transition:.3s;
        }

        #btn-buscar {
          background:linear-gradient(135deg,var(--secondary),#ff2d6f);
          color:white;
        }

        #btn-buscar:hover { transform:scale(1.02); }

        #btn-buscar:disabled {
          background:#444;
          cursor:not-allowed;
        }

        #console-container {
          background:black;
          border-radius:12px;
          padding:12px;
          height:170px;
          overflow-y:auto;
          font-family:monospace;
          font-size:12px;
          margin-top:20px;
          border:1px solid #222;
        }

        .log-line {
          padding:3px 0;
          border-bottom:1px dashed #111;
        }

        .search-group {
          margin-top:30px;
        }

        .group-header {
          background:var(--glass);
          padding:12px 15px;
          border-radius:12px 12px 0 0;
          border:1px solid #222;
          display:flex;
          justify-content:space-between;
        }

        .video-card {
          background:var(--card);
          border-left:4px solid var(--primary);
          margin:12px 0;
          padding:15px;
          border-radius:0 12px 12px 0;
          animation:fadeIn .4s;
        }

        mark {
          background:var(--secondary);
          color:white;
          padding:0 3px;
          border-radius:3px;
        }

        #actions-area {
          position:fixed;
          bottom:25px;
          right:25px;
          display:none;
        }

        .btn-pdf {
          background:linear-gradient(135deg,var(--primary),#2ffff3);
          color:black;
          padding:16px 26px;
          border-radius:50px;
          box-shadow:0 10px 30px rgba(0,242,234,.5);
          font-weight:bold;
        }

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


/* Estilo para el estado de transcripción */
.transcription-status {
    background: #f0f4f8;
    border-left: 4px solid #00f2ea;
    padding: 10px;
    margin: 10px 0;
    font-size: 0.9em;
    border-radius: 4px;
}

.loading-spinner {
    display: inline-block;
    width: 15px;
    height: 15px;
    border: 2px solid rgba(0,242,234,.3);
    border-radius: 50%;
    border-top-color: #00f2ea;
    animation: spin 1s ease-in-out infinite;
    margin-right: 8px;
}

@keyframes spin { to { transform: rotate(360deg); } }

.transcripcion-texto {
    background: #fff;
    padding: 10px;
    border: 1px dashed #ccc;
    margin-top: 10px;
    font-style: italic;
    color: #333;
}

.transcription-loading {
    border-left: 4px solid #00f2ea;
    background: #f9f9f9;
    padding: 10px;
    margin: 10px 0;
    font-size: 0.9em;
    display: flex;
    align-items: center;
    gap: 10px;
}

.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid #ccc;
    border-top-color: #00f2ea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.transcripcion-texto {
    background: #fff;
    padding: 12px;
    border: 1px solid #eee;
    border-radius: 8px;
    margin-top: 10px;
    color: #222;
    line-height: 1.5;
}