/**
 * =====================================================
 * ATLAS HEART HEADER - VISUAL STATUS INDICATOR
 * =====================================================
 *
 * Centro de operaciones visual de Atlas - Header fijo
 * con corazón en el centro mostrando estado en tiempo real
 *
 * @project Doctores.cloud
 * @founder Rodolfo Gallegos L.
 * =====================================================
 */

/* Header fijo con corazón */
.atlas-status-header {
    position: fixed;
    top: 0;
    left: 280px; /* Después del sidebar */
    right: 0;
    height: 70px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.98));
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 2px solid #E5E7EB;
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

/* Ajustar main-content para compensar el header */
.main-content {
    margin-top: 70px !important;
}

/* Contenedor del corazón centralizado */
.atlas-heart-center {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 10px 30px;
    background: white;
    border-radius: 50px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

/* Corazón SVG */
.atlas-heart-svg-container {
    width: 50px;
    height: 50px;
    position: relative;
}

#atlas-heart-svg-header {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 0 10px rgba(75, 0, 130, 0.3));
}

/* Estado del sistema */
.atlas-status-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.atlas-status-title {
    font-size: 16px;
    font-weight: 700;
    color: #1E293B;
    transition: all 0.3s ease;
}

.atlas-status-subtitle {
    font-size: 13px;
    color: #64748B;
    font-weight: 500;
}

/* ========== ESTADOS DEL CORAZÓN ========== */

/* IDLE - Verde suave (esperando "Dr. Atlas") */
.atlas-heart-center.state-idle .gradient-start {
    stop-color: #10B981;
    animation: gradientPulseIdle 4s ease-in-out infinite;
}

.atlas-heart-center.state-idle .gradient-end {
    stop-color: #34D399;
    animation: gradientPulseIdle 4s ease-in-out infinite reverse;
}

.atlas-heart-center.state-idle .heart-path {
    animation: heartbeatIdle 3s ease-in-out infinite;
}

.atlas-heart-center.state-idle .atlas-status-title {
    color: #10B981;
}

.atlas-heart-center.state-idle {
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.2);
}

/* LISTENING - Azul brillante (escuchando comando) */
.atlas-heart-center.state-listening .gradient-start {
    stop-color: #3B82F6;
    animation: gradientPulseActive 1.2s ease-in-out infinite;
}

.atlas-heart-center.state-listening .gradient-end {
    stop-color: #60A5FA;
    animation: gradientPulseActive 1.2s ease-in-out infinite reverse;
}

.atlas-heart-center.state-listening .heart-path {
    animation: heartbeatActive 0.8s ease-in-out infinite;
    filter: brightness(1.3) drop-shadow(0 0 15px rgba(59, 130, 246, 0.6));
}

.atlas-heart-center.state-listening .wave {
    opacity: 1;
    animation: waveExpand 2s ease-out infinite;
}

.atlas-heart-center.state-listening .wave-2 {
    animation-delay: 0.5s;
}

.atlas-heart-center.state-listening .atlas-status-title {
    color: #3B82F6;
}

.atlas-heart-center.state-listening {
    box-shadow: 0 4px 30px rgba(59, 130, 246, 0.4);
}

/* PROCESSING - Morado dinámico (procesando IA) */
.atlas-heart-center.state-processing .gradient-start {
    stop-color: #8B5CF6;
    animation: gradientShiftThinking 0.8s linear infinite;
}

.atlas-heart-center.state-processing .gradient-end {
    stop-color: #A78BFA;
    animation: gradientShiftThinking 0.8s linear infinite reverse;
}

.atlas-heart-center.state-processing .heart-path {
    animation: heartbeatThinking 0.6s ease-in-out infinite;
    filter: brightness(1.4) drop-shadow(0 0 20px rgba(139, 92, 246, 0.7));
}

.atlas-heart-center.state-processing .wave {
    opacity: 0.8;
    animation: waveThinking 1s linear infinite;
}

.atlas-heart-center.state-processing .atlas-status-title {
    color: #8B5CF6;
}

.atlas-heart-center.state-processing {
    box-shadow: 0 4px 30px rgba(139, 92, 246, 0.4);
}

/* ERROR - Rojo (error en el sistema) */
.atlas-heart-center.state-error .gradient-start {
    stop-color: #EF4444;
}

.atlas-heart-center.state-error .gradient-end {
    stop-color: #F87171;
}

.atlas-heart-center.state-error .heart-path {
    animation: heartbeatError 1.5s ease-in-out infinite;
}

.atlas-heart-center.state-error .atlas-status-title {
    color: #EF4444;
}

.atlas-heart-center.state-error {
    box-shadow: 0 4px 30px rgba(239, 68, 68, 0.3);
}

/* ========== ANIMACIONES ========== */

@keyframes heartbeatIdle {
    0%, 100% {
        transform: scale(1);
    }
    10% {
        transform: scale(1.05);
    }
    20% {
        transform: scale(1);
    }
    30% {
        transform: scale(1.03);
    }
    40% {
        transform: scale(1);
    }
}

@keyframes heartbeatActive {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.15);
    }
}

@keyframes heartbeatThinking {
    0%, 100% {
        transform: scale(1) rotate(0deg);
    }
    50% {
        transform: scale(1.1) rotate(2deg);
    }
}

@keyframes heartbeatError {
    0%, 100% {
        transform: scale(1);
    }
    25% {
        transform: scale(1.1);
    }
    50% {
        transform: scale(0.95);
    }
    75% {
        transform: scale(1.05);
    }
}

@keyframes gradientPulseIdle {
    0%, 100% {
        stop-opacity: 0.8;
    }
    50% {
        stop-opacity: 1;
    }
}

@keyframes gradientPulseActive {
    0%, 100% {
        stop-opacity: 1;
    }
    50% {
        stop-opacity: 0.7;
    }
}

@keyframes gradientShiftThinking {
    0%, 100% {
        stop-opacity: 1;
    }
    50% {
        stop-opacity: 0.6;
    }
}

@keyframes waveExpand {
    0% {
        transform: scale(0.8);
        stroke-opacity: 1;
    }
    100% {
        transform: scale(1.5);
        stroke-opacity: 0;
    }
}

@keyframes waveThinking {
    0% {
        transform: scale(0.9) rotate(0deg);
        stroke-opacity: 0.8;
    }
    100% {
        transform: scale(1.4) rotate(360deg);
        stroke-opacity: 0;
    }
}

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

@media (max-width: 768px) {
    .atlas-status-header {
        left: 0;
        height: 60px;
    }

    .main-content {
        margin-top: 60px !important;
    }

    .atlas-heart-center {
        padding: 8px 20px;
    }

    .atlas-heart-svg-container {
        width: 40px;
        height: 40px;
    }

    .atlas-status-title {
        font-size: 14px;
    }

    .atlas-status-subtitle {
        font-size: 11px;
    }
}

/* Ocultar el corazón viejo del FAB */
#atlas-heart-container {
    display: none !important;
}
