/* ========================================
   LOGIN / SIGNUP MODAL STYLES
   ======================================== */

.login-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Ocultar modal cuando el usuario está autenticado */
body.authenticated .login-modal-overlay {
    display: none !important;
}

.login-modal-container {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 420px;
    padding: 40px;
    animation: slideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

.login-modal-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-modal-header h1 {
    font-size: 28px;
    color: #333;
    margin: 0 0 8px 0;
}

.login-modal-header p {
    font-size: 14px;
    color: #999;
    margin: 0;
}

/* TABS */
.login-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 30px;
    border-bottom: 2px solid #f0f0f0;
}

.login-tab-btn {
    flex: 1;
    padding: 12px 16px;
    border: none;
    background: none;
    color: #999;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.login-tab-btn:hover {
    color: #667eea;
}

.login-tab-btn.active {
    color: #667eea;
    border-bottom-color: #667eea;
}

/* TAB CONTENT */
.login-tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

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

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

/* FORM GROUPS */
.login-form-group,
.form-group {
    margin-bottom: 20px;
}

.login-form-group label,
.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.login-form-group input,
.form-group input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.login-form-group input:focus,
.form-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.login-form-group input::placeholder,
.form-group input::placeholder {
    color: #ccc;
}

/* PASSWORD CONTROL */
.password-control {
    display: flex;
    gap: 8px;
}

.password-control input {
    flex: 1;
}

/* BUTTONS */
.login-btn {
    width: 100%;
    padding: 12px 16px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.login-btn.primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.login-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.login-btn.primary:active {
    transform: translateY(0);
}

.btn-small {
    padding: 8px 16px;
    font-size: 12px;
    border: 1px solid #ddd;
    background: white;
    color: #333;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-small:hover {
    background: #f5f5f5;
    border-color: #667eea;
    color: #667eea;
}

.btn-small.primary {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.btn-small.primary:hover {
    background: #764ba2;
    border-color: #764ba2;
}

/* DIVIDER */
.login-divider {
    text-align: center;
    color: #ccc;
    margin: 20px 0;
    font-size: 12px;
    text-transform: uppercase;
}

.login-divider::before,
.login-divider::after {
    content: '';
    display: inline-block;
    width: 40%;
    height: 1px;
    background: #ddd;
    vertical-align: middle;
    margin: 0 8px;
}

/* HELP TEXT */
.login-help-text {
    font-size: 12px;
    color: #999;
    text-align: center;
    margin: 0;
}

.login-modal-footer {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #f0f0f0;
}

/* ========================================
   MASTER ADMIN PANEL STYLES
   ======================================== */

.master-admin-panel {
    position: fixed;
    right: -400px;
    top: 0;
    width: 400px;
    height: 100vh;
    background: white;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    z-index: 999;
    overflow-y: auto;
    transition: right 0.3s ease;
}

.master-admin-panel.open {
    right: 0;
}

.admin-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #f0f0f0;
    position: sticky;
    top: 0;
    background: white;
}

.admin-panel-header h2 {
    margin: 0;
    font-size: 18px;
    color: #333;
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
    transition: color 0.3s ease;
}

.close-btn:hover {
    color: #333;
}

.admin-panel-content {
    padding: 20px;
}

.admin-section {
    margin-bottom: 30px;
}

.admin-section h3 {
    margin: 0 0 15px 0;
    font-size: 16px;
    color: #333;
}

.info-box {
    background: linear-gradient(135deg, #f8f9ff 0%, #ffffff 100%);
    padding: 18px;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(102, 126, 234, 0.15);
    border: 1px solid rgba(102, 126, 234, 0.1);
}

.info-box p {
    margin: 8px 0;
    font-size: 13px;
    color: #666;
}

.info-box strong {
    color: #333;
}

.users-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 15px;
    max-height: 400px;
    overflow-y: auto;
}

.user-item {
    padding: 12px;
    background: #f8f9fa;
    border-radius: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
}

.user-item-email {
    font-weight: 500;
    color: #333;
}

.user-item-badge {
    display: inline-block;
    padding: 2px 8px;
    background: #667eea;
    color: white;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    margin-left: 8px;
}

.user-item-actions {
    display: flex;
    gap: 8px;
}

.user-item-btn {
    padding: 4px 12px;
    font-size: 11px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.user-item-btn.delete {
    background: #fee;
    color: #c33;
}

.user-item-btn.delete:hover {
    background: #fdd;
}

.user-item-btn.admin {
    background: #fff3cd;
    color: #856404;
}

.user-item-btn.admin:hover {
    background: #ffe69c;
}

/* MASTER PANEL BUTTON */
.master-panel-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    transition: all 0.3s ease;
    z-index: 500;
}

.master-panel-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.master-panel-btn:active {
    transform: scale(0.95);
}

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

@media (max-width: 600px) {
    .login-modal-container {
        max-width: 90%;
        padding: 30px 20px;
    }

    .master-admin-panel {
        width: 100%;
        right: -100%;
    }

    .login-modal-overlay {
        z-index: 999;
    }

    .master-admin-panel {
        z-index: 1001;
    }
}

/* ========================================
   NOTIFICACIONES
   ======================================== */

.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 16px 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-width: 400px;
    animation: notificationSlide 0.3s ease;
    z-index: 2000;
}

@keyframes notificationSlide {
    from {
        opacity: 0;
        transform: translateX(400px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.notification.success {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    color: #166534;
    border: 1px solid rgba(34, 197, 94, 0.2);
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.12);
}

.notification.error {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    color: #991b1b;
    border: 1px solid rgba(239, 68, 68, 0.2);
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.12);
}

.notification.info {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    color: #1e40af;
    border: 1px solid rgba(59, 130, 246, 0.2);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.12);
}

.notification.warning {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    color: #92400e;
    border: 1px solid rgba(245, 158, 11, 0.2);
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.12);
}

/* ========================================
   BOTÓN FLOTANTE LOGIN MÓVIL
   ======================================== */

.mobile-login-btn {
    display: none; /* Oculto por defecto */
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    z-index: 1100;
    transition: all 0.3s ease;
    letter-spacing: 0.3px;
}

.mobile-login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.5);
}

.mobile-login-btn:active {
    transform: translateY(0);
}

/* Estilos para móvil */
@media (max-width: 768px) {
    /* Mostrar botón flotante solo cuando no hay usuario autenticado */
    body:not(.authenticated) .mobile-login-btn {
        display: block;
    }
    
    /* En móvil, el modal debe ocupar toda la pantalla */
    body:not(.authenticated) .login-modal-overlay {
        display: flex;
        align-items: flex-start;
    }
    
    body:not(.authenticated) .login-modal-container {
        max-width: 100% !important;
        max-height: 100vh !important;
        height: 100vh;
        border-radius: 0;
        margin: 0;
        padding: 0 !important;
    }
    
    /* Por defecto en móvil, mostrar solo la columna izquierda (tutorial) */
    body:not(.authenticated) .login-modal-container > div[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
        height: 100vh !important;
    }
    
    /* Ocultar la columna derecha (formulario) por defecto */
    body:not(.authenticated) .login-modal-container > div[style*="grid-template-columns"] > div:last-child {
        display: none !important;
    }
    
    /* Ajustar padding de la columna izquierda en móvil */
    body:not(.authenticated) .login-modal-container > div[style*="grid-template-columns"] > div:first-child {
        padding: 30px 20px !important;
    }
    
    /* Cuando se hace clic en el botón, mostrar solo el formulario */
    body:not(.authenticated) .login-modal-container.show-login-form > div[style*="grid-template-columns"] > div:first-child {
        display: none !important;
    }
    
    body:not(.authenticated) .login-modal-container.show-login-form > div[style*="grid-template-columns"] > div:last-child {
        display: block !important;
        padding: 30px 20px;
        overflow-y: auto;
    }
}
