/* =========================================
   VARIABLES & DESIGN SYSTEM (DIME - Clean & Bright)
   ========================================= */
:root {
    --bg-main: #FFFFFF;          /* 60% - Blanco Absoluto dominante */
    --bg-accent: #F8FAFC;        /* Gris Plata / Hueso muy sutil */
    --text-main: #0F172A;        /* Azul Medianoche para máxima legibilidad */
    --text-muted: #666666;       /* Gris Corporativo secundario */
    --accent: #FF5C02;           /* 20% - Naranja Innovación (Vivos y botones) */
    --accent-hover: #e05002;
    --error: #ff3b30;
    --card-bg: #FFFFFF;
    --shadow-sm: 0 10px 30px rgba(15, 23, 42, 0.04);
    --shadow-lg: 0 20px 40px rgba(15, 23, 42, 0.08);
    --transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
}

/* =========================================
   RESET & BASE LAYOUT
   ========================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Alegreya Sans', sans-serif;
}

body, html {
    height: 100%;
    width: 100%;
    overflow: hidden;
    background-color: var(--bg-main);
    color: var(--text-main);
    -webkit-font-smoothing: antialiased;
}

/* Sistema de Capas SPA */
.view-layer {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    display: none;
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 1;
}

.view-layer.active {
    display: flex;
    opacity: 1;
    z-index: 10;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* =========================================
   LOGIN (Auth Screen - Luminoso y Limpio)
   ========================================= */
#auth-screen {
    background: linear-gradient(135deg, #FFFFFF 0%, #F8FAFC 100%);
    justify-content: center;
    align-items: center;
}

.login-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    width: 100%;
}

.login-box {
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    padding: 50px 40px;
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    text-align: center;
    max-width: 420px;
    width: 90%;
}

.logo-placeholder {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 6px;
    margin-bottom: 20px;
    color: var(--accent);
    text-transform: uppercase;
}

.login-box h1 {
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-main);
}

.login-box p {
    color: var(--text-muted);
    font-size: 15px;
    margin-bottom: 30px;
}

.input-group {
    position: relative;
    margin-bottom: 20px;
}

.input-group i {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 15px;
}

.input-group input {
    width: 100%;
    padding: 15px 15px 15px 48px;
    background: var(--bg-accent);
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    font-size: 16px;
    color: var(--text-main);
    transition: var(--transition);
}

.input-group input:focus {
    outline: none;
    border-color: var(--accent);
    background: #FFFFFF;
    box-shadow: 0 0 0 4px rgba(255, 92, 2, 0.1);
}

.btn-primary {
    width: 100%;
    padding: 15px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    transition: var(--transition);
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(255, 92, 2, 0.25);
}

.error-msg {
    color: var(--error);
    font-size: 14px;
    margin-top: 15px;
    font-weight: 600;
}

/* Selector de roles inferior (Limpiando estilos en línea) */
.role-selector-bar {
    display: flex;
    gap: 20px;
    margin-top: 25px;
    border-top: 1px solid #E2E8F0;
    padding-top: 20px;
    width: 100%;
    max-width: 420px;
    justify-content: center;
}

.role-btn {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 700;
    transition: var(--transition);
}

.role-btn i {
    font-size: 18px;
}

.role-btn[data-role="commercial"] i {
    color: var(--accent);
}

/* =========================================
   HUB (Catálogo - Limpio y Espaciado)
   ========================================= */
#hub-screen {
    background: var(--bg-accent);
    flex-direction: column;
    overflow-y: auto;
    padding: 60px 40px;
}

.hub-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.hub-header {
    margin-bottom: 40px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.hub-header h2 {
    font-size: 36px;
    letter-spacing: -1px;
    color: var(--text-main);
    margin-bottom: 6px;
    font-weight: 800;
}

.hub-header p {
    color: var(--text-muted);
    font-size: 15px;
}

.hub-actions {
    display: flex;
    gap: 15px;
    align-items: center;
}

#admin-panel-btn {
    width: auto;
    padding: 10px 20px;
    font-size: 14px;
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
}

.pres-card {
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    text-align: left;
}

.pres-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(255, 92, 2, 0.4);
}

.card-thumb {
    height: 180px;
    background-size: cover;
    background-position: center;
    position: relative;
    background-color: #F1F5F9;
}

.badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: var(--accent);
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 800;
    box-shadow: 0 2px 8px rgba(255, 92, 2, 0.3);
}

.card-body {
    padding: 24px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.card-body h3 {
    font-size: 20px;
    color: var(--text-main);
    margin-bottom: 6px;
    font-weight: 700;
}

.card-body p {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 20px;
    flex-grow: 1;
}

.card-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    border-top: 1px solid #F1F5F9;
    padding-top: 14px;
    text-transform: uppercase;
}

.card-meta i {
    color: var(--accent);
}

/* =========================================
   VISOR FULLSCREEN & DIAPOSITIVAS
   ========================================= */
#viewer-screen {
    background-color: #000;
    z-index: 1000;
}

.iframe-wrapper {
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

#presentation-frame {
    width: 100%;
    height: 100%;
    border: none;
    background: #000;
}

.btn-close-viewer {
    position: fixed;
    top: 25px;
    right: 25px;
    z-index: 1100;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 12px 22px;
    border-radius: 50px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: var(--transition);
}

.btn-close-viewer:hover {
    background: var(--error);
    transform: scale(1.05);
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
}

.btn-icon {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    transition: var(--transition);
    color: inherit;
}

.btn-icon:hover {
    transform: scale(1.2);
    color: var(--error);
}

.presentation-engine {
    background-color: #000000;
    width: 100vw;
    height: 100vh;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.slide-item {
    transition: opacity 0.3s ease-in-out;
}

.slide-item img {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    user-select: none;
    -webkit-user-drag: none;
}

.slide-image-fill {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    user-select: none;
    -webkit-user-drag: none;
}

/* =========================================
   CONTROLES FLOTANTES DEL VISOR
   ========================================= */
.navigation-icons {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    gap: 10px;
    align-items: center;
}

.video-menu-container {
    position: relative;
}

.video-menu-btn, 
.fullscreen-icon {
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    border: none;
    padding: 10px 15px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.3s ease;
}

.video-menu-btn:hover, 
.fullscreen-icon:hover {
    background: rgba(0, 0, 0, 0.8);
}


/* --- ESTILOS DEL LOGOTIPO DIME (RESPONSIVE) --- */
.logo-container {
    text-align: center;
    margin-bottom: 20px;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.brand-logo {
    max-width: 220px;  /* Controla el tamaño máximo ideal para que no domine la pantalla */
    width: 100%;       /* Permite que se reduzca en pantallas pequeñas */
    height: auto;      /* Mantiene la proporción original de la imagen */
    display: block;
}

/* Opcional: Ajuste específico para celulares muy estrechos */
@media (max-width: 480px) {
    .brand-logo {
        max-width: 160px;
    }
}