/**
 * Estilos para el plugin Secciones
 * v2.1.2 - ACTUALIZADO: Manteniendo estilos originales + nuevas funcionalidades
 */

/* === RESET Y BASE === */
.scc-container {
    position: relative;
    width: 100%;
    height: 100vh;
    overflow: hidden;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* === LOGO FIJO === */
.scc-logo-container {
    position: absolute; /* CORREGIDO: absolute en lugar de fixed */
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    /* CORREGIDO: Logo sin fondo blanco, más discreto */
    padding: 10px 20px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.scc-logo-container img {
    max-height: 60px;
    width: auto;
    display: block;
}

.scc-logo-container.hidden {
    display: none;
}

/* === BARRA DE PROGRESO === */
.scc-progress-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: rgba(0, 0, 0, 0.1);
    z-index: 999;
}

.scc-progress-bar {
    height: 100%;
    width: 0%;
    background: #2271b1; /* Color por defecto - será personalizable */
    transition: width linear;
}

/* === CONTENEDOR PRINCIPAL === */
.slide-group {
    width: 100%;
    height: 100vh; /* CORREGIDO: Altura completa de viewport */
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    /* Gradiente por defecto - será reemplazado por opciones personalizadas */
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* CORREGIDO: Aplicar padding al slide-group cuando hay logo */
.scc-container.has-logo .slide-group {
    padding-top: 100px; /* Espacio para el logo */
}

/* === VIDEO DE FONDO === */
.scc-bg-video-element {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    object-fit: cover;
    z-index: -1;
}

/* === CONTENEDOR PRINCIPAL DE GRUPO === */
.group.single-column-container {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* === CONTENEDOR DE SLIDES === */
.slides-container {
    position: relative;
    width: 100%;
    max-width: 600px; /* MANTENIDO: Como en el original */
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* === SLIDES INDIVIDUALES === */
.section {
    /* Posicionamiento */
    position: relative;
    width: 100%;
    padding: 20px;
    margin: 0;
    list-style: none;
    
    /* Estilos visuales - MANTENIDOS DEL ORIGINAL */
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    overflow-y: auto;
    max-height: calc(100vh - 120px);
    
    /* VISIBILIDAD: Oculto por defecto */
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    
    /* Transiciones suaves */
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

/* Slide activo */
.section.active {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    z-index: 10 !important;
}

/* Slides vacíos */
.section.empty {
    min-height: 400px;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.8);
}

.section.empty.active {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* === ITEMS DE CONSULTORIOS - ESTILOS ORIGINALES MANTENIDOS === */
.section li {
    background: #fff;
    margin: 8px 0;
    padding: 12px 15px;
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    border-left: 3px solid #2271b1;
    animation: slideInUp 0.4s ease forwards;
    opacity: 0;
    transform: translateY(20px);
    
    /* GRID LAYOUT PARA 2 COLUMNAS - ORIGINAL */
    display: grid !important;
    grid-template-columns: 80px 1fr;
    grid-template-rows: auto auto;
    gap: 8px 15px;
    align-items: center;
    min-height: 60px;
    
    /* ELIMINADO: hover y efectos interactivos */
}

/* Animaciones escalonadas - MANTENIDAS */
.section li:nth-child(1) { animation-delay: 0.1s; }
.section li:nth-child(2) { animation-delay: 0.2s; }
.section li:nth-child(3) { animation-delay: 0.3s; }
.section li:nth-child(4) { animation-delay: 0.4s; }
.section li:nth-child(5) { animation-delay: 0.5s; }
.section li:nth-child(6) { animation-delay: 0.6s; }
.section li:nth-child(7) { animation-delay: 0.7s; }
.section li:nth-child(8) { animation-delay: 0.8s; }
.section li:nth-child(9) { animation-delay: 0.9s; }
.section li:nth-child(10) { animation-delay: 1.0s; }

/* Número del consultorio - ORIGINAL */
.section li .post_title {
    grid-column: 1 / 2;
    grid-row: 1 / 3;
    font-size: 16px;
    font-weight: 700;
    color: #1d2327;
    background: #f8f9fa;
    padding: 8px 12px;
    border-radius: 4px;
    text-align: center;
    border: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 70px;
    min-height: 45px;
}

/* Nombre del médico - ORIGINAL */
.section li .nombre {
    grid-column: 2 / 3;
    grid-row: 1 / 2;
    font-size: 14px;
    color: #2271b1;
    font-weight: 600;
    margin: 0;
    padding: 0;
    line-height: 1.3;
}

/* Especialidad - ORIGINAL */
.section li .especialidad {
    grid-column: 2 / 3;
    grid-row: 2 / 3;
    font-size: 12px;
    color: #646970;
    font-style: italic;
    margin: 0;
    padding: 0;
    line-height: 1.2;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* === ESTADOS ESPECIALES - ORIGINALES === */
.consultorio-pendiente {
    opacity: 0.8;
    border-left-color: #d63638;
}

.consultorio-pendiente .post_title {
    background: #fff5f5;
    border-color: #fecaca;
    color: #d63638;
}

.consultorio-pendiente .nombre,
.consultorio-pendiente .especialidad {
    color: #d63638 !important;
    font-style: italic;
    opacity: 0.7;
}

/* === ELEMENTOS VACÍOS === */
.empty-item {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    animation: none;
    opacity: 1;
    transform: none;
}

.empty-item img {
    max-width: 200px;
    height: auto;
    opacity: 0.7;
    filter: grayscale(50%);
    border-radius: 8px;
}

/* === DISEÑOS ESPECÍFICOS === */

/* Diseño 2: Pantalla dividida */
.scc-70vh {
    height: 70vh !important;
}

.scc-30vh {
    height: 30vh !important;
    background: #fff;
    border-top: 3px solid #2271b1;
}

.scc-page-content {
    width: 100%;
    position: relative;
    overflow: hidden;
}

.scc-page-iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

/* Diseño 3: Pantalla única completa */
.scc-full-content {
    height: 100vh;
    padding: 0;
}

.scc-full-content .scc-page-iframe {
    height: 100vh;
}

/* === DISEÑO 3: Grid de posts === */
.scc-posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.scc-post-item {
    background: #fff;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-left: 4px solid #2271b1;
    animation: fadeIn 0.5s ease forwards;
    /* ELIMINADO: hover effects */
}

.scc-post-item.consultorio-pendiente {
    border-left-color: #d63638;
    opacity: 0.8;
}

.scc-post-item .post_title {
    font-size: 18px;
    font-weight: 700;
    color: #1d2327;
    margin-bottom: 10px;
    display: block;
}

.scc-post-item .nombre {
    font-size: 14px;
    color: #2271b1;
    font-weight: 500;
    display: block;
    margin-bottom: 5px;
}

.scc-post-item .especialidad {
    font-size: 13px;
    color: #646970;
    font-style: italic;
    display: block;
}

/* === SCROLLBAR PERSONALIZADO === */
.section::-webkit-scrollbar {
    width: 6px;
}

.section::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 3px;
}

.section::-webkit-scrollbar-thumb {
    background: rgba(34, 113, 177, 0.6);
    border-radius: 3px;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .scc-container.has-logo .slide-group {
        padding-top: 80px;
    }
    
    .scc-logo-container {
        top: 10px;
        padding: 8px 15px;
    }
    
    .scc-logo-container img {
        max-height: 40px;
    }
    
    .group.single-column-container {
        padding: 10px;
    }
    
    .slides-container {
        max-width: 100%;
    }
    
    .section {
        padding: 15px;
        border-radius: 8px;
    }
    
    .section li {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
        gap: 8px;
        padding: 15px;
        text-align: center;
    }
    
    .section li .post_title {
        grid-column: 1 / 2;
        grid-row: 1 / 2;
        margin-bottom: 8px;
        min-width: auto;
    }
    
    .section li .nombre {
        grid-column: 1 / 2;
        grid-row: 2 / 3;
        font-size: 15px;
    }
    
    .section li .especialidad {
        grid-column: 1 / 2;
        grid-row: 3 / 4;
        font-size: 13px;
    }
    
    .scc-posts-grid {
        grid-template-columns: 1fr;
        padding: 15px;
        gap: 15px;
    }
}

@media (max-width: 480px) {
    .scc-container.has-logo .slide-group {
        padding-top: 60px;
    }
    
    .scc-logo-container {
        top: 5px;
        padding: 5px 10px;
    }
    
    .scc-logo-container img {
        max-height: 30px;
    }
    
    .group.single-column-container {
        padding: 5px;
    }
    
    .section {
        padding: 10px;
        max-height: calc(100vh - 80px);
    }
    
    .section li {
        margin: 6px 0;
        padding: 12px;
        min-height: 50px;
    }
    
    .section li .post_title {
        font-size: 14px;
        padding: 6px 10px;
        min-height: 40px;
    }
    
    .section li .nombre {
        font-size: 13px;
    }
    
    .section li .especialidad {
        font-size: 11px;
    }
}

/* === UTILIDADES === */
.scc-error {
    color: #e53e3e;
    background: #fed7d7;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    font-weight: 600;
    margin: 20px;
}

.scc-no-page {
    color: #4a5568;
    background: #f7fafc;
    padding: 40px;
    text-align: center;
    font-size: 1.2em;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* === ANIMACIONES === */
@keyframes slideInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* === REGLAS CRÍTICAS DE FORZADO === */
/* Prevenir que múltiples slides sean visibles simultáneamente */
.slides-container .section + .section:not(.active) {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
}

/* Forzar ocultación de slides inactivos */
.slides-container .section:not(.active) {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    z-index: 1 !important;
}

/* Asegurar que solo el slide activo sea completamente visible */
.slides-container .section.active {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    z-index: 10 !important;
    position: relative !important;
}

/* Anular cualquier estilo inline que pueda interferir */
.slides-container .section[style*="display: none"]:not(.active) {
    display: none !important;
}

.slides-container .section[style*="display: block"].active {
    display: block !important;
}

/* === ESTADOS ESPECIALES === */
.consultorio-pendiente {
    background: linear-gradient(145deg, #fff5f5, #fed7d7) !important;
    border-color: rgba(229, 62, 62, 0.2) !important;
}

.consultorio-pendiente::before {
    background: linear-gradient(90deg, #f56565, #e53e3e) !important;
}

.consultorio-pendiente .post_title {
    color: #c53030 !important;
}

.consultorio-pendiente .nombre,
.consultorio-pendiente .especialidad {
    color: #a0aec0 !important;
}

/* === ELEMENTOS VACÍOS === */
.empty-item {
    background: linear-gradient(145deg, #f7fafc, #edf2f7) !important;
    border: 2px dashed #cbd5e0 !important;
    color: #a0aec0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 150px !important;
}

.empty-item img {
    max-width: 80px;
    max-height: 80px;
    opacity: 0.6;
    filter: grayscale(100%);
}

.empty-item span {
    font-size: 1.2em;
    font-weight: 500;
    text-align: center;
}

/* === DISEÑOS ESPECÍFICOS === */

/* Diseño 2: Pantalla dividida */
.scc-70vh {
    height: 70vh !important;
}

.scc-30vh {
    height: 30vh !important;
    background: #f8f9fa;
    border-top: 3px solid #667eea;
}

.scc-page-content {
    width: 100%;
    position: relative;
    overflow: hidden;
}

.scc-page-iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

/* Diseño 3: Pantalla única completa */
.scc-full-content {
    height: 100vh;
    padding: 0;
}

.scc-full-content .scc-page-iframe {
    height: 100vh;
}

/* === RESPONSIVE === */
@media (max-width: 1400px) {
    .section ul {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 20px;
        padding: 25px;
    }
    
    .section li .post_title {
        font-size: 2em;
    }
}

@media (max-width: 1024px) {
    .section ul {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
        gap: 15px;
        padding: 20px;
    }
    
    .section li {
        padding: 20px;
    }
    
    .section li .post_title {
        font-size: 1.8em;
    }
}

@media (max-width: 768px) {
    .scc-container.has-logo {
        padding-top: 60px;
    }
    
    .scc-logo-container {
        top: 10px;
        padding: 8px 15px;
    }
    
    .scc-logo-container img {
        max-height: 40px;
    }
    
    .section {
        width: 95%;
        max-height: 85%;
    }
    
    .section ul {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 12px;
        padding: 15px;
    }
    
    .section li {
        padding: 15px;
    }
    
    .section li .post_title {
        font-size: 1.6em;
        margin-bottom: 10px;
    }
    
    .section li .nombre {
        font-size: 1.2em;
    }
    
    .section li .especialidad {
        font-size: 1em;
    }
}

/* === UTILIDADES === */
.scc-error {
    color: #e53e3e;
    background: #fed7d7;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    font-weight: 600;
    margin: 20px;
}

.scc-no-page {
    color: #4a5568;
    background: #f7fafc;
    padding: 40px;
    text-align: center;
    font-size: 1.2em;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* === DEBUG/DESARROLLO === */
/* Temporal: Para verificar dimensiones en desarrollo */
.scc-container[data-debug="true"] .group.single-column-container {
    border: 2px solid red;
    background: rgba(255, 0, 0, 0.1);
}

.scc-container[data-debug="true"] .slides-container {
    border: 2px solid blue;
    background: rgba(0, 0, 255, 0.1);
}

.scc-container[data-debug="true"] .section {
    border: 2px solid green;
}

/* === FALLBACK PARA CONTENEDORES VACÍOS === */
.group.single-column-container:empty::after {
    content: "No hay contenido disponible";
    display: flex;
    align-items: center;
    justify-content: center;
    height: 200px;
    color: #666;
    font-size: 1.2em;
}

.slides-container:empty::after {
    content: "Cargando slides...";
    display: flex;
    align-items: center;
    justify-content: center;
    height: 200px;
    color: #666;
    font-size: 1.2em;
}

/* === ANIMACIONES === */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(-50px);
    }
}

.section.active {
    animation: slideIn 0.5s ease-out;
}

/* === OCULTAR CONTROLES REMOVIDOS === */
/* Los siguientes selectores están comentados ya que se eliminaron los controles */
/*
.scc-navigation-controls { display: none !important; }
.scc-slide-indicators { display: none !important; }
.scc-nav-button { display: none !important; }
.scc-slide-indicator { display: none !important; }
*/