/**
 * Estilos principales del sistema
 * Tlachinollan - Sistema de Registro de Casos
 */

:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --danger-color: #e74c3c;
    --info-color: #3498db;
    --light-gray: #ecf0f1;
    --dark-gray: #7f8c8d;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 14px;
}

/* Navbar */
.navbar-brand {
    font-weight: bold;
    font-size: 1.3rem;
}

/* Dashboard */
.dashboard-card {
    transition: transform 0.2s;
    border-left: 4px solid var(--primary-color);
}

.dashboard-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--primary-color);
}

/* Formulario Multi-Sección */
.form-wizard {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.wizard-steps {
    display: flex;
    justify-content: space-between;
    margin-bottom: 30px;
    padding: 20px;
    background: var(--light-gray);
    border-radius: 8px 8px 0 0;
    overflow-x: auto;
}

.wizard-step {
    flex: 1;
    text-align: center;
    position: relative;
    padding: 10px;
    cursor: pointer;
    min-width: 120px;
}

.wizard-step::after {
    content: '';
    position: absolute;
    top: 25px;
    right: -50%;
    width: 100%;
    height: 2px;
    background: var(--dark-gray);
    z-index: 0;
}

.wizard-step:last-child::after {
    display: none;
}

.wizard-step.active .step-number {
    background: var(--secondary-color);
    color: white;
}

.wizard-step.completed .step-number {
    background: var(--success-color);
    color: white;
}

.wizard-step.completed::after {
    background: var(--success-color);
}

.step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--dark-gray);
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-bottom: 8px;
    position: relative;
    z-index: 1;
}

.step-title {
    font-size: 12px;
    color: var(--dark-gray);
    font-weight: 500;
}

.wizard-step.active .step-title {
    color: var(--secondary-color);
    font-weight: bold;
}

/* Secciones del formulario */
.form-section {
    display: none;
    padding: 30px;
    animation: fadeIn 0.3s;
}

.form-section.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.section-title {
    color: var(--primary-color);
    border-bottom: 2px solid var(--secondary-color);
    padding-bottom: 10px;
    margin-bottom: 25px;
}

/* Indicador de autoguardado */
.autosave-indicator {
    position: fixed;
    top: 70px;
    right: 20px;
    padding: 10px 20px;
    border-radius: 5px;
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 1000;
    display: none;
    animation: slideIn 0.3s;
}

@keyframes slideIn {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

.autosave-indicator.saving {
    display: block;
    background: var(--info-color);
    color: white;
}

.autosave-indicator.saved {
    display: block;
    background: var(--success-color);
    color: white;
}

.autosave-indicator.error {
    display: block;
    background: var(--danger-color);
    color: white;
}

.autosave-indicator.offline {
    display: block;
    background: var(--warning-color);
    color: white;
}

/* Indicador de conexión */
.connection-status {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    z-index: 1000;
}

.connection-status.online {
    background: var(--success-color);
    color: white;
}

.connection-status.offline {
    background: var(--danger-color);
    color: white;
}

/* Botones de navegación del formulario */
.form-navigation {
    display: flex;
    justify-content: space-between;
    padding: 20px 30px;
    background: var(--light-gray);
    border-radius: 0 0 8px 8px;
}

/* Búsqueda */
.search-filters {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

/* Tabla de resultados */
.table-casos {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.table-casos thead {
    background: var(--primary-color);
    color: white;
}

.badge-estatus {
    padding: 5px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: bold;
}

.badge-borrador {
    background: var(--dark-gray);
    color: white;
}

.badge-incompleto {
    background: var(--warning-color);
    color: white;
}

.badge-completo {
    background: var(--success-color);
    color: white;
}

/* Barra de progreso */
.progress-wrapper {
    margin-bottom: 15px;
}

.progress {
    height: 8px;
    border-radius: 10px;
}

/* Campos condicionales */
.conditional-field {
    display: none;
}

.conditional-field.show {
    display: block;
    animation: fadeIn 0.3s;
}

/* Loading spinner */
.spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.spinner-overlay.show {
    display: flex;
}

/* Reportes */
.chart-container {
    position: relative;
    height: 300px;
    margin-bottom: 30px;
}

.report-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

/* Responsive */
@media (max-width: 768px) {
    .wizard-steps {
        flex-wrap: nowrap;
    }

    .wizard-step {
        min-width: 80px;
    }

    .step-title {
        font-size: 10px;
    }

    .form-section {
        padding: 15px;
    }

    .form-navigation {
        padding: 15px;
    }
}

/* Tooltips personalizados */
.tooltip-custom {
    position: relative;
    display: inline-block;
    cursor: help;
}

.tooltip-custom .tooltiptext {
    visibility: hidden;
    width: 200px;
    background-color: #555;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 5px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -100px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 12px;
}

.tooltip-custom:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }

    body {
        font-size: 12px;
    }

    .form-wizard {
        box-shadow: none;
    }
}
