/* Variables CSS para modo oscuro */
:root {
    --bg-color: #ffffff;
    --text-color: #333333;
    --iconobg: #871d1de6;
    --nav-bg: #a12525;
    --nav-text: #ffffff;
    --border-color: #e0e0e0;
    --card-bg: #f9f9f9;
    --color-fondo-tarjeta: #ffffff;
    --color-primario: #a12525;
    --color-borde: #e0e0e0;
    --sombra-suave: 0 2px 4px rgba(0, 0, 0, 0.1);
    --sombra-media: 0 4px 8px rgba(0, 0, 0, 0.15);
    --radio-borde: 8px;
    --transicion: all 0.3s ease;
    --respuestaborder: #ddd;
    --strongred: #a12525;
    --strongautor: #a12525;
    --normaswhite: #333333;
    --footerbg: #5a0000e6;
    --colorpag: #f1ececff;
}

[data-theme="dark"] {
    --bg-color: #1a1a1a;
    --text-color: #e0e0e0;
    --iconobg: #2d1b1b;
    --nav-bg: #2d1b1b;
    --nav-text: #ffffff;
    --border-color: #333333;
    --card-bg: #2a2a2a;
    --color-fondo-tarjeta: #2a2a2a;
    --color-primario: #a12525;
    --color-borde: #444444;
    --sombra-suave: 0 2px 4px rgba(0, 0, 0, 0.3);
    --sombra-media: 0 4px 8px rgba(0, 0, 0, 0.4);
    --respuestaborder: #ffffff2c;
    --strongwhite: #a3a0a0ff;
    --strongautor: #a3a0a0ff;
    --normaswhite: white;
    --footerbg: #2d1b1b;
    --colorpag: #2d2c2cff;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
}

.page-transition {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: black;
    opacity: 1;
    /* empieza negro al cargar */
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 9999;
    pointer-events: none;
}

.page-transition.fade-out {
    opacity: 0;
    /* fade out (negro desaparece) */
    pointer-events: none;
}

.page-transition.fade-in {
    opacity: 1;
    /* fade in (negro aparece) */
    pointer-events: auto;
}

/* Estilos del nav */
.nav-links {
    background-color: var(--nav-bg);
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.nav-links ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
}

/* Estilos Del menu hamburguesa */
/* Menú hamburguesa posicionado a la derecha */
.hamburger-menu {
    position: absolute;
    right: 20px;
}

.nav-links li a {
    color: var(--nav-text);
    text-decoration: none;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}

.nav-links li a:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.nav-links li a.active {
    background-color: var(--color-secundario);
}

/* Menú hamburguesa */
.hamburger-btn {
    background: none;
    border: none;
    color: var(--nav-text);
    font-size: 20px;
    cursor: pointer;
    padding: 8px;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}

.hamburger-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Dropdown menu */
.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
}

.dropdown-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    color: var(--text-color);
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.2s ease;
}

.dropdown-item:last-child {
    border-bottom: none;
}

.dropdown-item:hover {
    background-color: rgba(161, 37, 37, 0.1);
}

.dropdown-item i {
    width: 16px;
    text-align: center;
}

/* Toggle switch para modo oscuro */
.theme-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.toggle-switch {
    position: relative;
    width: 50px;
    height: 24px;
    background-color: #ccc;
    border-radius: 12px;
    transition: background-color 0.3s ease;
    cursor: pointer;
}

.toggle-switch.active {
    background-color: #a12525;
}

.toggle-slider {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background-color: white;
    border-radius: 50%;
    transition: transform 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.toggle-switch.active .toggle-slider {
    transform: translateX(26px);
}

/* Header */
header {
    background-color: #871d1d00;
    box-shadow: var(--sombra-suave);
    padding: none;
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--iconobg);
}

.logo {
    height: 60px;
    margin-right: 1rem;
}

.logo-small {
    height: 40px;
    margin-right: 0.5rem;
}

header h1 {
    margin-bottom: 0;
    color: white;
    font-family: 'Franklin Gothic Medium', 'Arial Narrow', Arial, sans-serif;
    letter-spacing: 2px;
}

.form-grupo textarea,
.form-grupo input[type="text"] {
    background-color: var(--color-fondo-tarjeta);
    width: 100%;
    padding: 1rem;
    border: 1px solid var(--color-borde);
    border-radius: var(--radio-borde);
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
    outline: none;
    transition: var(--transicion);
    color: var(--text-color);
}

.form-grupo textarea:focus,
.form-grupo input[type="text"]:focus {
    border-color: #b30606;
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 0, 0, 0.25);
}

.form-grupo select {
    width: 100%;
    padding: 10px;
    font-size: 16px;
    border: 2px solid #333333;
    border-radius: 8px;
    background-color: var(--color-fondo-tarjeta);
    color: var(--text-color);
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20width%3D'12'%20height%3D'8'%20viewBox%3D'0%200%2012%208'%20xmlns%3D'http%3A//www.w3.org/2000/svg'%3E%3Cpath%20d%3D'M1.41.59L6%205.17%2010.59.59%2012%202l-6%206-6-6z'%20fill%3D'%23666'%20/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 12px 8px;
}

.form-grupo select:focus {
    border-color: #b30606;
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 0, 0, 0.25);
}

.boton-secundario {
    background-color: #810b0b;
    color: white;
}

.boton-hover {
    background-color: #960d0dff;
    color: white;
}

.custom-file-label {
    display: inline-block;
    color: #fff;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.1s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.custom-file-label:hover {
    background-color: #871d1d;
    transform: scale(1.02);
}

.custom-file-label:active {
    transform: scale(0.98);
}

/* Checkbox personalizado */
#terminos {
    position: absolute;
    opacity: 0;
}

#terminos+label {
    position: relative;
    padding-left: 30px;
    cursor: pointer;
    user-select: none;
    display: inline-block;
    line-height: 20px;
}

#terminos+label::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.5px;
    width: 20px;
    height: 20px;
    border: 2px solid #a12525;
    background-color: #a1252507;
    border-radius: 4px;
    box-sizing: border-box;
}

#terminos:checked+label::after {
    content: "";
    position: absolute;
    left: 6px;
    top: 3px;
    width: 6px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

#terminos:checked+label::before {
    background-color: #a12525;
    border-color: #a12525;
}

.normas h3 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    color: var(--normaswhite);
}

/* LOADER CSS COMPLETO */
.upload-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.upload-loader {
    background: white;
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    min-width: 350px;
    max-width: 400px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.upload-loader h3 {
    margin: 0 0 20px 0;
    color: #a12525;
    font-size: 20px;
}

.upload-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #a12525;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px auto;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.progress-container {
    width: 100%;
    height: 20px;
    background-color: #f0f0f0;
    border-radius: 10px;
    overflow: hidden;
    margin: 20px 0;
    position: relative;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #a12525, #d63384);
    width: 0%;
    border-radius: 10px;
    transition: width 0.3s ease;
    position: relative;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg,
            transparent,
            rgba(255, 255, 255, 0.3),
            transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

.progress-text {
    margin: 10px 0;
    font-size: 16px;
    color: #333;
    font-weight: 500;
}

.progress-percentage {
    font-size: 18px;
    font-weight: bold;
    color: #a12525;
    margin: 10px 0;
}

.upload-status {
    font-size: 14px;
    color: #666;
    margin: 5px 0;
}

.success-animation {
    display: none;
}

.checkmark {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: block;
    stroke-width: 3;
    stroke: #871d1d;
    stroke-miterlimit: 10;
    margin: 20px auto;
    background-color: #871d1d;
    animation: checkmark-pop 0.6s ease-in-out;
}

.checkmark__circle {
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
    stroke-width: 3;
    stroke-miterlimit: 10;
    stroke: #871d1d;
    fill: #871d1d;
    animation: stroke-circle .6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.checkmark__check {
    transform-origin: 50% 50%;
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    stroke: white;
    stroke-width: 3;
    fill: none;
    animation: stroke-check .3s cubic-bezier(0.65, 0, 0.45, 1) .3s forwards;
}

@keyframes stroke-circle {
    100% {
        stroke-dashoffset: 0;
    }
}

@keyframes stroke-check {
    100% {
        stroke-dashoffset: 0;
    }
}

@keyframes checkmark-pop {
    0% {
        transform: scale(0);
        opacity: 0;
    }

    50% {
        transform: scale(1.2);
        opacity: 1;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Responsive nav */
@media (max-width: 768px) {
    .nav-links ul {
        gap: 15px;
    }

    .nav-links li a {
        padding: 6px 12px;
        font-size: 14px;
    }

    .dropdown-menu {
        right: -10px;
    }

        .logo-container {
        flex-direction: row;
        text-align: center;
        padding: 0.5rem 0px; /* El padding vertical va aquí en el contenedor */
        align-items: center; /* Centra verticalmente logo y texto */
        gap: 0.5rem; /* Reduce el espacio entre logo y texto */
    }

    header {
        padding: 0; /* Vuelve el padding a 0 en el header */
    }

    .logo {
        margin-right: 0;
        margin-bottom: 0; /* Quita el margen inferior para mejor alineación */
        width: 50px; /* Reduce el tamaño del logo */
        height: 50px; /* Mantiene proporción cuadrada */
    }

    nav ul {
        text-align: center;
    }

    nav li {
        margin: 0.5rem 0;
    }

    .form-filtros {
        flex-direction: column;
        gap: 1rem;
    }

    .filtro {
        min-width: auto;
    }

    .form-botones {
        flex-direction: column;
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
    }

    .footer-logo {
        flex-direction: column;
        justify-content: center;
    }

    .footer-links {
        justify-content: center;
    }

    .busqueda-filtros {
        display: flex;
        gap: 1rem;
        margin-bottom: 2rem;
        background-color: var(--color-fondo-tarjeta);
        border-radius: var(--radio-borde);
        padding: 1.5rem;
        box-shadow: var(--sombra-suave);
    }

    .filtro label {
        display: flex;
        margin-bottom: 0.5rem;
        font-weight: 500;
        flex-wrap: wrap;
    }

    header h1 {
        margin-bottom: 0;
        margin-top: 0; /* Quita cualquier margen superior */
        color: white;
        font-family: 'Franklin Gothic Medium', 'Arial Narrow', Arial, sans-serif;
        letter-spacing: none;
        padding-left: 0; /* Quita el padding ya que usamos gap en el contenedor */
        font-size: 1.4rem; /* Aumenta el tamaño de la fuente */
        font-weight: bold; /* Hace las letras más gruesas */
        white-space: nowrap; /* Evita el salto de línea */
        line-height: 1; /* Mejora la alineación vertical */
    }
    
    .hamburger-menu {
    position: static; /* hereda el flujo normal */
    margin-left: 20px; /* opcional, igual que las demás opciones */
    }
}



footer {
    background-color: var(--footerbg);
    color: white;
    padding: 3rem 1rem 1rem;
    margin-top: 4rem;
}

.paginacion a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--colorpag);
    box-shadow: var(--sombra-suave);
    transition: var(--transicion);
}

/*estilos para el logo y banner*/

.banner {
    height: 65px; /* Ligeramente más pequeño que el logo */
    width: auto;
    transition: transform 0.3s ease;
    transform: translateY(6px);
}

/* Efectos hover opcionales */
.logo:hover,
.banner:hover {
    transform: scale(1.05);
}

/* Elimina todos los efectos de focus, active y visited en los enlaces */
.logo-container a {
    outline: none;
    border: none;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent; /* Elimina el highlight en móviles WebKit */
    -webkit-touch-callout: none; /* Elimina el callout en iOS */
    -webkit-user-select: none; /* Evita selección */
    user-select: none;
}

.logo-container a:focus,
.logo-container a:active,
.logo-container a:visited {
    outline: none;
    border: none;
    box-shadow: none;
}

/* Elimina el highlight azul específicamente en móviles */
.logo-container a:focus img,
.logo-container a:active img {
    outline: none;
    border: none;
}

/* Responsive - para pantallas pequeñas */
/* Para pantallas muy pequeñas */
@media (max-width: 480px) {
    .logo-container {
        gap: 8px;
    }
    
    .logo {
        height: 40px;
        object-fit: contain
    }
    
    .banner {
        height: 40px;
        transform: translateY(4px);
    }
}