/* ==========================================================================
   AETHER SOCIAL - PREMIUM CSS DESIGN SYSTEM (ESPAÑOL)
   ========================================================================== */

:root {
    --bg-deep: #05070f;
    --bg-card: rgba(13, 16, 31, 0.45);
    --border-color: rgba(255, 255, 255, 0.08);
    --color-primary: #8b5cf6; /* Violet */
    --color-secondary: #d946ef; /* Fuchsia */
    --color-success: #10b981; /* Emerald */
    --color-warning: #f59e0b; /* Amber */
    --color-error: #ef4444; /* Rose */
}

/* Reset de Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}
::-webkit-scrollbar-thumb {
    background: rgba(139, 92, 246, 0.2);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(139, 92, 246, 0.4);
}

/* Efectos de Nebulosas Flotantes (Orbes) */
.glow-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(140px);
    opacity: 0.15;
    z-index: 0;
    pointer-events: none;
    animation: orbFloat 25s infinite alternate ease-in-out;
}
.orb-1 {
    width: 450px;
    height: 450px;
    background: radial-gradient(circle, var(--color-primary) 0%, rgba(0,0,0,0) 70%);
    top: -50px;
    left: -50px;
}
.orb-2 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--color-secondary) 0%, rgba(0,0,0,0) 70%);
    bottom: -100px;
    right: -100px;
    animation-delay: -5s;
    animation-duration: 35s;
}
.orb-3 {
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, #3b82f6 0%, rgba(0,0,0,0) 70%);
    top: 40%;
    left: 45%;
    animation-delay: -10s;
    animation-duration: 40s;
}

@keyframes orbFloat {
    0% {
        transform: translate(0, 0) scale(1);
    }
    50% {
        transform: translate(50px, -50px) scale(1.1);
    }
    100% {
        transform: translate(-30px, 40px) scale(0.95);
    }
}

/* Sidebar y Panel Principal */
.sidebar {
    background: rgba(6, 8, 18, 0.6);
    backdrop-filter: blur(20px);
    border-right: 1px solid var(--border-color);
}

.glass-panel {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.glass-panel:hover {
    border-color: rgba(139, 92, 246, 0.25);
    box-shadow: 0 12px 40px 0 rgba(139, 92, 246, 0.05);
}

/* Items de Navegación */
.nav-item {
    color: #94a3b8;
    transition: all 0.3s ease;
}
.nav-item:hover {
    color: #f1f5f9;
    background: rgba(255, 255, 255, 0.03);
}
.nav-item.active {
    color: #ffffff;
    background: linear-gradient(90deg, rgba(139, 92, 246, 0.15) 0%, rgba(217, 70, 239, 0.03) 100%);
    border-left: 3px solid var(--color-primary);
    box-shadow: inset 4px 0 15px rgba(139, 92, 246, 0.05);
}

/* Tarjetas de Estadística */
.stat-card {
    position: relative;
    overflow: hidden;
}
.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--color-primary), var(--color-secondary));
    opacity: 0.7;
}

/* Botones con Brillo */
.action-btn-primary {
    position: relative;
    overflow: hidden;
}
.action-btn-primary::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.13) 0%, rgba(255,255,255,0) 80%);
    transition: all 0.5s ease;
    opacity: 0;
    transform: scale(0.5);
    pointer-events: none;
}
.action-btn-primary:hover::after {
    opacity: 1;
    transform: scale(1);
}

/* Checkboxes de Plataforma */
.platform-checkbox input:checked + i + span {
    color: #ffffff;
}
.platform-checkbox {
    transition: all 0.3s ease;
}
.platform-checkbox:has(input:checked) {
    background: rgba(139, 92, 246, 0.12);
    border-color: rgba(139, 92, 246, 0.35);
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.15);
}

/* Interruptor Toggles */
.switch {
    display: inline-block;
    height: 24px;
    position: relative;
    width: 44px;
}
.switch input {
    display: none;
}
.slider {
    background-color: rgba(255, 255, 255, 0.1);
    bottom: 0;
    cursor: pointer;
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
    transition: .4s;
    border: 1px solid rgba(255, 255, 255, 0.05);
}
.slider:before {
    background-color: #cbd5e1;
    bottom: 3px;
    content: "";
    height: 16px;
    left: 3px;
    position: absolute;
    transition: .4s;
    width: 16px;
}
.slider.round {
    border-radius: 34px;
}
.slider.round:before {
    border-radius: 50%;
}
.switch input:checked + .slider {
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
}
.switch input:checked + .slider:before {
    transform: translateX(20px);
    background-color: #ffffff;
}

/* Componentes del Calendario */
.calendar-column {
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid rgba(255, 255, 255, 0.03);
    min-height: 400px;
    transition: all 0.3s ease;
}
.calendar-column:hover {
    background: rgba(255, 255, 255, 0.02);
    border-color: rgba(255, 255, 255, 0.06);
}

.calendar-card {
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: pointer;
}
.calendar-card:hover {
    transform: translateY(-2px);
    filter: brightness(1.1);
}

.status-indicator {
    height: 6px;
    width: 6px;
    border-radius: 50%;
}
/* Estados en español */
.status-borrador { background-color: var(--color-warning); box-shadow: 0 0 8px var(--color-warning); }
.status-programado { background-color: var(--color-primary); box-shadow: 0 0 8px var(--color-primary); }
.status-publicado { background-color: var(--color-success); box-shadow: 0 0 8px var(--color-success); }
.status-fallido { background-color: var(--color-error); box-shadow: 0 0 8px var(--color-error); }

/* Terminal Logs */
.log-row {
    animation: fadeIn 0.4s ease;
    border-left: 2px solid transparent;
    padding-left: 8px;
}
.log-INFO { border-color: #3b82f6; color: #93c5fd; }
.log-SUCCESS { border-color: var(--color-success); color: #6ee7b7; }
.log-WARNING { border-color: var(--color-warning); color: #fde047; }
.log-ERROR { border-color: var(--color-error); color: #fca5a5; }

/* Animaciones */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-scale-up {
    animation: scaleUp 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes scaleUp {
    from { transform: scale(0.94); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* Modales */
.modal-container {
    backdrop-filter: blur(8px);
    transition: all 0.3s ease;
}

/* Previsualización Estilo Post */
.mock-post-card {
    background: rgba(10, 11, 21, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

/* ==========================================================================
   OPTIMIZACIONES Y SOPORTE RESPONSIVO (MÓVIL/TABLET)
   ========================================================================== */

/* Prevención de desbordamiento horizontal y saltos de línea elegantes */
p, span, h1, h2, h3, h4, h5, h6 {
    word-wrap: break-word;
    word-break: break-word;
}

.white-space-pre {
    white-space: pre-wrap !important;
}

/* Efectos visuales de cristal y sombras premium en móviles */
@media (max-width: 1023px) {
    .sidebar {
        background: rgba(6, 8, 18, 0.95) !important; /* Más opaco para mejor legibilidad sobre el contenido */
        box-shadow: 15px 0 45px rgba(0, 0, 0, 0.85);
    }
    
    /* Reducir márgenes de vistas principales para maximizar el espacio móvil */
    main {
        padding-top: 1.5rem !important;
    }
}

@media (max-width: 640px) {
    /* Ajustes menores para tarjetas estadísticas y botones en teléfonos ultra pequeños (e.g. 360px) */
    .stat-card {
        padding: 1.25rem !important;
    }
    
    /* El header móvil flota elegantemente */
    header {
        margin-bottom: 1.5rem !important;
    }
}

/* ==========================================================================
   SISTEMA DE TEMAS VISUALES HSL (INTEGRAL EN VIVO)
   ========================================================================== */

/* 1. Nebulosa Espacial (Por defecto / Neon Ciberpunk Suave) */
body.theme-nebulosa {
    --bg-deep: #05070f;
    --bg-card: rgba(13, 16, 31, 0.45);
    --border-color: rgba(255, 255, 255, 0.08);
    --color-primary: #8b5cf6; /* Violet */
    --color-secondary: #d946ef; /* Fuchsia */
    --color-glow-1: rgba(139, 92, 246, 0.15);
    --color-glow-2: rgba(217, 70, 239, 0.15);
}

/* 2. Ciberpunk Neon Eléctrico */
body.theme-ciberpunk {
    --bg-deep: #000000;
    --bg-card: rgba(8, 8, 8, 0.85);
    --border-color: rgba(255, 0, 127, 0.25);
    --color-primary: #39ff14; /* Neon Green */
    --color-secondary: #ff007f; /* Neon Pink */
    --color-glow-1: rgba(57, 255, 20, 0.15);
    --color-glow-2: rgba(255, 0, 127, 0.15);
}
body.theme-ciberpunk .nav-item.active {
    background: linear-gradient(90deg, rgba(57, 255, 20, 0.15) 0%, rgba(255, 0, 127, 0.03) 100%) !important;
    border-left-color: #39ff14 !important;
}
body.theme-ciberpunk .stat-card::before {
    background: linear-gradient(90deg, #39ff14, #ff007f) !important;
}
body.theme-ciberpunk .action-btn-primary, 
body.theme-ciberpunk button[type="submit"], 
body.theme-ciberpunk button[onclick*="generarPublicacionesIA"] {
    background: linear-gradient(to right, #00c853, #39ff14) !important;
    color: #000000 !important;
    font-weight: 800 !important;
    box-shadow: 0 0 15px rgba(57, 255, 20, 0.3) !important;
}

/* 3. Aurora Boreal Mágica */
body.theme-aurora {
    --bg-deep: #020b0d;
    --bg-card: rgba(8, 22, 26, 0.55);
    --border-color: rgba(16, 185, 129, 0.15);
    --color-primary: #10b981; /* Emerald */
    --color-secondary: #06b6d4; /* Cyan */
    --color-glow-1: rgba(16, 185, 129, 0.15);
    --color-glow-2: rgba(6, 182, 212, 0.15);
}
body.theme-aurora .nav-item.active {
    background: linear-gradient(90deg, rgba(16, 185, 129, 0.15) 0%, rgba(6, 182, 212, 0.03) 100%) !important;
    border-left-color: #10b981 !important;
}
body.theme-aurora .stat-card::before {
    background: linear-gradient(90deg, #10b981, #06b6d4) !important;
}

/* 4. Oscuro Clásico Moderno (Sleek Slate) */
body.theme-oscuro {
    --bg-deep: #0f172a; /* Slate 900 */
    --bg-card: rgba(30, 41, 59, 0.65); /* Slate 800 */
    --border-color: rgba(255, 255, 255, 0.06);
    --color-primary: #3b82f6; /* Blue 500 */
    --color-secondary: #64748b; /* Slate 500 */
    --color-glow-1: rgba(59, 130, 246, 0.1);
    --color-glow-2: rgba(100, 116, 139, 0.1);
}
body.theme-oscuro .nav-item.active {
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.12) 0%, rgba(255, 255, 255, 0.01) 100%) !important;
    border-left-color: #3b82f6 !important;
}
body.theme-oscuro .stat-card::before {
    background: linear-gradient(90deg, #3b82f6, #64748b) !important;
}

/* Propagación de colores de Nebulosa */
body {
    background-color: var(--bg-deep);
    transition: background-color 0.5s ease, color 0.3s ease;
}

/* Tarjetas de Selección de Tema */
.theme-select-card {
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1px solid rgba(255, 255, 255, 0.05);
}
.theme-select-card.active {
    border-color: var(--color-primary) !important;
    background: rgba(139, 92, 246, 0.08);
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.15), inset 0 0 10px rgba(139, 92, 246, 0.05);
}
body.theme-ciberpunk .theme-select-card.active {
    background: rgba(57, 255, 20, 0.05) !important;
    box-shadow: 0 0 20px rgba(57, 255, 20, 0.15) !important;
}
body.theme-aurora .theme-select-card.active {
    background: rgba(16, 185, 129, 0.05) !important;
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.15) !important;
}
body.theme-oscuro .theme-select-card.active {
    background: rgba(59, 130, 246, 0.05) !important;
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.1) !important;
}

/* Micro-animación spin lento para iconos */
.animate-spin-slow {
    animation: spinSlow 8s linear infinite;
}
@keyframes spinSlow {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Sub-pestañas de Configuración (Fase 13) */
.subnav-config-item {
    color: #94a3b8;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
}
.subnav-config-item:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.04);
}
.subnav-config-item.active {
    color: #ffffff;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.2) 0%, rgba(217, 70, 239, 0.1) 100%) !important;
    border-color: var(--color-primary) !important;
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.15);
}

/* Barra de Desplazamiento Premium de Alto Contraste para el Chat del Inbox CRM y Listas */
#inbox-chat-messages-container,
#inbox-list-container,
#dashboard-drafts-list {
    scrollbar-width: thin !important;
    scrollbar-color: #8b5cf6 rgba(13, 16, 31, 0.7) !important;
}

#inbox-chat-messages-container::-webkit-scrollbar,
#inbox-list-container::-webkit-scrollbar,
#dashboard-drafts-list::-webkit-scrollbar {
    width: 8px !important;
    height: 8px !important;
}

#inbox-chat-messages-container::-webkit-scrollbar-track,
#inbox-list-container::-webkit-scrollbar-track,
#dashboard-drafts-list::-webkit-scrollbar-track {
    background: rgba(13, 16, 31, 0.75) !important;
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
    border-radius: 20px !important;
}

#inbox-chat-messages-container::-webkit-scrollbar-thumb,
#inbox-list-container::-webkit-scrollbar-thumb,
#dashboard-drafts-list::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #8b5cf6 0%, #d946ef 100%) !important; /* Degradado de Violeta a Fucsia */
    border: 2px solid rgba(13, 16, 31, 0.8) !important;
    border-radius: 20px !important;
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.5) !important;
    transition: all 0.3s ease !important;
}

#inbox-chat-messages-container::-webkit-scrollbar-thumb:hover,
#inbox-list-container::-webkit-scrollbar-thumb:hover,
#dashboard-drafts-list::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #a78bfa 0%, #f472b6 100%) !important; /* Degradado más brillante al pasar el cursor */
    box-shadow: 0 0 15px rgba(217, 70, 239, 0.8) !important;
}

/* Animación de error (sacudida/shake) para el formulario de login */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-6px); }
    40%, 80% { transform: translateX(6px); }
}
.animate-shake {
    animation: shake 0.4s ease-in-out !important;
}

/* Efecto de fade-out suave para ocultar el overlay de Login */
.opacity-0 {
    opacity: 0 !important;
    pointer-events: none !important;
}



