/* ==========================================================================
   CA3EAP - Tema "Warm Retro Tech" (Bootstrap 5 Overrides)
   ========================================================================== */

/* 1. Fondos y Superficies (Gris grafito cálido) */
[data-bs-theme="dark"] {
    --bs-body-bg: #1c1f24;
    --bs-body-color: #c9d1d9;
    --bs-tertiary-bg: #25282d;
    --bs-secondary-bg: #2d3238;
    --bs-primary: #4a90e2; /* Azul CRT */
    --bs-primary-rgb: 74, 144, 226;
    --bs-border-color: #383e45;
}

/* 2. Tipografía Global */
body {
    font-family: 'Inter', system-ui, -apple-system, Roboto, Arial, sans-serif;
    font-size: 1rem;
    line-height: 1.65;
    letter-spacing: 0.01em;
}

h1, h2, h3, h4, h5, h6 { color: #e6edf3; font-weight: 600; letter-spacing: -0.02em; }
.text-muted, .text-secondary { color: #8b949e !important; }
.font-monospace { font-family: 'ui-monospace', 'SFMono-Regular', 'Menlo', 'Monaco', 'Consolas', monospace; font-size: 0.9em; color: #8b949e; }

/* 3. Enlaces en texto (Estilo Terminal / Brutalista) */
a:not(.btn):not(.nav-link):not(.dropdown-item):not(.list-group-item):not(.navbar-brand) {
    color: #ffffff;
    text-decoration: underline;
    text-underline-offset: 4px;
    text-decoration-color: rgba(255, 255, 255, 0.3);
    transition: all 0.2s ease;
}

a:not(.btn):not(.nav-link):not(.dropdown-item):not(.list-group-item):not(.navbar-brand):hover {
    color: #4a90e2; /* Cambia a Azul CRT al pasar el mouse */
    text-decoration-color: #4a90e2;
}

/* 4. Forzar Paleta de Colores en Componentes (Botones, Badges, Alertas, Textos) */

/* PRIMARY: Azul CRT / VGA */
.btn-primary {
    --bs-btn-bg: #4a90e2;
    --bs-btn-border-color: #4a90e2;
    --bs-btn-color: #ffffff; /* Texto blanco para buen contraste */
    --bs-btn-hover-bg: #5fa0ea;
    --bs-btn-hover-border-color: #5fa0ea;
    --bs-btn-hover-color: #ffffff;
}
.text-bg-primary, .badge.text-bg-primary, .bg-primary {
    background-color: #4a90e2 !important;
    color: #ffffff !important;
}
.text-primary {
    color: #4a90e2 !important;
}
.alert-primary {
    --bs-alert-color: #7ab3ef;
    --bs-alert-bg: rgba(74, 144, 226, 0.1);
    --bs-alert-border-color: rgba(74, 144, 226, 0.3);
}

/* INFO: Retro Cyan */
.btn-info {
    --bs-btn-bg: #4ecdc4; --bs-btn-border-color: #4ecdc4; --bs-btn-color: #1c1f24;
    --bs-btn-hover-bg: #63d6ce; --bs-btn-hover-border-color: #63d6ce; --bs-btn-hover-color: #1c1f24;
}
.text-bg-info, .badge.text-bg-info, .bg-info { background-color: #4ecdc4 !important; color: #1c1f24 !important; }
.text-info { color: #4ecdc4 !important; }
.alert-info { --bs-alert-color: #4ecdc4; --bs-alert-bg: rgba(78, 205, 196, 0.1); --bs-alert-border-color: rgba(78, 205, 196, 0.3); }

/* SUCCESS: Phosphor Green */
.btn-success {
    --bs-btn-bg: #55a65c; --bs-btn-border-color: #55a65c; --bs-btn-color: #ffffff;
    --bs-btn-hover-bg: #67b56e; --bs-btn-hover-border-color: #67b56e; --bs-btn-hover-color: #ffffff;
}
.text-bg-success, .badge.text-bg-success, .bg-success { background-color: #55a65c !important; color: #ffffff !important; }
.text-success { color: #55a65c !important; }
.alert-success { --bs-alert-color: #55a65c; --bs-alert-bg: rgba(85, 166, 92, 0.1); --bs-alert-border-color: rgba(85, 166, 92, 0.3); }

/* DANGER: Sunset Red */
.btn-danger {
    --bs-btn-bg: #d95b43; --bs-btn-border-color: #d95b43; --bs-btn-color: #ffffff;
    --bs-btn-hover-bg: #e66c55; --bs-btn-hover-border-color: #e66c55; --bs-btn-hover-color: #ffffff;
}
.text-bg-danger, .badge.text-bg-danger, .bg-danger { background-color: #d95b43 !important; color: #ffffff !important; }
.text-danger { color: #d95b43 !important; }
.alert-danger { --bs-alert-color: #d95b43; --bs-alert-bg: rgba(217, 91, 67, 0.1); --bs-alert-border-color: rgba(217, 91, 67, 0.3); }

/* WARNING: Warm Orange */
.btn-warning {
    --bs-btn-bg: #f39c12; --bs-btn-border-color: #f39c12; --bs-btn-color: #1c1f24;
}
.text-bg-warning, .badge.text-bg-warning, .bg-warning { background-color: #f39c12 !important; color: #1c1f24 !important; }
.text-warning { color: #f39c12 !important; }
.alert-warning { --bs-alert-color: #f39c12; --bs-alert-bg: rgba(243, 156, 18, 0.1); --bs-alert-border-color: rgba(243, 156, 18, 0.3); }

/* 5. Ajustes de Componentes Adicionales */

/* Tarjetas */
.card { border-color: var(--bs-border-color); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important; }
.card-header, .card-footer { border-color: var(--bs-border-color); }
.transition-hover:hover { transform: translateY(-4px); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25) !important; border-color: #e5a93d; }

/* Tablas (Suavizado de líneas y fondos) */
.table { --bs-table-bg: transparent; --bs-table-color: var(--bs-body-color); --bs-table-border-color: var(--bs-border-color); }
.table-striped > tbody > tr:nth-of-type(odd) > * { --bs-table-bg-type: rgba(255, 255, 255, 0.02); }
.table-hover > tbody > tr:hover > * { --bs-table-bg-state: rgba(229, 169, 61, 0.05); color: #e6edf3; }
.table-dark th { background-color: #1a1d22; color: #8b949e; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.05em; }

/* Formularios */
.form-control, .form-select {
    background-color: #1a1d22;
    border-color: var(--bs-border-color);
    color: #e6edf3;
}
.form-control:focus, .form-select:focus {
    background-color: #1c1f24;
    border-color: #e5a93d;
    box-shadow: 0 0 0 0.25rem rgba(229, 169, 61, 0.25);
    color: #e6edf3;
}
.form-control::placeholder { color: #6e7681; }

/* Imágenes en contenido */
.markdown-body img { max-width: 100%; height: auto; border-radius: 6px; box-shadow: 0 4px 12px rgba(0,0,0,0.2); }
figure { background: var(--bs-tertiary-bg); padding: 0.5rem; border-radius: 6px; border: 1px solid var(--bs-border-color); }
figcaption { font-size: 0.85rem; color: #8b949e; text-align: center; margin-top: 0.5rem; }
