﻿/* Editor de Imágenes IA - Estilos principales */
.ai-image-editor-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.editor-header {
    text-align: center;
    margin-bottom: 40px;
}

    .editor-header h2 {
        color: #2c3e50;
        font-size: 2.5rem;
        margin-bottom: 10px;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
    }

    .editor-header p {
        color: #7f8c8d;
        font-size: 1.1rem;
    }

/* Sección de carga */
.upload-section {
    margin-bottom: 40px;
}

.upload-area {
    border: 3px dashed #bdc3c7;
    border-radius: 15px;
    padding: 60px 20px;
    text-align: center;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    transition: all 0.3s ease;
    cursor: pointer;
}

    .upload-area:hover {
        border-color: #667eea;
        background: linear-gradient(135deg, #f1f3f4 0%, #e8eaf6 100%);
        transform: translateY(-2px);
    }

    .upload-area.dragover {
        border-color: #667eea;
        background: linear-gradient(135deg, #e8eaf6 0%, #c5cae9 100%);
    }

.upload-content .upload-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    display: block;
}

.upload-content h3 {
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 1.5rem;
}

.upload-content p {
    color: #7f8c8d;
    font-size: 1rem;
}

/* Vista previa de imagen */
.image-preview-section {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 30px;
    margin-bottom: 40px;
}

.image-container {
    background: #fff;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

    .image-container img {
        width: 100%;
        height: auto;
        border-radius: 10px;
        max-height: 500px;
        object-fit: contain;
    }

/* Panel de efectos */
.effects-panel {
    background: #fff;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

    .effects-panel h3 {
        color: #2c3e50;
        margin-bottom: 20px;
        font-size: 1.3rem;
    }

.effects-grid {
    display: grid;
    gap: 15px;
}

.effect-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
}

    .effect-btn:hover {
        border-color: #667eea;
        background: linear-gradient(135deg, #f8f9ff 0%, #e8eaf6 100%);
        transform: translateY(-2px);
    }

    .effect-btn.active {
        border-color: #667eea;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        color: white;
    }

.effect-icon {
    font-size: 1.5rem;
}

.effect-name {
    font-weight: 600;
}

/* Sección de resultados */
.result-section {
    background: #fff;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.before-after {
    margin-bottom: 30px;
}

.image-comparison {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.comparison-item {
    text-align: center;
}

    .comparison-item h4 {
        color: #2c3e50;
        margin-bottom: 15px;
        font-size: 1.2rem;
    }

    .comparison-item img {
        width: 100%;
        height: auto;
        border-radius: 10px;
        max-height: 400px;
        object-fit: contain;
        box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    }

.result-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn-download {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

    .btn-download:hover {
        transform: translateY(-2px);
        box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
    }

.btn-secondary {
    background: #f8f9fa;
    color: #2c3e50;
    border: 2px solid #e9ecef;
}

    .btn-secondary:hover {
        background: #e9ecef;
        transform: translateY(-2px);
    }

/* ========================================
   SPINNER DE CARGA IA - DISEÑO ÉPICO 70s
   ======================================== */

.ai-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
}

    .ai-loading-overlay.active {
        display: flex;
    }

.ai-loading-container {
    position: relative;
    text-align: center;
    color: white;
    max-width: 600px;
    padding: 40px;
}

/* Red Neuronal Animada */
.neural-network {
    position: relative;
    width: 400px;
    height: 200px;
    margin: 0 auto 40px;
}

.neural-layer {
    position: absolute;
    display: flex;
    flex-direction: column;
    gap: 20px;
    justify-content: center;
    height: 100%;
}

.input-layer {
    left: 0;
}

.hidden-layer {
    left: 50%;
    transform: translateX(-50%);
}

.output-layer {
    right: 0;
}

.neuron {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.6);
    animation: neuronPulse 2s ease-in-out infinite;
    position: relative;
}

    .neuron::before {
        content: '';
        position: absolute;
        top: -5px;
        left: -5px;
        right: -5px;
        bottom: -5px;
        border-radius: 50%;
        border: 2px solid rgba(102, 126, 234, 0.3);
        animation: neuronRing 2s ease-in-out infinite;
    }

@keyframes neuronPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 20px rgba(102, 126, 234, 0.6);
    }

    50% {
        transform: scale(1.2);
        box-shadow: 0 0 30px rgba(102, 126, 234, 0.9);
    }
}

@keyframes neuronRing {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }

    50% {
        transform: scale(1.5);
        opacity: 1;
    }

    100% {
        transform: scale(2);
        opacity: 0;
    }
}

/* Conexiones de la red neuronal */
.neural-connections {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.connection {
    stroke: rgba(102, 126, 234, 0.4);
    stroke-width: 2;
    fill: none;
    stroke-dasharray: 5, 5;
    animation: connectionFlow 3s ease-in-out infinite;
}

@keyframes connectionFlow {
    0% {
        stroke-dashoffset: 0;
        stroke: rgba(102, 126, 234, 0.2);
    }

    50% {
        stroke-dashoffset: -10;
        stroke: rgba(102, 126, 234, 0.8);
    }

    100% {
        stroke-dashoffset: -20;
        stroke: rgba(102, 126, 234, 0.2);
    }
}

/* Cerebro AI - Versión épica para 70 segundos */
.ai-brain {
    position: relative;
    width: 140px;
    height: 140px;
    margin: 0 auto 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    animation: brainMorphEpic 6s ease-in-out infinite;
    box-shadow: 0 0 40px rgba(102, 126, 234, 0.6);
}

@keyframes brainMorphEpic {
    0%, 100% {
        border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
        transform: rotate(0deg) scale(1);
        box-shadow: 0 0 40px rgba(102, 126, 234, 0.6);
    }

    16% {
        border-radius: 30% 70% 70% 30% / 30% 60% 40% 70%;
        transform: rotate(10deg) scale(1.05);
        box-shadow: 0 0 50px rgba(240, 147, 251, 0.8);
    }

    33% {
        border-radius: 70% 30% 50% 50% / 50% 70% 30% 60%;
        transform: rotate(-8deg) scale(0.95);
        box-shadow: 0 0 35px rgba(118, 75, 162, 0.7);
    }

    50% {
        border-radius: 50% 50% 30% 70% / 70% 50% 50% 30%;
        transform: rotate(15deg) scale(1.1);
        box-shadow: 0 0 60px rgba(102, 126, 234, 0.9);
    }

    66% {
        border-radius: 40% 60% 60% 40% / 40% 70% 30% 60%;
        transform: rotate(-12deg) scale(0.9);
        box-shadow: 0 0 45px rgba(240, 147, 251, 0.6);
    }

    83% {
        border-radius: 65% 35% 45% 55% / 55% 45% 65% 35%;
        transform: rotate(8deg) scale(1.08);
        box-shadow: 0 0 55px rgba(118, 75, 162, 0.8);
    }
}

.brain-scan {
    position: absolute;
    top: 15%;
    left: 15%;
    width: 70%;
    height: 25%;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.6) 50%, transparent 100%);
    animation: brainScanEpic 3s ease-in-out infinite;
    border-radius: 50%;
}

@keyframes brainScanEpic {
    0%, 100% {
        transform: translateY(-20%) scaleX(0.8) rotate(-5deg);
        opacity: 0.3;
    }

    25% {
        transform: translateY(50%) scaleX(1.2) rotate(0deg);
        opacity: 0.8;
    }

    50% {
        transform: translateY(120%) scaleX(0.9) rotate(5deg);
        opacity: 0.9;
    }

    75% {
        transform: translateY(200%) scaleX(1.1) rotate(-3deg);
        opacity: 0.6;
    }
}

.brain-waves {
    position: absolute;
    top: -30px;
    left: -30px;
    right: -30px;
    bottom: -30px;
}

.wave {
    position: absolute;
    border: 3px solid rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    animation: waveExpandEpic 4s ease-out infinite;
}

.wave-1 {
    animation-delay: 0s;
    border-color: rgba(102, 126, 234, 0.4);
}

.wave-2 {
    animation-delay: 1.3s;
    border-color: rgba(240, 147, 251, 0.4);
}

.wave-3 {
    animation-delay: 2.6s;
    border-color: rgba(118, 75, 162, 0.4);
}

@keyframes waveExpandEpic {
    0% {
        top: 50%;
        left: 50%;
        width: 0;
        height: 0;
        opacity: 1;
        transform: translate(-50%, -50%);
        border-width: 3px;
    }

    50% {
        opacity: 0.6;
        border-width: 2px;
    }

    100% {
        top: -30px;
        left: -30px;
        width: calc(100% + 60px);
        height: calc(100% + 60px);
        opacity: 0;
        transform: translate(0, 0);
        border-width: 1px;
    }
}

/* Contenido de carga - Versión épica 70s */
.loading-content {
    margin-bottom: 40px;
}

#loadingTitle {
    font-size: 2.2rem;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: titlePulse 3s ease-in-out infinite;
}

@keyframes titlePulse {
    0%, 100% {
        transform: scale(1);
        filter: brightness(1);
    }

    50% {
        transform: scale(1.05);
        filter: brightness(1.2);
    }
}

.loading-steps {
    margin-bottom: 30px;
}

.step {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 25px;
    margin-bottom: 12px;
    border-radius: 30px;
    background: rgba(255, 255, 255, 0.08);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0.4;
    border: 2px solid transparent;
}

    .step.active {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
        opacity: 1;
        transform: translateX(15px) scale(1.02);
        box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
        border-color: rgba(255, 255, 255, 0.2);
    }

    .step.completed {
        background: linear-gradient(135deg, #00b894 0%, #00a085 100%);
        opacity: 0.8;
        transform: translateX(5px);
        border-color: rgba(0, 184, 148, 0.3);
    }

.step-icon {
    font-size: 1.8rem;
    min-width: 30px;
    animation: iconFloat 2s ease-in-out infinite;
}

.step.active .step-icon {
    animation: iconSpin 1s ease-in-out infinite;
}

@keyframes iconFloat {
    0%, 100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-3px);
    }
}

@keyframes iconSpin {
    0% {
        transform: rotateY(0deg);
    }

    50% {
        transform: rotateY(180deg);
    }

    100% {
        transform: rotateY(360deg);
    }
}

.step-text {
    font-weight: 600;
    font-size: 1.1rem;
}

/* Sistema de mensajes motivacionales */
.motivational-messages {
    margin: 20px 0;
    text-align: center;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.motivational-message {
    font-size: 1.1rem;
    font-style: italic;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.8s ease;
    color: rgba(255, 255, 255, 0.8);
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.2) 0%, rgba(240, 147, 251, 0.2) 100%);
    padding: 15px 25px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

    .motivational-message.active {
        opacity: 1;
        transform: translateY(0);
    }

/* Indicadores de proceso detallados */
.detailed-progress {
    margin: 25px 0;
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.process-detail {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
}

    .process-detail.active {
        color: #f093fb;
        font-weight: 600;
    }

    .process-detail .detail-value {
        font-family: 'Courier New', monospace;
        background: rgba(255, 255, 255, 0.1);
        padding: 2px 8px;
        border-radius: 4px;
    }

/* Contador de tiempo más detallado */
.time-details {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 15px;
    margin: 20px 0;
}

.time-item {
    text-align: center;
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.time-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: #f093fb;
    font-family: 'Courier New', monospace;
}

.time-label {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 5px;
}

/* Barra de progreso épica para 70 segundos */
.progress-container {
    margin-top: 30px;
}

.progress-bar {
    width: 100%;
    height: 12px;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 20px;
    position: relative;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 25%, #f093fb 50%, #667eea 75%, #764ba2 100%);
    background-size: 400% 100%;
    border-radius: 6px;
    width: 0%;
    animation: progressShimmerEpic 3s ease-in-out infinite;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

    .progress-fill::after {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.4) 50%, transparent 100%);
        animation: progressGlow 2s ease-in-out infinite;
    }

@keyframes progressShimmerEpic {
    0% {
        background-position: -400% 0;
    }

    50% {
        background-position: 0% 0;
    }

    100% {
        background-position: 400% 0;
    }
}

@keyframes progressGlow {
    0%, 100% {
        transform: translateX(-100%);
    }

    50% {
        transform: translateX(100%);
    }
}

.progress-text {
    display: flex;
    justify-content: space-between;
    font-size: 0.95rem;
    opacity: 1; /* ← Más visible */
    margin-bottom: 15px;
    color: rgba(255, 255, 255, 0.9); /* ← Asegurar color blanco */
}

#progressPercent {
    font-size: 1.8rem;
    font-weight: bold;
    color: #f093fb;
    font-family: 'Courier New', monospace;
    text-shadow: 0 0 10px rgba(240, 147, 251, 0.5);
}

/* Partículas flotantes mejoradas para 70s */
.loading-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
}

.particle {
    position: absolute;
    border-radius: 50%;
    animation: particleFloatEpic 8s ease-in-out infinite;
}

    .particle:nth-child(1) {
        left: 5%;
        animation-delay: 0s;
        width: 6px;
        height: 6px;
        background: rgba(102, 126, 234, 0.8);
        box-shadow: 0 0 10px rgba(102, 126, 234, 0.6);
    }

    .particle:nth-child(2) {
        left: 15%;
        animation-delay: 1s;
        width: 4px;
        height: 4px;
        background: rgba(240, 147, 251, 0.9);
        box-shadow: 0 0 8px rgba(240, 147, 251, 0.7);
    }

    .particle:nth-child(3) {
        left: 25%;
        animation-delay: 2s;
        width: 5px;
        height: 5px;
        background: rgba(118, 75, 162, 0.8);
        box-shadow: 0 0 12px rgba(118, 75, 162, 0.6);
    }

    .particle:nth-child(4) {
        left: 75%;
        animation-delay: 3s;
        width: 7px;
        height: 7px;
        background: rgba(102, 126, 234, 0.9);
        box-shadow: 0 0 15px rgba(102, 126, 234, 0.8);
    }

    .particle:nth-child(5) {
        left: 85%;
        animation-delay: 4s;
        width: 3px;
        height: 3px;
        background: rgba(240, 147, 251, 0.8);
        box-shadow: 0 0 6px rgba(240, 147, 251, 0.6);
    }

    .particle:nth-child(6) {
        left: 95%;
        animation-delay: 5s;
        width: 5px;
        height: 5px;
        background: rgba(118, 75, 162, 0.9);
        box-shadow: 0 0 10px rgba(118, 75, 162, 0.7);
    }

@keyframes particleFloatEpic {
    0% {
        top: 100%;
        opacity: 0;
        transform: translateX(0) scale(0) rotate(0deg);
    }

    5% {
        opacity: 1;
        transform: translateX(20px) scale(1) rotate(45deg);
    }

    25% {
        transform: translateX(-30px) scale(1.2) rotate(180deg);
    }

    50% {
        transform: translateX(40px) scale(0.8) rotate(270deg);
    }

    75% {
        transform: translateX(-20px) scale(1.1) rotate(360deg);
    }

    95% {
        opacity: 1;
        transform: translateX(10px) scale(0.6) rotate(405deg);
    }

    100% {
        top: -10%;
        opacity: 0;
        transform: translateX(0) scale(0) rotate(450deg);
    }
}

/* Animaciones con retrasos personalizados */
.neuron[data-delay] {
    animation-delay: calc(var(--delay) * 1s);
}

.connection[data-delay] {
    animation-delay: calc(var(--delay) * 1s);
}

.particle[data-delay] {
    animation-delay: calc(var(--delay) * 1s);
}

/* Responsive - Optimización para móviles */
@media (max-width: 768px) {
    .image-preview-section {
        grid-template-columns: 1fr;
    }

    .image-comparison {
        grid-template-columns: 1fr;
    }

    .result-actions {
        flex-direction: column;
    }

    /* ========================================
       SPINNER MÓVIL - OPTIMIZACIÓN COMPLETA
       ======================================== */

    .ai-loading-container {
        padding: 20px 15px;
        max-width: 95vw;
        max-height: 95vh;
        overflow-y: auto;
    }

    /* Red neuronal más pequeña para móviles */
    .neural-network {
        width: 280px;
        height: 140px;
        margin: 0 auto 25px;
    }

    .neuron {
        width: 16px;
        height: 16px;
    }

        .neuron::before {
            top: -3px;
            left: -3px;
            right: -3px;
            bottom: -3px;
            border-width: 1px;
        }

    /* Cerebro AI más pequeño */
    .ai-brain {
        width: 100px;
        height: 100px;
        margin: 0 auto 20px;
    }

    .brain-waves {
        top: -20px;
        left: -20px;
        right: -20px;
        bottom: -20px;
    }

    .wave {
        border-width: 2px;
    }

    /* Título más pequeño */
    #loadingTitle {
        font-size: 1.4rem;
        margin-bottom: 15px;
        line-height: 1.3;
    }

    /* Mensajes motivacionales adaptados */
    .motivational-messages {
        margin: 15px 0;
        min-height: 50px;
    }

    .motivational-message {
        font-size: 0.95rem;
        padding: 12px 18px;
        border-radius: 15px;
        line-height: 1.4;
    }

    /* Pasos más compactos */
    .loading-steps {
        margin-bottom: 20px;
    }

    .step {
        padding: 8px 15px;
        margin-bottom: 8px;
        border-radius: 20px;
        gap: 10px;
    }

    .step-icon {
        font-size: 1.4rem;
        min-width: 25px;
    }

    .step-text {
        font-size: 0.9rem;
        line-height: 1.3;
    }

    /* Progreso detallado en dos columnas */
    .detailed-progress {
        margin: 20px 0;
        padding: 15px;
    }

    .process-detail {
        margin-bottom: 8px;
        font-size: 0.85rem;
        flex-wrap: wrap;
        gap: 5px;
    }

        .process-detail .detail-value {
            padding: 1px 6px;
            font-size: 0.8rem;
        }

    /* Barra de progreso móvil */
    .progress-container {
        margin-top: 20px;
    }

    .progress-bar {
        height: 10px;
        margin-bottom: 15px;
    }

    .progress-text {
        font-size: 0.85rem;
        flex-direction: column;
        text-align: center;
        gap: 5px;
    }

    #progressPercent {
        font-size: 1.5rem;
        margin-bottom: 5px;
    }

    /* Contadores de tiempo en stack vertical */
    .time-details {
        grid-template-columns: 1fr;
        gap: 10px;
        margin: 15px 0;
    }

    .time-item {
        padding: 8px;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .time-value {
        font-size: 1.2rem;
    }

    .time-label {
        font-size: 0.75rem;
    }

    /* Partículas más pequeñas */
    .particle:nth-child(1), .particle:nth-child(2), .particle:nth-child(3) {
        width: 3px;
        height: 3px;
    }

    .particle:nth-child(4), .particle:nth-child(5), .particle:nth-child(6) {
        width: 4px;
        height: 4px;
    }

    .particle:nth-child(7), .particle:nth-child(8) {
        width: 2px;
        height: 2px;
    }
}

/* Móviles pequeños (hasta 480px) */
@media (max-width: 480px) {
    .ai-loading-container {
        padding: 15px 10px;
    }

    /* Red neuronal aún más pequeña */
    .neural-network {
        width: 240px;
        height: 120px;
        margin: 0 auto 20px;
    }

    .neuron {
        width: 14px;
        height: 14px;
    }

    /* Cerebro más pequeño */
    .ai-brain {
        width: 80px;
        height: 80px;
        margin: 0 auto 15px;
    }

    /* Título compacto */
    #loadingTitle {
        font-size: 1.2rem;
        margin-bottom: 12px;
    }

    /* Mensajes más pequeños */
    .motivational-message {
        font-size: 0.85rem;
        padding: 10px 15px;
    }

    /* Pasos en formato más compacto */
    .step {
        padding: 6px 12px;
        margin-bottom: 6px;
        flex-direction: column;
        text-align: center;
        gap: 5px;
    }

    .step-icon {
        font-size: 1.2rem;
    }

    .step-text {
        font-size: 0.8rem;
    }

    /* Progreso detallado en una columna */
    .detailed-progress {
        padding: 12px;
    }

    .process-detail {
        flex-direction: column;
        text-align: center;
        margin-bottom: 10px;
    }

        .process-detail .detail-value {
            margin-top: 3px;
            font-size: 0.9rem;
            font-weight: bold;
        }

    /* Barra de progreso más gruesa en móviles pequeños */
    .progress-bar {
        height: 12px;
    }

    #progressPercent {
        font-size: 1.3rem;
    }

    /* Tiempo en cards más grandes */
    .time-item {
        padding: 10px;
        border-radius: 8px;
    }

    .time-value {
        font-size: 1.1rem;
    }
}

/* Orientación horizontal en móviles */
@media (max-width: 768px) and (orientation: landscape) {
    .ai-loading-container {
        max-height: 90vh;
        overflow-y: auto;
        padding: 10px;
    }

    .neural-network {
        margin: 0 auto 15px;
    }

    .ai-brain {
        margin: 0 auto 10px;
    }

    #loadingTitle {
        font-size: 1.3rem;
        margin-bottom: 10px;
    }

    .motivational-messages {
        margin: 10px 0;
        min-height: 40px;
    }

    .loading-steps {
        margin-bottom: 15px;
    }

    .detailed-progress {
        margin: 15px 0;
        padding: 10px;
    }

    .time-details {
        grid-template-columns: 1fr 1fr 1fr;
        gap: 8px;
        margin: 10px 0;
    }

    .time-item {
        padding: 6px;
    }

    .time-value {
        font-size: 1rem;
    }
}

/* Optimizaciones de rendimiento para móviles */
@media (max-width: 768px) {
    /* Reducir animaciones complejas en móviles para mejor rendimiento */
    .neural-network {
        will-change: transform;
    }

    .ai-brain {
        will-change: transform;
    }

    .progress-fill {
        will-change: width;
    }

    /* Simplificar algunas animaciones en móviles */
    .particle {
        animation-duration: 8s; /* Un poco más lento para mejor rendimiento */
    }

    .connection {
        animation-duration: 4s; /* Reducir complejidad */
    }

    .neuron {
        animation-duration: 3s; /* Optimizar */
    }
}

/* Notificaciones móviles */
@media (max-width: 768px) {
    .notification {
        position: fixed !important;
        top: 10px !important;
        left: 10px !important;
        right: 10px !important;
        width: auto !important;
        min-width: auto !important;
        max-width: none !important;
        transform: translateY(-100%) !important;
        transition: transform 0.3s ease !important;
    }

        .notification.show {
            transform: translateY(0) !important;
        }

    .notification-message {
        font-size: 0.9rem;
        line-height: 1.4;
    }
}

/* Dark mode para móviles (opcional) */
@media (max-width: 768px) and (prefers-color-scheme: dark) {
    .ai-loading-overlay {
        background: rgba(0, 0, 0, 0.98);
    }

    .detailed-progress {
        background: rgba(255, 255, 255, 0.08);
        border-color: rgba(255, 255, 255, 0.15);
    }

    .time-item {
        background: rgba(255, 255, 255, 0.08);
        border-color: rgba(255, 255, 255, 0.15);
    }
}

/* Accesibilidad móvil */
@media (max-width: 768px) {
    /* Botones y elementos táctiles más grandes */
    .notification-close {
        padding: 10px;
        font-size: 1.2rem;
        min-width: 44px;
        min-height: 44px;
    }

    /* Contraste mejorado en pantallas pequeñas */
    .step-text {
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    }

    .motivational-message {
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    }
}
