/* =========================================
   ESTILOS ADICIONALES PARA EL SIMULADOR OSI
   Barra de progreso, modales, escenarios y tooltips
   ========================================= */

/* =========================================
   BOTONES CON ICONOS SVG
   ========================================= */
.btn-icon {
    width: 1.6rem;
    height: 1.6rem;
    vertical-align: middle;
    margin-right: 0.4rem;
    flex-shrink: 0;
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 1rem 1.6rem;
    font-size: 1.4rem;
    white-space: nowrap;
}

.btn-info {
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.15), rgba(37, 99, 235, 0.15));
    border-color: rgba(14, 165, 233, 0.4);
}

.btn-info:hover {
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.25), rgba(37, 99, 235, 0.25));
    border-color: rgba(14, 165, 233, 0.6);
}

.controls .btn-secondary {
    min-width: auto;
    flex: 0 0 auto;
}

/* =========================================
   BARRA DE PROGRESO DE SIMULACIÓN
   ========================================= */
.simulation-progress-container {
    position: relative;
    width: 100%;
    height: 4px;
    background: rgba(30, 41, 59, 0.5);
    border-radius: 2px;
    margin-top: 1.5rem;
    overflow: hidden;
}

.simulation-progress {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--accent-color) 50%, var(--secondary-color) 100%);
    background-size: 200% 100%;
    border-radius: 2px;
    transition: width 0.3s ease;
    animation: progressGradient 2s linear infinite;
}

@keyframes progressGradient {
    0% { background-position: 0% 50%; }
    100% { background-position: 200% 50%; }
}

/* =========================================
   GRID DE ESTADÍSTICAS AVANZADAS
   ========================================= */
.stat-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    padding: 0.8rem;
    background: var(--bg-surface);
    border-radius: 0.8rem;
    border: 1px solid var(--border-soft);
}

.stat-label {
    font-size: 1.1rem;
    color: var(--text-muted);
}

.stat-value {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--accent-color);
    font-family: 'Orbitron', sans-serif;
}

/* =========================================
   MODALES
   ========================================= */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--bg-panel);
    border-radius: 2rem;
    padding: 2.5rem;
    max-width: 600px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    border: 1px solid var(--border-strong);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4);
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s ease;
}

.modal.active .modal-content {
    transform: scale(1) translateY(0);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-soft);
}

.modal-header h2 {
    font-family: 'Orbitron', sans-serif;
    font-size: 2.2rem;
    color: var(--text-light);
}

.modal-close {
    background: none;
    border: none;
    font-size: 2.5rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color 0.3s ease, transform 0.2s ease;
}

.modal-close:hover {
    color: var(--text-light);
    transform: scale(1.2);
}

/* =========================================
   ESCENARIOS STYLES
   ========================================= */
.scenario-selector {
    max-height: 60vh;
    overflow-y: auto;
}

.scenario-selector h4 {
    font-size: 1.6rem;
    color: var(--text-light);
    margin-bottom: 1.5rem;
}

.scenario-categories {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.scenario-category {
    background: var(--bg-surface);
    border-radius: 1rem;
    padding: 1.5rem;
    border: 1px solid var(--border-soft);
}

.category-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    font-size: 1.4rem;
    color: var(--text-light);
}

.scenario-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.scenario-btn {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.8rem 1.2rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border-soft);
    border-radius: 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.3rem;
    color: var(--text-light);
}

.scenario-btn:hover {
    background: var(--card-hover-bg);
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.scenario-difficulty {
    font-size: 1rem;
    padding: 0.2rem 0.6rem;
    border-radius: 0.4rem;
    text-transform: uppercase;
}

.scenario-difficulty.easy {
    background: rgba(21, 128, 61, 0.3);
    color: #4ade80;
}

.scenario-difficulty.medium {
    background: rgba(202, 138, 4, 0.3);
    color: #fbbf24;
}

.scenario-difficulty.hard {
    background: rgba(220, 38, 38, 0.3);
    color: #f87171;
}

/* =========================================
   TOOLTIPS PARA CAPAS
   ========================================= */
.layer-tooltip {
    position: absolute;
    background: var(--bg-elevated);
    backdrop-filter: blur(16px);
    border: 1.5px solid var(--border-strong);
    border-radius: 1.2rem;
    padding: 1.5rem;
    max-width: 320px;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
    pointer-events: none;
    z-index: 1500;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.layer-tooltip.visible {
    opacity: 1;
    transform: translateY(0);
}

.tooltip-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    padding-bottom: 0.8rem;
    border-bottom: 2px solid;
}

.tooltip-name {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-light);
}

.tooltip-body {
    font-size: 1.3rem;
    color: var(--text-muted);
}

.tooltip-function {
    margin-bottom: 1rem;
    line-height: 1.5;
}

.tooltip-detail {
    margin-bottom: 0.6rem;
}

.tooltip-detail strong {
    color: var(--text-light);
}

.tooltip-example {
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(15, 23, 42, 0.5);
    border-radius: 0.8rem;
    font-size: 1.2rem;
    line-height: 1.5;
}

/* =========================================
   BOTONES ADICIONALES
   ========================================= */
.audio-btn.muted {
    opacity: 0.5;
}

[data-theme="light"] .modal-content {
    background: var(--bg-panel);
}

/* =========================================
   ANIMACIONES
   ========================================= */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.shake {
    animation: shake 0.5s ease;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.bounce {
    animation: bounce 0.5s ease;
}
