/**
 * EventLive Auth - Popup Styles
 * Modal/Popup specific styles
 */

/* ========================================
   POPUP CONTAINER
======================================== */
#ela-popup {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

#ela-popup.active {
    display: flex !important;
}

body.ela-popup-active {
    overflow: hidden;
}

/* Overlay */
.ela-popup-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    animation: ela-fadeIn 0.3s ease;
}

@keyframes ela-fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ========================================
   POPUP WRAPPER
======================================== */
.ela-popup-wrapper {
    position: relative;
    width: 100%;
    max-width: 800px;
    max-height: 90vh;
    overflow: hidden;
    z-index: 1;
    animation: ela-slideUp 0.3s ease;
    border-radius: 12px;
}

@keyframes ela-slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   POPUP CONTENT
======================================== */
.ela-popup-content {
    display: flex;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    position: relative;
    flex-direction: row;
}

/* ========================================
   SPLIT LAYOUT - IMAGEN
======================================== */
.ela-popup-image {
    flex-shrink: 0;
    overflow: hidden;
    position: relative;
}

.ela-popup-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ========================================
   FORM CONTAINER
======================================== */
.ela-popup-form-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

/* Close Button */
.ela-popup-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.05);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
}

.ela-popup-close:hover {
    background: rgba(0, 0, 0, 0.1);
    transform: rotate(90deg);
}

.ela-popup-close .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
}

/* ========================================
   POPUP SIDEBAR
======================================== */
.ela-popup-sidebar {
    flex: 0 0 40%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    position: relative;
    overflow: hidden;
}

.ela-popup-sidebar::before {
    content: '';
    position: absolute;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: ela-pulse 4s ease-in-out infinite;
}

@keyframes ela-pulse {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

.ela-popup-sidebar img {
    max-width: 100%;
    height: auto;
    position: relative;
    z-index: 1;
    border-radius: 8px;
}

/* ========================================
   POPUP MAIN
======================================== */
.ela-popup-main {
    flex: 1;
    padding: 40px;
}

/* Header */
.ela-popup-header {
    text-align: center;
    margin-bottom: 32px;
}

.ela-popup-header h2 {
    margin: 0;
    font-size: 28px;
    font-weight: 700;
    color: #1e1e1e;
}

.ela-popup-header .custom-logo-link {
    display: inline-block;
}

.ela-popup-header img {
    max-width: 180px;
    height: auto;
}

/* ========================================
   TABS NAVIGATION
======================================== */
.ela-tabs-nav {
    display: flex;
    gap: 8px;
    margin-bottom: 32px;
    background: #f8f9fa;
    padding: 4px;
    border-radius: 10px;
}

.ela-tab-btn {
    flex: 1;
    padding: 12px 20px;
    font-size: 15px;
    font-weight: 600;
    color: #757575;
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.ela-tab-btn:hover {
    color: #1e1e1e;
}

.ela-tab-btn.active {
    background: #ffffff;
    color: #007cba;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* ========================================
   TABS CONTENT
======================================== */
.ela-tabs-content {
    position: relative;
}

.ela-tab-content {
    display: none;
    animation: ela-fadeInTab 0.3s ease;
}

.ela-tab-content.active {
    display: block;
}

@keyframes ela-fadeInTab {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   STYLE VARIATIONS
======================================== */

/* Modern Style (default) */
.ela-style-modern .ela-popup-content {
    border-radius: 12px;
}

.ela-style-modern .ela-popup-sidebar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* Classic Style */
.ela-style-classic .ela-popup-content {
    border-radius: 0;
    border: 2px solid #dcdcdc;
}

.ela-style-classic .ela-popup-sidebar {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
}

.ela-style-classic .ela-tabs-nav {
    border-radius: 0;
}

.ela-style-classic .ela-tab-btn {
    border-radius: 0;
}

/* Minimal Style */
.ela-style-minimal .ela-popup-content {
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

.ela-style-minimal .ela-popup-sidebar {
    background: #f8f9fa;
}

.ela-style-minimal .ela-tabs-nav {
    background: transparent;
    border-bottom: 2px solid #f0f0f0;
    padding: 0;
    border-radius: 0;
}

.ela-style-minimal .ela-tab-btn {
    border-radius: 0;
    border-bottom: 2px solid transparent;
}

.ela-style-minimal .ela-tab-btn.active {
    background: transparent;
    border-bottom-color: #007cba;
    box-shadow: none;
}

/* ========================================
   LAYOUT VARIATIONS
======================================== */

/* Separate Layout (no sidebar) */
.ela-layout-separate .ela-popup-sidebar {
    display: none;
}

.ela-layout-separate .ela-popup-content {
    max-width: 500px;
    margin: 0 auto;
}

/* Single Layout (no tabs) */
.ela-layout-single .ela-tabs-nav {
    display: none;
}

/* ========================================
   RESPONSIVE
======================================== */

/* Tablet y dispositivos medianos */
@media (max-width: 768px) {
    #ela-popup {
        padding: 15px;
    }
    
    .ela-popup-wrapper {
        max-height: 92vh;
        border-radius: 10px;
    }
    
    .ela-popup-content {
        flex-direction: column;
        border-radius: 10px;
    }
    
    /* Ocultar imagen lateral en tablets y móviles */
    .ela-popup-image {
        display: none !important;
    }
    
    .ela-popup-sidebar {
        display: none !important;
    }
    
    .ela-popup-main {
        padding: 25px 20px;
    }
    
    .ela-popup-header {
        margin-bottom: 24px;
    }
    
    .ela-popup-header h2 {
        font-size: 22px;
    }
    
    .ela-popup-header img {
        max-width: 150px;
    }
    
    .ela-tabs-nav {
        margin-bottom: 20px;
        gap: 6px;
        padding: 3px;
    }
    
    .ela-tab-btn {
        padding: 11px 18px;
        font-size: 14px;
    }
    
    .ela-popup-form-container {
        max-height: 85vh;
    }
}

/* Móviles */
@media (max-width: 480px) {
    #ela-popup {
        padding: 8px;
        align-items: flex-end;
    }
    
    .ela-popup-wrapper {
        max-width: 100%;
        max-height: 96vh;
        border-radius: 12px 12px 0 0;
    }
    
    .ela-popup-content {
        border-radius: 12px 12px 0 0;
        width: 100%;
    }
    
    /* Asegurar que la imagen esté oculta en móviles */
    .ela-popup-image {
        display: none !important;
    }
    
    .ela-popup-sidebar {
        display: none !important;
    }
    
    .ela-popup-form-container {
        width: 100%;
    }
    
    .ela-popup-main {
        padding: 20px 16px 24px;
    }
    
    .ela-popup-header {
        margin-bottom: 20px;
    }
    
    .ela-popup-header h2 {
        font-size: 20px;
    }
    
    .ela-popup-header img {
        max-width: 130px;
    }
    
    .ela-tabs-nav {
        margin-bottom: 18px;
        gap: 5px;
        padding: 3px;
        border-radius: 8px;
    }
    
    .ela-tab-btn {
        padding: 12px 16px;
        font-size: 13px;
        border-radius: 6px;
        min-height: 44px; /* Tamaño táctil recomendado */
    }
    
    .ela-popup-close {
        top: 10px;
        right: 10px;
        width: 36px;
        height: 36px;
        background: rgba(0, 0, 0, 0.08);
    }
    
    .ela-popup-close .dashicons {
        font-size: 18px;
        width: 18px;
        height: 18px;
    }
    
    .ela-popup-form-container {
        max-height: 88vh;
    }
    
    /* Ajustar animación para móviles */
    @keyframes ela-slideUp {
        from {
            opacity: 0;
            transform: translateY(100%);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
}

/* Móviles muy pequeños */
@media (max-width: 360px) {
    #ela-popup {
        padding: 5px;
    }
    
    .ela-popup-wrapper {
        max-width: 100%;
        max-height: 98vh;
        border-radius: 10px 10px 0 0;
    }
    
    .ela-popup-content {
        border-radius: 10px 10px 0 0;
        width: 100%;
    }
    
    /* Asegurar que la imagen esté oculta */
    .ela-popup-image {
        display: none !important;
    }
    
    .ela-popup-sidebar {
        display: none !important;
    }
    
    .ela-popup-main {
        padding: 18px 14px 20px;
    }
    
    .ela-popup-header {
        margin-bottom: 16px;
    }
    
    .ela-popup-header h2 {
        font-size: 18px;
    }
    
    .ela-popup-header img {
        max-width: 110px;
    }
    
    .ela-tabs-nav {
        margin-bottom: 16px;
        gap: 4px;
    }
    
    .ela-tab-btn {
        padding: 10px 12px;
        font-size: 12px;
        min-height: 42px;
    }
    
    .ela-popup-close {
        top: 8px;
        right: 8px;
        width: 34px;
        height: 34px;
    }
}

/* Móviles en orientación horizontal */
@media (max-width: 768px) and (orientation: landscape) {
    #ela-popup {
        padding: 10px;
        align-items: center;
    }
    
    .ela-popup-wrapper {
        max-height: 95vh;
        max-width: 100%;
    }
    
    /* Ocultar imagen en landscape */
    .ela-popup-image {
        display: none !important;
    }
    
    .ela-popup-sidebar {
        display: none !important;
    }
    
    .ela-popup-content {
        width: 100%;
    }
    
    .ela-popup-main {
        padding: 20px;
    }
    
    .ela-popup-header {
        margin-bottom: 16px;
    }
    
    .ela-popup-header img {
        max-width: 120px;
    }
    
    .ela-tabs-nav {
        margin-bottom: 16px;
    }
    
    .ela-popup-form-container {
        max-height: 90vh;
    }
}

/* Mejoras para pantallas táctiles */
@media (hover: none) and (pointer: coarse) {
    .ela-tab-btn {
        min-height: 44px; /* iOS/Android recomiendan mínimo 44px */
    }
    
    .ela-popup-close {
        min-width: 44px;
        min-height: 44px;
    }
    
    /* Mejorar feedback táctil */
    .ela-tab-btn:active {
        transform: scale(0.97);
    }
    
    .ela-popup-close:active {
        transform: scale(0.95);
    }
}

/* ========================================
   ANIMATIONS
======================================== */
@keyframes ela-shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.ela-popup-content.shake {
    animation: ela-shake 0.5s ease;
}

/* ========================================
   DARK MODE SUPPORT
======================================== */
@media (prefers-color-scheme: dark) {
    /* Fondo del popup */
    .ela-popup-content {
        background: #1e1e1e;
        color: #e5e5e5;
    }
    
    /* Container del formulario */
    .ela-popup-form-container {
        background: #1e1e1e;
    }
    
    /* Header */
    .ela-popup-header h2 {
        color: #ffffff;
    }
    
    /* Tabs navegación */
    .ela-tabs-nav {
        background: #2a2a2a;
    }
    
    .ela-tab-btn {
        color: #9ca3af;
    }
    
    .ela-tab-btn:hover {
        color: #d1d5db;
    }
    
    .ela-tab-btn.active {
        background: #3a3a3a;
        color: #60a5fa;
    }
    
    /* Botón cerrar */
    .ela-popup-close {
        background: rgba(255, 255, 255, 0.1);
        color: #ffffff;
    }
    
    .ela-popup-close:hover {
        background: rgba(255, 255, 255, 0.2);
    }
    
    /* Sidebar - Ajustar gradiente para dark mode */
    .ela-popup-sidebar {
        background: linear-gradient(135deg, #1e3a8a 0%, #581c87 100%);
    }
    
    /* Main content */
    .ela-popup-main {
        background: #1e1e1e;
    }
}

/* ========================================
   PRINT STYLES
======================================== */
@media print {
    #ela-popup {
        display: none !important;
    }
}

