/* Variables CSS */
:root {
    --bg: #06090f;
    --card-bg: rgba(17, 24, 39, 0.95);
    --primary: #00f2ff;
    --mint: #00ffcc;
    --danger: #ff4d4d;
    --text-main: #f8fafc;
    --text-dim: #94a3b8;
    --border: rgba(0, 242, 255, 0.15);
    --input-bg: #02040a;
    --dif-azul: #3b82f6;
    --dif-amarillo: #fbbf24;
    --dif-rojo: #ef4444;
}

/* Estilos Base */
body {
    background-color: var(--bg);
    background-image: radial-gradient(circle at 100% 0%, #1e293b, transparent);
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    margin: 0;
    padding: 20px;
    min-height: 100vh;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    display: none;
}

/* ========== ESTILOS DE LOGIN ========== */
#auth-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg);
    background-image: radial-gradient(circle at 50% 50%, rgba(0, 242, 255, 0.05), transparent 70%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
}

.login-container {
    background: rgba(17, 24, 39, 0.9);
    padding: 50px;
    border-radius: 20px;
    border: 1px solid var(--border);
    box-shadow: 0 20px 60px rgba(0, 242, 255, 0.1);
    width: 100%;
    max-width: 400px;
    text-align: center;
    animation: loginAppear 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

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

.login-form {
    margin-top: 20px;
}

#password-input {
    width: 100%;
    padding: 16px;
    background: var(--input-bg);
    border: 2px solid rgba(0, 242, 255, 0.2);
    border-radius: 12px;
    color: white;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    outline: none;
    box-sizing: border-box;
    transition: all 0.3s;
    text-align: center;
    letter-spacing: 2px;
    font-weight: 700;
}

#password-input:focus {
    border-color: var(--primary);
    background: rgba(0, 0, 0, 0.5);
    box-shadow: 0 0 0 3px rgba(0, 242, 255, 0.1);
}

#password-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
    letter-spacing: 1px;
    font-weight: 500;
}

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 25px;
    background: rgba(15, 23, 42, 0.6);
    border-radius: 20px;
    border: 1px solid var(--border);
    backdrop-filter: blur(10px);
}

/* ========== BARRA DE FILTROS MEJORADA - DISEÑO ELEGANTE ========== */
.filters-bar {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 30px;
    padding: 0;
    background: none;
    border: none;
    flex-wrap: wrap;
}

/* Texto "Filtrar por" integrado en línea */
.filters-bar > span {
    color: var(--primary);
    font-size: 0.75rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 2px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding-right: 15px;
    margin-right: 5px;
    border-right: 1px solid rgba(0, 242, 255, 0.2);
    height: 40px;
}

.filters-bar > span::before {
    content: "⌕";
    font-size: 0.9rem;
}

/* Modifica la sección .filter-select existente: */
/* ========== ESTILOS PARA OPCIONES DE SELECT - SOLUCIÓN LEGIBILIDAD ========== */
.filter-select option {
    background: var(--card-bg);
    color: var(--text-main);
    font-size: 0.9rem;
    padding: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.filter-select option:checked,
.filter-select option:selected,
.filter-select option:hover {
    background: rgba(0, 242, 255, 0.15);
    color: var(--primary);
    font-weight: 600;
}

/* Estilo especial para la opción "all" */
.filter-select option[value="all"] {
    background: rgba(0, 242, 255, 0.1);
    color: var(--primary);
    font-weight: 700;
    border-bottom: 2px solid var(--primary);
}

/* Mejora visual para el dropdown abierto */
.filter-select:focus option {
    background: var(--card-bg);
    color: white;
}

/* Estilo para las opciones específicas de cada select */
.filter-select option[value="basica"] { color: #00ffcc; }
.filter-select option[value="media"] { color: #00f2ff; }
.filter-select option[value="superior"] { color: #8b5cf6; }

.filter-select option[value="facil"] { color: var(--dif-azul); }
.filter-select option[value="medio"] { color: var(--dif-amarillo); }
.filter-select option[value="dificil"] { color: var(--dif-rojo); }

.filter-select option[value="real"] { color: #10b981; }
.filter-select option[value="falso"] { color: #ef4444; }
.filter-select option[value="enganoso"] { color: #f97316; }
.filter-select option[value="impreciso"] { color: #f59e0b; }
.filter-select option[value="incompleto"] { color: #64748b; }
.filter-select option[value="irreal"] { color: #8b5cf6; }

/* Para navegadores WebKit (Chrome, Safari) */
.filter-select::-webkit-scrollbar {
    width: 8px;
}

.filter-select::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

.filter-select::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 4px;
}

/* Para Firefox */
.filter-select option:checked {
    background-color: rgba(0, 242, 255, 0.2) !important;
    color: white !important;
}

/* Mejorar la visibilidad del texto seleccionado en el select cerrado */
.filter-select {
    color: var(--text-main) !important;
    font-weight: 500;
}

/* Asegurar que el texto sea visible cuando el select tiene focus */
.filter-select:focus {
    color: var(--text-main);
    background: rgba(0, 242, 255, 0.12);
}

/* ========== FIN ESTILOS PARA OPCIONES ========== */

.filter-select {
    position: relative;
    background: rgba(0, 242, 255, 0.1);
    color: white;
    border: 1px solid rgba(0, 242, 255, 0.3);
    padding: 12px 40px 12px 15px;
    border-radius: 10px;
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    font-weight: 500;
    outline: none;
    cursor: pointer;
    min-width: 180px;
    transition: all 0.25s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2300f2ff' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: calc(100% - 12px) center;
    background-size: 14px;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.filter-select:hover {
    border-color: var(--mint);
    background: rgba(0, 255, 204, 0.15);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(0, 242, 255, 0.15);
}

.filter-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 242, 255, 0.2);
    background: rgba(0, 242, 255, 0.15);
}

/* Indicador de filtro activo - sutil pero visible */
.filter-select:not([value="all"]) {
    border-color: rgba(0, 255, 204, 0.4);
    background: rgba(0, 255, 204, 0.1);
}

.filter-select:not([value="all"])::after {
    content: "•";
    position: absolute;
    top: 50%;
    left: 8px;
    transform: translateY(-50%);
    color: var(--mint);
    font-size: 1.2rem;
    line-height: 1;
}

/* Contador de resultados - integrado y sutil */
.counter-badge {
    margin-left: auto;
    background: rgba(0, 242, 255, 0.1);
    color: var(--primary);
    padding: 7px 14px;
    border-radius: 20px;
    font-weight: 800;
    font-size: 0.72rem;
    border: 1px solid rgba(0, 242, 255, 0.25);
    letter-spacing: 0.5px;
}

/* Estilos para móviles */
@media (max-width: 768px) {
    .filters-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    
    .filter-select {
        min-width: 100%;
        font-size: 0.85rem;
        padding: 12px 40px 12px 15px;
    }
    
    .counter-badge {
        margin-left: 0;
        order: -1;
        align-self: center;
        width: 100%;
        text-align: center;
    }
    
    .filters-bar > span {
        border-right: none;
        border-bottom: 1px solid rgba(0, 242, 255, 0.2);
        padding-right: 0;
        padding-bottom: 10px;
        margin-right: 0;
        margin-bottom: 5px;
        height: auto;
        width: 100%;
        justify-content: center;
    }
    
    /* Login responsive */
    .login-container {
        padding: 30px 20px;
        margin: 20px;
        max-width: 90%;
    }
}

/* ========== FIN BARRA DE FILTROS MEJORADA ========== */

/* Botones */
.btn {
    padding: 12px 24px;
    border-radius: 10px;
    font-weight: 800;
    text-decoration: none;
    transition: 0.3s;
    font-size: 0.8rem;
    border: none;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-primary {
    background: var(--primary);
    color: #000;
    box-shadow: 0 0 20px rgba(0, 242, 255, 0.2);
}

.btn-outline {
    background: transparent;
    color: var(--text-dim);
    border: 1px solid var(--border);
}

.btn-outline:hover {
    border-color: var(--mint);
    color: white;
}

/* Grid de Noticias */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 25px;
}

/* Tarjetas de Noticias */
.news-card {
    background: var(--card-bg);
    border-radius: 24px;
    border: 1px solid var(--border);
    overflow: hidden;
    transition: 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
}

.news-card:hover {
    transform: translateY(-10px);
    border-color: var(--primary);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
}

.card-image {
    width: 100%;
    height: 180px;
    background: #000;
    position: relative;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.veredicto-float {
    position: absolute;
    bottom: 15px;
    left: 15px;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 0.65rem;
    font-weight: 900;
    text-transform: uppercase;
    color: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.card-content {
    padding: 25px;
}

.card-title {
    font-size: 1.2rem;
    font-weight: 800;
    margin-bottom: 20px;
    line-height: 1.4;
    color: #fff;
}

/* Dashboard de Información */
.info-dash {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    background: rgba(0, 0, 0, 0.4);
    padding: 15px;
    border-radius: 15px;
}

.dash-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.dash-label {
    font-size: 0.55rem;
    color: var(--text-dim);
    text-transform: uppercase;
    font-weight: 900;
    letter-spacing: 0.5px;
}

.dash-val {
    font-size: 0.75rem;
    font-weight: 700;
    color: #fff;
}

/* Etiquetas */
.tag-pill {
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 0.65rem;
    font-weight: 900;
}

.dif-facil {
    background: var(--dif-azul);
    color: white;
}

.dif-medio {
    background: var(--dif-amarillo);
    color: black;
}

.dif-dificil {
    background: var(--dif-rojo);
    color: white;
}

.nivel-tag {
    border: 1px solid var(--primary);
    color: var(--primary);
    background: rgba(0, 242, 255, 0.05);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(15px);
    overflow-y: auto;
}

.modal-content {
    background: #0d1117;
    margin: 30px auto;
    padding: 40px;
    border-radius: 30px;
    width: 90%;
    max-width: 1100px;
    border: 1px solid var(--primary);
    box-shadow: 0 0 60px rgba(0, 242, 255, 0.15);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 35px;
}

/* Grupos de Campos */
.field-group {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 20px;
    margin-bottom: 30px;
    padding: 25px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.section-header {
    grid-column: span 12;
    color: var(--primary);
    font-size: 0.8rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-header::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* Clases de Ancho de Grid */
.w-12 {
    grid-column: span 12;
}

.w-8 {
    grid-column: span 8;
}

.w-6 {
    grid-column: span 6;
}

.w-4 {
    grid-column: span 4;
}

.w-3 {
    grid-column: span 3;
}

/* Formulario */
.form-group label {
    display: block;
    color: var(--text-dim);
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 14px;
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: white;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    outline: none;
    box-sizing: border-box;
    transition: 0.3s;
}

.form-group input:focus {
    border-color: var(--mint);
    background: #000;
}

/* Bloque de Análisis */
.analysis-block {
    grid-column: span 12;
    background: rgba(0, 242, 255, 0.03);
    padding: 20px;
    border-radius: 15px;
    border-left: 5px solid var(--primary);
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

/* Vista Previa de Imagen */
.img-edit-preview {
    width: 100%;
    height: 200px;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    border: 2px dashed var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
}

.img-edit-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* Badges de Veredicto */
.badge-real {
    background: #10b981;
}

.badge-falso {
    background: #ef4444;
}

.badge-impreciso {
    background: #f59e0b;
}

.badge-engañoso {
    background: #f97316;
}

.badge-incompleto {
    background: #64748b;
}

.badge-irreal {
    background: #8b5cf6;
}