/* =========================================
    LAYOUT DE INTERFAZ - BANNER & PORTAL
   ========================================= */

/* 0. FONDO GLOBAL */
html,
body {
    margin: 0 !important;
    padding: 0 !important;
    min-height: 100vh;
    background-color: #0d0d0d;
    overflow-x: hidden !important;
}

/* 1. BARRA SUPERIOR (HEADER) */
.main-header {
    width: 100% !important;
    position: relative !important;
    top: 0;
    left: 0;
    z-index: 99999 !important;
    height: 80px !important;
    border-bottom: 5px solid #d4af37;
    display: flex;
    align-items: center;
    box-shadow: 0 4px 25px rgba(0, 0, 0, 0.7);
    box-sizing: border-box;
    
    /* INTERACCIÓN DE ENLACE */
    cursor: default; /* Cambiado a default para que solo el logo tenga el puntero */
    transition: filter 0.3s ease;

    /* Graduación de color para el logo */
    background: linear-gradient(to right,
        #ffffff 0%,
        #ffffff 40%,
        #1a1a1a 80%,
        #0d0d0d 100%) !important;

    background-image: url('img/logo-prueba2.png') !important;
    background-size: auto 110% !important;
    background-position: 100px center !important;
    background-repeat: no-repeat !important;
}

/* Efecto de iluminación al pasar el mouse por el logo/header */
.main-header:hover {
    filter: brightness(1.05);
}

/* 2. CONTENEDOR DE IDENTIDAD (TOP BAR) */
.top-bar-container {
    display: flex !important;
    justify-content: space-between; /* Cambiado para separar logo de botones */
    align-items: center;
    padding: 0 40px;
    width: 100%;
    height: 100%;
    background: transparent !important;
    position: relative;
}

/* ÁREA DE CLIC DEL LOGO (Posicionamiento Absoluto sobre la imagen) */
.top-bar-left {
    position: relative;
    height: 100%;
    width: 350px; /* Área que cubre el logo */
}

.logo-click-area {
    display: block;
    position: absolute;
    top: 0;
    left: 60px; /* Ajuste para calzar con background-position: 100px */
    width: 280px; 
    height: 100%;
    cursor: pointer;
    z-index: 100;
}

/* PROTECCIÓN DE INTERACCIÓN: Evita que el cursor de link del header afecte los botones */
.top-bar-right {
    cursor: default;
    position: relative;
    z-index: 100001;
    display: flex;
    align-items: center;
    gap: 15px;
}

/* --- CÁPSULA DE USUARIO (CON IMAGEN) --- */
#user-logged {
    display: flex;
    align-items: center;
    gap: 12px;
    background-image: url('img/fondo-nuevo-grimorio.png') !important;
    background-size: cover !important;
    background-position: center !important;
    background-repeat: no-repeat !important;

    padding: 8px 18px;
    border-radius: 50px;
    border: 1px solid rgba(212, 175, 55, 0.8) !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.6);
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
}

#user-logged:hover {
    transform: translateY(-1px);
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.5);
}

#display-name-text {
    color: #ffffff !important;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.8);
    font-family: 'Poppins', sans-serif !important;
    font-weight: 700;
    font-size: 0.95rem;
}

.avatar-header {
    width: 42px !important;
    height: 42px !important;
    border: 2px solid #d4af37 !important;
    border-radius: 50%;
    object-fit: cover;
    background: #000;
}

/* 3. DROPDOWN MÍSTICO / MICROSOFT STYLE */
.user-dropdown-menu {
    position: absolute;
    top: 75px;
    right: 0px;
    width: 320px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.6);
    border: 1px solid #e0e0e0;
    padding: 24px;
    display: none;
    flex-direction: column;
    z-index: 100002 !important;
    cursor: default;
}

.user-dropdown-menu.active {
    display: flex !important;
    animation: fadeInSlide 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.dropdown-header-ms {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.btn-cerrar-sesion-ms {
    color: #0067b8;
    background: none;
    border: none;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    font-family: 'Poppins', sans-serif;
}

.dropdown-body-ms {
    display: flex;
    gap: 15px;
    align-items: flex-start;
}

.avatar-large-ms {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 1px dashed #adb5bd;
    padding: 3px;
    object-fit: cover;
}

.user-info-ms h4 {
    margin: 0;
    font-size: 1.1rem;
    color: #212529;
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
}

.user-info-ms p {
    margin: 4px 0;
    font-size: 0.85rem;
    color: #6c757d;
    word-break: break-all;
}

.link-cuenta-ms {
    display: inline-block;
    margin-top: 10px;
    color: #0067b8;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
}

/* --- 4. BOTÓN ASCENDER (LOGIN) --- */
#btn-login,
button#btn-login {
    background-image: none !important;
    background-color: rgba(20, 20, 20, 0.5) !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
    border: 2px solid #d4af37 !important;
    color: #d4af37 !important;
    padding: 10px 25px !important;
    border-radius: 4px !important;
    font-family: 'Cinzel', serif !important;
    font-weight: 700 !important;
    letter-spacing: 2px !important;
    text-transform: uppercase !important;
    cursor: pointer !important;
    transition: all 0.4s ease !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5) !important;
}

#btn-login:hover,
button#btn-login:hover {
    background-color: rgba(212, 175, 55, 0.2) !important;
    color: #ffffff !important;
    border-color: #ffffff !important;
    box-shadow: 0 0 25px rgba(212, 175, 55, 0.6) !important;
    transform: translateY(-2px) !important;
}

/* 5. PORTAL ESTRUCTURA */
.portal-grid-layout {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 80px);
    width: 100%;
}

.hero-title {
    font-family: 'Cinzel', serif;
    font-size: 3.5rem;
    color: #ffffff;
    text-shadow: 0 0 20px rgba(212, 175, 55, 0.8), 2px 2px 10px rgba(0, 0, 0, 0.5);
    margin: 0 0 20px 0;
    text-align: center;
}

/* --- ANIMACIONES --- */
@keyframes fadeInSlide {
    from { opacity: 0; transform: translateY(-15px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Responsive */
@media (max-width: 1100px) {
    .main-header {
        height: 70px !important;
        background-size: auto 100% !important;
        background-position: 20px center !important;
    }
    .hero-title { font-size: 2.2rem; }
    .logo-click-area { left: 10px; width: 200px; }
}

/* UTILITARIOS DE ENLACE */
.banner-link, .banner-logo-link {
    text-decoration: none;
    display: block;
    cursor: pointer;
    width: 100%;
    height: 100%;
}

.banner-title-main, .banner-subtitle {
    pointer-events: none;
}