/**
 * ==========================================
 * COMMAND CENTER IA - DESIGN SYSTEM
 * ==========================================
 * Arquitectura Segmentada Premium
 */

:root {
    --ia-bg-canvas: #1a1a2e;
    --ia-bg-card: rgba(255, 255, 255, 0.03);
    --ia-bg-input: rgba(0, 0, 0, 0.2);
    --ia-accent: #556ee6;
    --ia-accent-glow: rgba(85, 110, 230, 0.3);
    --ia-accent-hover: #485ec4;
    --ia-text-main: #eff2f7;
    --ia-text-muted: #a6b0cf;
    --ia-border: rgba(255, 255, 255, 0.08);
    --ia-radius: 12px;
    --ia-glass: blur(10px);
}

/* --- ANIMATIONS --- */
@keyframes iaFadeUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes iaPulse {
    0% { box-shadow: 0 0 0 0 rgba(85, 110, 230, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(85, 110, 230, 0); }
    100% { box-shadow: 0 0 0 0 rgba(85, 110, 230, 0); }
}

/**
 * SECTION: CORE LAYOUT
 */
#view-ia {
    padding: 15px 20px;
    color: var(--ia-text-main);
}

.ia-main-container {
    animation: iaFadeUp 0.4s ease-out;
}

.ia-pulse-icon {
    width: 38px;
    height: 38px;
    background: var(--ia-accent);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: white;
    animation: iaPulse 2s infinite;
}

/**
 * SECTION: TAB NAVIGATION & PRESETS
 */
.ia-tabs-nav {
    display: flex;
    gap: 6px;
    background: rgba(0, 0, 0, 0.3);
    padding: 6px;
    border-radius: 14px;
    border: 1px solid var(--ia-border);
    margin-bottom: 15px;
    backdrop-filter: var(--ia-glass);
}

.ia-presets-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 10px;
}

.ia-preset-btn {
    background: var(--ia-bg-input);
    border: 1px solid var(--ia-border);
    border-radius: 12px;
    padding: 12px;
    color: var(--ia-text-muted);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 15px;
    text-align: left;
}

.ia-preset-btn i {
    font-size: 20px;
    background: rgba(255, 255, 255, 0.05);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    transition: all 0.3s;
}

.ia-preset-btn div strong {
    display: block;
    font-size: 13px;
    color: #fff;
    margin-bottom: 2px;
}

.ia-preset-btn div span {
    font-size: 10px;
    opacity: 0.6;
}

.ia-preset-btn:hover {
    background: rgba(255,255,255,0.05);
    border-color: rgba(255,255,255,0.2);
    transform: translateY(-2px);
}

.ia-preset-btn.active {
    background: linear-gradient(135deg, rgba(85, 110, 230, 0.15) 0%, rgba(85, 110, 230, 0.05) 100%);
    border-color: var(--ia-accent);
    box-shadow: 0 4px 15px var(--ia-accent-glow);
}

.ia-preset-btn.active i {
    background: var(--ia-accent);
    color: #fff;
}

.ia-tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--ia-text-muted);
    padding: 8px 12px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.ia-tab-btn i { font-size: 14px; opacity: 0.7; }

.ia-tab-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

.ia-tab-btn.active {
    background: var(--ia-accent);
    color: white;
    box-shadow: 0 4px 12px var(--ia-accent-glow);
}

.ia-tab-content { display: none; }
.ia-tab-content.active { display: block; animation: iaFadeUp 0.3s ease; }

/**
 * SECTION: CARDS & GRIDS
 */
.ia-grid-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 15px;
}

.ia-card {
    background: var(--ia-bg-card);
    border: 1px solid var(--ia-border);
    border-radius: var(--ia-radius);
    padding: 18px;
    backdrop-filter: var(--ia-glass);
    margin-bottom: 12px;
}

.ia-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.ia-card h3 { margin: 0; font-size: 16px; font-weight: 700; color: #fff; }

/**
 * SECTION: FORM ELEMENTS
 */
.ia-form-group { margin-bottom: 12px; }
.ia-form-group label { 
    display: block; 
    margin-bottom: 5px; 
    font-size: 12px; 
    font-weight: 600; 
    color: var(--ia-text-muted);
}

.ia-hint { font-size: 11px; color: var(--ia-text-muted); margin-bottom: 8px; opacity: 0.8; }

.ia-textarea, .ia-input {
    width: 100%;
    background: var(--ia-bg-input);
    border: 1px solid var(--ia-border);
    border-radius: 8px;
    padding: 10px 12px;
    color: #fff;
    font-family: inherit;
    font-size: 13px;
    transition: all 0.2s;
}

.ia-textarea:focus, .ia-input:focus {
    border-color: var(--ia-accent);
    box-shadow: 0 0 0 2px var(--ia-accent-glow);
    outline: none;
    background: rgba(0,0,0,0.3);
}

/* Custom Range Slider Premium */
.ia-range-slider {
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    background: var(--ia-bg-input);
    border-radius: 5px;
    outline: none;
    border: 1px solid var(--ia-border);
    margin: 15px 0;
}

.ia-range-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: var(--ia-accent);
    cursor: pointer;
    border-radius: 50%;
    box-shadow: 0 0 10px var(--ia-accent-glow);
    transition: transform 0.2s;
}

.ia-range-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.ia-textarea { min-height: 100px; resize: vertical; }
.ia-textarea.small { min-height: 60px; }

/**
 * SECTION: CAPABILITY CARDS (BRAIN TAB)
 */
.ia-capability-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.ia-checkbox-card { cursor: pointer; position: relative; display: block; }
.ia-checkbox-card input { display: none; }

.ia-checkbox-card .card-inner {
    background: var(--ia-bg-input);
    border: 1px solid var(--ia-border);
    border-radius: 12px;
    padding: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 12px;
    height: 100%;
}

.ia-checkbox-card .icon-box {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: var(--ia-text-muted);
    transition: all 0.3s;
    flex-shrink: 0;
}

.ia-checkbox-card .info {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.ia-checkbox-card .info strong {
    font-size: 12px;
    color: #fff;
    display: block;
}

.ia-checkbox-card .info span {
    font-size: 10px;
    color: var(--ia-text-muted);
    margin-top: 2px;
}

.ia-checkbox-card:hover .card-inner {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

/* Checked State */
.ia-checkbox-card input:checked + .card-inner {
    background: linear-gradient(135deg, rgba(85, 110, 230, 0.2) 0%, rgba(85, 110, 230, 0.05) 100%);
    border-color: var(--ia-accent);
    box-shadow: 0 4px 15px var(--ia-accent-glow);
}

.ia-checkbox-card input:checked + .card-inner .icon-box {
    background: var(--ia-accent);
    color: #fff;
    box-shadow: 0 0 10px var(--ia-accent-glow);
}

.ia-checkbox-card input:checked + .card-inner .info strong {
    color: var(--ia-accent);
}

/**
 * SECTION: ENGINE & MOTOR
 */
.ia-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.ia-form-grid.tri-col { grid-template-columns: repeat(3, 1fr); }

.ia-bridge-section {
    background: rgba(85, 110, 230, 0.05);
    border: 1px dashed var(--ia-accent);
    padding: 15px;
    border-radius: 10px;
    margin: 15px 0;
}

/**
 * SECTION: SECURITY & FOOTER
 */
.ia-footer-metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.ia-metric-card {
    background: var(--ia-bg-card);
    border: 1px solid var(--ia-border);
    padding: 15px;
    border-radius: var(--ia-radius);
    text-align: center;
}

.ia-metric-card i { font-size: 20px; margin-bottom: 8px; }
.ia-metric-card .val { font-size: 22px; font-weight: 800; margin-bottom: 2px; }
.ia-metric-card .lab { font-size: 10px; }

.ia-action-bar { margin-top: 15px; }
.ia-action-bar .btn-primary {
    padding: 10px 25px;
    font-size: 14px;
    border-radius: 10px;
}

/**
 * SECTION: HELP SYSTEM (POPOVERS)
 */
.ia-help-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    margin-left: 8px;
    font-size: 10px;
    color: var(--ia-text-muted);
    cursor: pointer;
    transition: all 0.2s;
    vertical-align: middle;
}

.ia-help-btn:hover {
    background: var(--ia-accent);
    color: #fff;
    transform: scale(1.1);
}

.ia-popover {
    position: fixed;
    z-index: 99999;
    width: 220px;
    background: rgba(26, 26, 46, 0.98);
    backdrop-filter: blur(20px);
    border: 1px solid var(--ia-accent);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
    border-radius: 12px;
    padding: 14px;
    font-size: 12px;
    line-height: 1.5;
    color: var(--ia-text-main);
    animation: iaFadeUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: auto;
}

.ia-popover::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: var(--popover-left, 15px);
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid var(--ia-accent);
}

/* HELPERS */
.ia-hr { margin: 20px 0; border: 0; border-top: 1px solid var(--ia-border); }
.highlight { color: var(--ia-accent); font-weight: 700; }
.ia-password-wrapper { position: relative; }
.ia-password-toggle {
    position: absolute;
    right: 12px;
    bottom: 10px;
    cursor: pointer;
    color: var(--ia-text-muted);
}



/* ----------------------------------------------------
   RESPONSIVE DESIGN SYSTEM FOR IA BOT MODULE (v8.5)
   ---------------------------------------------------- */
@media (max-width: 768px) {
    .ia-presets-grid {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }

    .ia-grid-layout {
        grid-template-columns: 1fr !important;
        gap: 15px !important;
    }

    .ia-capability-grid {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }

    .ia-form-grid,
    .ia-form-grid.tri-col {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }

    .ia-footer-metrics {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }

    .ia-tabs-nav {
        flex-direction: column !important;
        gap: 8px !important;
        padding: 8px !important;
    }

    .ia-tab-btn {
        width: 100% !important;
        padding: 8px 12px !important;
    }
}

