/* ============================================================
   components.css — Fase 1: CSS Externalizado de app.js
   Plan: docs/plans/2026-03-31_Plan_Nueva_Arquitectura.md
   Extraído desde: public/js/app.js (líneas 46-106)
   ============================================================ */

/* --- Animación Blink (ya existe en style.css L1398, esta es compatible) ---
   NOTA: No se redeclara @keyframes blink. Se usa la definición existente
   en style.css. Si necesitas la variante con 50% opacity, usa blink-overlay. */

@keyframes blink-overlay {
    0%   { opacity: 1; }
    50%  { opacity: 0.5; }
    100% { opacity: 1; }
}

/* ==========================================================
   MODAL DE CONFIRMACIÓN / INPUT
   Origen: app.js L53-L74 (styleSheet.innerText)
   ========================================================== */

.custom-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(17, 24, 39, 0.7);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.custom-modal-overlay.modal-show {
    opacity: 1;
    pointer-events: auto;
}

.custom-modal-card {
    background: var(--bg-card);
    padding: 30px;
    border-radius: 24px;
    max-width: 400px;
    width: 90%;
    transform: translateY(20px);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-show .custom-modal-card {
    transform: translateY(0);
}

.modal-buttons {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.modal-btn {
    flex: 1;
    padding: 14px;
    border-radius: var(--radius);
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: transform 0.1s;
    font-family: inherit;
    font-size: 0.95rem;
}

.modal-btn:active {
    transform: scale(0.96);
}

/* ==========================================================
   NOTIFICACIONES TOAST
   Origen: app.js L76-L105 (styleSheet.innerText)
   ========================================================== */

.toast-container {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 3000;
    pointer-events: none;
}

.toast {
    background: #1f2937;
    color: white;
    padding: 12px 24px;
    border-radius: 12px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 0.9rem;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: auto;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast-success {
    border-left: 4px solid var(--secondary);
}

.toast-error {
    border-left: 4px solid var(--danger);
}

.toast-info {
    border-left: 4px solid var(--primary);
}

.toast-warning {
    border-left: 4px solid var(--warning);
}

/* ==========================================================
   CLASES DE UTILIDAD — Reemplazo de estilos inline repetidos
   Extraídas del análisis de ~990 estilos inline en app.js
   ========================================================== */

/* --- Layout --- */

.flex-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.flex-row-6 {
    display: flex;
    align-items: center;
    gap: 6px;
}

.flex-row-12 {
    display: flex;
    align-items: center;
    gap: 12px;
}

.flex-gap-10 {
    display: flex;
    gap: 10px;
}

.flex-wrap-gap-10 {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    width: 100%;
}

.flex-wrap-gap-12 {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.flex-between-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 20px;
}

.grid-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

/* --- Tipografía --- */

.text-center {
    text-align: center;
}

.text-muted {
    color: var(--text-muted);
}

.text-main {
    color: var(--text-main);
}

.text-success {
    color: #10b981;
}

.text-danger {
    color: #ef4444;
}

.section-label {
    font-size: 0.75em;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    display: block;
    margin-bottom: 4px;
}

.section-title-bar {
    margin: 0 0 20px 0;
    color: var(--text-muted);
    font-size: 0.85em;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
    font-weight: 800;
}

.page-title {
    margin-top: 0;
    margin-bottom: 30px;
    color: var(--text-main);
    font-size: 1.4em;
    display: flex;
    align-items: center;
    gap: 12px;
}

.detail-value {
    display: block;
    color: var(--text-main);
    font-size: 1.05em;
}

.detail-meta {
    display: block;
    font-size: 0.88em;
    color: var(--text-muted);
    margin-top: 8px;
    line-height: 1.5;
}

.subtitle-muted {
    color: var(--text-muted);
    font-size: 0.9em;
    font-weight: 500;
}

/* --- Espaciado --- */

.mt-0 { margin-top: 0; }
.mt-20 { margin-top: 20px; }
.mt-30 { margin-top: 30px; }
.mb-0 { margin-bottom: 0; }
.mb-20 { margin-bottom: 20px; }
.mb-30 { margin-bottom: 30px; }

.text-center-block {
    text-align: center;
    margin-top: 30px;
    margin-bottom: 30px;
}

/* --- Contenedores --- */

.min-h-view {
    min-height: 85vh;
}

.flex-1 {
    flex: 1;
}

.flex-1-min250 {
    flex: 1;
    min-width: 250px;
}

/* --- Botones --- */

.btn-outline-success {
    background: transparent;
    color: #10b981;
    border: 1px solid #10b981;
    padding: 6px 15px;
    font-size: 0.9em;
    width: auto;
    border-radius: var(--radius);
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
    font-family: inherit;
}

.btn-outline-success:hover {
    background: rgba(16, 185, 129, 0.1);
}

.link-success {
    color: #10b981;
    text-decoration: none;
    font-size: 0.9em;
    font-weight: 500;
}

.link-success:hover {
    text-decoration: underline;
}

/* --- Imágenes y Media --- */

.img-cover-rounded {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

.img-cover-rounded-accent {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
    border-top: 3px solid #10b981;
}

.media-container-250 {
    position: relative;
    height: 250px;
    width: 100%;
}

/* --- Tablas / Paneles --- */

.panel-padding {
    padding: 12px 15px;
}

.table-header-cell {
    padding: 12px 15px;
    text-align: left;
    color: var(--text-muted);
    font-size: 0.75em;
    text-transform: uppercase;
}

/* --- Dark Mode Overrides para componentes extraídos --- */

body.dark-mode .toast {
    background: #374151;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
}

body.dark-mode .custom-modal-card {
    border-color: rgba(255, 255, 255, 0.05);
}

/* --- Modal Input: Estilo del campo de texto interior --- */

.modal-input {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s;
    font-family: inherit;
    background: var(--bg-input);
    color: var(--text-main);
}

.modal-input:focus {
    border-color: var(--primary);
}
