@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600;700&display=swap');

@font-face {
    font-family: 'ScienceGothic';
    src: url('../fonts/ScienceGothic-Bold.ttf') format('opentype');
    font-weight: bold;
    font-style: normal;
}

/* ==========================================
   GLOBAL STYLES & VARIABLES
   ========================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

h1,
h2,
h3,
h4,
h5,
h6,
.nav-link,
a {
    font-family: 'ScienceGothic', sans-serif;
}

body {
    background: url('../images/fondo.png') no-repeat center center fixed;
    background-size: cover;
    color: #ffffff;
    min-height: 100vh;
}

a {
    color: inherit;
    text-decoration: none;
    transition: all 0.3s ease;
}

a:visited {
    color: inherit;
}

body.no-scroll {
    overflow: hidden;
}

.navbar {
    background: linear-gradient(90deg, rgba(225, 6, 0, 0.85) 0%, rgba(255, 30, 0, 0.85) 100%);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 2000;
    /* Aumentado para estar sobre el overlay */
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-links a {
    border-radius: 10px;
}

.main-content {
    max-width: 1200px;
    margin: 120px auto 140px;
    /* Margen aumentado para dar más aire respecto a navbar y footer fijos */
    padding: 0 2rem;
    min-height: calc(100vh - 260px);
}

/* Authentication Containers (Login/Register base) */
.auth-container {
    max-width: 400px;
    margin: 3rem auto;
    background: rgba(255, 255, 255, 0.1);
    padding: 2rem;
    border-radius: 10px;
    backdrop-filter: blur(10px);
}

.auth-container h2 {
    text-align: center;
    margin-bottom: 1.5rem;
    color: #ff1e00;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.form-group input,
.form-group select,
select {
    width: 100%;
    padding: 0.8rem;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 5px;
    background: rgba(0, 0, 0, 0.3);
    color: white;
    font-size: 1rem;
}

.form-group input:focus,
select:focus {
    outline: none;
    border-color: #ff1e00;
}

/* Base Buttons */
.btn {
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: linear-gradient(90deg, #e10600 0%, #ff1e00 100%);
    color: white;
    width: 100%;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(225, 6, 0, 0.4);
}

.btn-logout {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 0.5rem 1rem;
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 5px;
    margin-bottom: 1rem;
}

.alert-success {
    background: rgba(0, 255, 0, 0.2);
    border: 2px solid #00ff00;
}

.alert-error {
    background: rgba(255, 0, 0, 0.2);
    border: 2px solid #ff0000;
}

/* Global Navigation Items */
.nav-link {
    background: rgb(39, 39, 39);
    color: white;
    text-decoration: none;
    font-weight: bold;
    padding: 0.5rem 1rem;
    border-radius: 0 15px 15px 15px;
    transition: all 0.3s ease;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Dropdown Menu */

.nav-link .nav-dropdown {
    border-radius: 10px;
}

.nav-dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-toggle {
    background: rgb(39, 39, 39);
    border: none;
    color: white;
    cursor: pointer;
    padding: 0.5rem 1rem;
    border-radius: 0 15px 15px 15px;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.dropdown-content {
    display: none;
    position: absolute;
    background: rgba(30, 30, 30, 0.98);
    min-width: 240px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
    border-radius: 8px;
    margin-top: 0.5rem;
    z-index: 1000;
    left: 0;
    border: 2px solid rgba(255, 30, 0, 0.5);
    overflow: hidden;
}

.dropdown-content.show {
    display: block;
}

.dropdown-content a {
    color: white;
    padding: 1rem 1.2rem;
    text-decoration: none;
    display: block;
    transition: all 0.3s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.dropdown-content a:hover {
    background: rgba(255, 30, 0, 0.3);
    padding-left: 1.8rem;
    color: #ff1e00;
}

/* Password Toggle */
.pw-wrap {
    position: relative;
    display: block;
}

.pw-wrap input {
    padding-right: 44px !important;
    width: 100%;
}

.pw-toggle {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    cursor: pointer;
    color: #fff;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.5;
    transition: opacity .2s;
}

.pw-toggle:hover {
    opacity: 1;
}

/* Admin Badges */
.admin-badge-mini {
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    color: #000;
    padding: 0.1rem 0.4rem;
    border-radius: 8px;
    font-size: 0.6rem;
    font-weight: bold;
    margin-left: 0.3rem;
}

/* Footer */
.footer {
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    padding: 1rem 0;
    text-align: center;
    color: #999;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    border-top: 2px solid rgba(255, 30, 0, 0.3);
}

/* Cards Shared Elements (Header/Avatar) */
.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff1e00, #e10600);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: white;
}

.expand-icon {
    transition: transform 0.3s ease;
    color: #ff1e00;
}

/* Base Styles addition for Toggle */
.menu-toggle {
    display: none;
}

@media (max-width: 768px) {
    .nav-container {
        flex-direction: row;
        justify-content: space-between;
        padding: 0 1.5rem;
        width: 100%;
        position: relative;
    }

    /* Hamburger Button */
    .menu-toggle {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        width: 32px;
        height: 22px;
        background: rgba(0, 0, 0, 0.2);
        border: 2px solid rgba(255, 255, 255, 0.3);
        border-radius: 6px;
        cursor: pointer;
        padding: 6px;
        z-index: 2000;
        position: relative;
        box-sizing: content-box;
    }

    .menu-toggle span {
        width: 100%;
        height: 3px;
        background-color: #000;
        border-radius: 10px;
        transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    }

    .menu-toggle.active span:nth-child(1) {
        transform: translateY(9.5px) rotate(45deg);
    }

    .menu-toggle.active span:nth-child(2) {
        opacity: 0;
        transform: scale(0);
    }

    .menu-toggle.active span:nth-child(3) {
        transform: translateY(-9.5px) rotate(-45deg);
    }

    /* Mobile Menu POPUP Windows Style */
    .nav-links {
        position: fixed !important;
        top: 100px !important;
        /* Posición fija para evitar que se corte por arriba */
        left: 50% !important;
        transform: translateX(-50%) scale(0.9);
        width: 85%;
        max-width: 350px;
        height: auto;
        max-height: calc(100vh - 140px);
        /* Ajuste para que siempre quepa en pantalla */
        background: rgba(20, 20, 20, 0.98);
        backdrop-filter: blur(25px);
        -webkit-backdrop-filter: blur(25px);
        border: 2px solid #ff1e00;
        border-radius: 20px;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        align-items: center;
        gap: 1rem;
        transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
        z-index: 2100;
        padding: 2rem 1.5rem;
        opacity: 0;
        visibility: hidden;
        overflow-y: auto;
        box-shadow: 0 0 50px rgba(0, 0, 0, 1), 0 0 30px rgba(255, 30, 0, 0.4);
    }

    .nav-links.active {
        opacity: 1;
        visibility: visible;
        transform: translateX(-50%) scale(1);
    }

    /* Fondo oscuro cuando el menu esta activo */
    body::after {
        content: "";
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.8);
        z-index: 1500;
        /* Superior al contenido pero inferior a la navbar */
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        pointer-events: none;
        /* Evita bloquear clicks cuando no esta activo */
    }

    body.no-scroll::after {
        opacity: 1;
        visibility: visible;
        pointer-events: all;
    }

    .nav-link {
        font-size: 1.2rem;
        width: 100%;
        text-align: center;
        padding: 1rem;
        background: rgba(255, 255, 255, 0.05);
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 12px;
        color: white;
    }

    .nav-link:hover,
    .nav-link:active {
        background: rgba(255, 30, 0, 0.2);
        border-color: #ff1e00;
    }

    .nav-dropdown {
        width: 100%;
    }

    .dropdown-toggle {
        width: 100%;
        font-size: 1.2rem;
        padding: 1rem;
        background: rgba(255, 255, 255, 0.05);
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 12px;
        color: white;
    }

    .dropdown-content {
        position: static;
        width: 100%;
        background: rgba(0, 0, 0, 0.4);
        box-shadow: none;
        margin-top: 0.5rem;
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 10px;
    }

    .dropdown-content a {
        font-size: 1.1rem;
        text-align: center;
        padding: 0.8rem;
    }
}

/* ==========================================
   MODAL LOGIN STYLES
   ========================================== */
.login-modal {
    display: none;
    position: fixed;
    z-index: 3000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
}

.login-modal-content {
    background: linear-gradient(135deg, #1a1a1a, #0a0a0a);
    margin: 10% auto;
    padding: 2.5rem;
    border: 2px solid #ff1e00;
    width: 90%;
    max-width: 450px;
    border-radius: 20px;
    position: relative;
    box-shadow: 0 0 50px rgba(255, 30, 0, 0.3);
    animation: modalSlideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    color: white;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-30px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.close-login-modal {
    position: absolute;
    top: 20px;
    right: 25px;
    font-size: 32px;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
    line-height: 1;
}

.close-login-modal:hover {
    color: #ff1e00;
    transform: rotate(90deg);
}

.login-modal-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-modal-header h2 {
    color: #ff1e00;
    font-size: 2rem;
    margin: 0;
}

.login-modal-body form {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.login-modal-footer {
    margin-top: 2rem;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1.5rem;
}

.login-modal-footer p {
    font-size: 0.9rem;
    color: #aaa;
    margin-bottom: 0.5rem;
}

.login-modal-footer a {
    color: #ff1e00;
    text-decoration: underline;
}

.login-modal-footer a:hover {
    color: #fff;
}

body.page-franco {
    background-image: url('../images/fondofranco.png');
}