/* /frontend/assets/css/styles.css */

.hidden { display: none !important; }
.active { display: block; }
/* /frontend/assets/css/styles.css */

/* 1. Forzar la fuente Montserrat en toda la app */
* {
    font-family: 'Montserrat', sans-serif !important;
}

/* 2. Suavizar el fondo (estilo de tu app anterior) */
body {
    background-color: #f0f2f5; 
}

/* 3. Estilizar la tarjeta del formulario (bordes muy redondeados y sombra suave) */
.card {
    background: white;
    border-radius: 16px; /* Borde más curvo */
    box-shadow: 0 8px 16px rgba(0,0,0,0.05); /* Sombra difuminada elegante */
    padding: 2rem;
    border: none;
    /* Opcional: El borde inferior de color como en tus tarjetas */
    border-bottom: 4px solid var(--primary-color);
}

/* 4. Estilizar los inputs para que no sean tan rectos */
.form-control {
    border-radius: 8px; /* Redondear cajas de texto */
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    background-color: #f9fafb;
}

.form-control:focus {
    background-color: white;
    box-shadow: 0 0 0 3px rgba(43, 87, 154, 0.2); /* Resplandor azul al enfocar */
}

/* 5. Botones más curvos */
.btn-primary, .btn-secondary {
    border-radius: 20px; /* Botones tipo píldora o muy redondeados */
    padding: 0.6rem 1.5rem;
    font-weight: 600;
}
#app-screen {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

.sidebar {
    width: 250px;
    background-color: var(--bg-white);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    transition: width 0.3s ease;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    text-align: center;
}

.app-title {
    font-size: 1.2rem;
    color: var(--primary-color);
    margin-top: 0.5rem;
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    color: var(--text-dark);
    text-decoration: none;
    gap: 0.75rem;
    transition: background-color 0.2s;
}

.nav-item:hover {
    background-color: var(--bg-light);
}

.nav-item.active {
    background-color: var(--primary-color);
    color: var(--bg-white);
    border-left: 4px solid var(--secondary-color);
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid var(--border-color);
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

/* =========================================
   DISEÑO DE LA BARRA SUPERIOR (TOPBAR)
   ========================================= */
.topbar {
    background-color: var(--primary-color);
    color: white;
    border-radius: 12px; 
    margin: 1rem; 
    padding: 1.2rem 2rem; /* Más grueso para acomodar el subtítulo */
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.topbar-left {
    display: flex;
    align-items: center;
}

/* La píldora translúcida del usuario */
.user-pill {
    display: flex;
    align-items: center;
    background-color: rgba(255, 255, 255, 0.15); /* Fondo blanco semi-transparente */
    padding: 0.5rem 1.2rem;
    border-radius: 50px; /* Bordes totalmente redondeados */
    gap: 0.6rem;
    font-size: 0.9rem;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.user-pill i {
    font-size: 1.2rem;
}

/* Opcional: Si decides usar el botón de "Salir" dentro de la píldora */
.btn-pill-outline {
    background: transparent;
    color: white;
    border: 1px solid white;
    border-radius: 20px;
    padding: 0.3rem 0.8rem;
    margin-left: 0.5rem;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    transition: all 0.2s;
}

.btn-pill-outline:hover {
    background: white;
    color: var(--primary-color);
}

#view-container {
    padding: 2rem;
    flex: 1;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
}
/* /frontend/assets/css/styles.css (Agregar al final) */

.login-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background-color: var(--primary-color);
}

.login-card {
    background: white;
    padding: 3rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    text-align: center;
    max-width: 400px;
    width: 100%;
}

.login-card h2 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}
/* /frontend/assets/css/styles.css (Añadir al final) */

/* Vistas y Tarjetas */
.view-header {
    margin-bottom: 2rem;
}
.text-muted {
    color: var(--text-muted);
    font-size: 0.9rem;
}
.card {
    background: white;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: 1.5rem;
    border: 1px solid var(--border-color);
}
.section-title {
    color: var(--primary-color);
    font-size: 1.1rem;
    margin-bottom: 1rem;
}
.section-header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}
.divider {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 2rem 0;
}

/* Formularios */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}
.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.form-group label {
    font-weight: 600;
    font-size: 0.9rem;
}
.form-control {
    padding: 0.6rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    outline: none;
}
.form-control:focus {
    border-color: var(--primary-color);
}

/* Botones Adicionales */
.btn-secondary {
    background-color: var(--bg-light);
    color: var(--text-dark);
    border: 1px solid var(--border-color);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.btn-secondary:hover {
    background-color: #e1dfdd;
}
.btn-text {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.5rem 1rem;
}
.btn-text:hover {
    color: var(--danger-color);
}
.form-actions.right {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

/* Tablas */
.table-responsive {
    overflow-x: auto;
}
.data-table {
    width: 100%;
    border-collapse: collapse;
}
.data-table th, .data-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}
.data-table th {
    background-color: var(--bg-light);
    font-weight: 600;
    font-size: 0.9rem;
}
.text-center {
    text-align: center !important;
}
/* /frontend/assets/css/styles.css (Al final) */

/* Estilos para Modales */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(2px); /* Efecto cristalino moderno */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}
.modal-overlay.hidden {
    display: none;
}
.modal-content {
    width: 100%;
    max-width: 450px;
    animation: modalFadeIn 0.3s ease;
    margin: 1rem;
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 0.5rem;
}
.btn-close-modal {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #9ca3af;
    transition: color 0.2s;
}
.btn-close-modal:hover {
    color: var(--danger-color);
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: translateY(-20px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
/* =========================================
   ESTILOS PARA VENTANAS MODALES (POP-UPS)
   ========================================= */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.6); /* Fondo oscuro semitransparente */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999; /* Asegura que esté por encima de absolutamente todo */
}

/* Ocultar el modal cuando tenga la clase 'hidden' */
.modal.hidden {
    display: none !important;
}

.modal-content {
    background-color: var(--bg-color, #ffffff);
    border-radius: 12px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh; /* Si hay muchísimos ítems, crea un scroll interno */
    overflow-y: auto;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* =========================================
   TIMELINE ELEGANTE (DASHBOARD)
   ========================================= */
.timeline-container {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    position: relative;
    margin: 1rem 0 0.5rem 0;
    padding: 0 0.5rem;
}
.timeline-container::before {
    content: '';
    position: absolute;
    top: 11px; /* Mitad exacta del icono de 24px */
    left: 10%;
    right: 10%;
    height: 2px;
    background: #e2e8f0;
    z-index: 1;
}
.timeline-step {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    gap: 0.3rem;
}
.timeline-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: white;
    border: 2px solid #e2e8f0;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    color: #94a3b8;
    font-size: 0.75rem;
    transition: all 0.3s ease;
}
.timeline-step.active .timeline-icon {
    border-color: #3b82f6;
    background: #3b82f6;
    color: white;
    box-shadow: 0 0 0 3px #eff6ff;
}
.timeline-step.current .timeline-icon {
    border-color: #10b981;
    background: #10b981;
    color: white;
    box-shadow: 0 0 0 3px #ecfdf5;
    animation: pulse-green 2s infinite;
}
.timeline-step.current-partial .timeline-icon {
    border-color: #f59e0b;
    background: #f59e0b;
    color: white;
    box-shadow: 0 0 0 3px #fef3c7;
    animation: pulse-amber 2s infinite;
}
.timeline-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: #64748b;
    text-align: center;
    line-height: 1.1;
    max-width: 75px;
}
.timeline-step.active .timeline-label { color: #1e293b; }
@keyframes pulse-green {
    0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}
@keyframes pulse-amber {
    0% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(245, 158, 11, 0); }
    100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
}

/* =========================================
   DISEÑO RESPONSIVE (MÓVILES Y TABLETS)
   ========================================= */
@media (max-width: 992px) {
    /* 1. Menú Lateral se vuelve una barra horizontal scrolleable (Tipo App Móvil) */
    #app-screen { flex-direction: column; }
    .sidebar { width: 100% !important; flex: none; border-right: none; border-bottom: 1px solid var(--border-color); }
    .sidebar-header { padding: 1rem; }
    .sidebar-nav { display: flex; flex-direction: row; overflow-x: auto; white-space: nowrap; padding: 0; }
    .sidebar-nav::-webkit-scrollbar { height: 4px; }
    .sidebar-nav::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
    .nav-item { padding: 1rem; border-left: none; border-bottom: 3px solid transparent; }
    .nav-item.active { border-left: none; border-bottom: 3px solid var(--secondary-color); }
    
    /* 2. Topbar Compacto */
    .topbar { flex-direction: column; gap: 1rem; padding: 1rem; margin: 0.5rem; text-align: center; }
    .topbar-left { flex-direction: column; }
    .topbar-left i { margin: 0 0 0.5rem 0; }
    .user-pill { justify-content: center; }
    #view-container { padding: 1rem; }

    /* 3. Modales Divididos (PDF + Formulario) apilados verticalmente */
    .responsive-split { flex-direction: column !important; overflow-y: auto !important; }
    .responsive-split > div { flex: none !important; width: 100% !important; border-right: none !important; }
    /* El PDF tomará el 40% superior de la pantalla, el form fluye debajo */
    .responsive-split > div:first-child { height: 40vh !important; border-bottom: 4px solid var(--primary-color); }
    .responsive-split > div:last-child { height: auto !important; overflow-y: visible !important; }

    /* 4. Formularios Multicolumna pasan a 1 sola columna */
    .responsive-grid { grid-template-columns: 1fr !important; }
    
    /* 5. Ajustes de la Ventana Modal general */
    .modal-content { width: 95% !important; margin: 0.5rem !important; padding: 1.5rem !important; }
    .modal { padding-top: 1vh !important; align-items: flex-start !important; }

    /* 6. Timeline en 2 columnas para celular */
    .timeline-container { flex-wrap: wrap; justify-content: center; gap: 1rem; }
    .timeline-step { min-width: 40%; }
    .timeline-container::before { display: none; }
    
    /* 7. Ajuste de textos en tablas de modales */
    .data-table th, .data-table td { padding: 0.5rem; font-size: 0.85rem; }
    .section-header-flex { flex-direction: column; gap: 1rem; align-items: flex-start; }
}