/* General Body and Font Styles */
body { 
    font-family: 'Inter', sans-serif; 
    background-color: #f0f4f8; 
}

/* Common Card/Section Styles */
.data-section { 
    margin-bottom: 2.5rem; 
    background-color: #fff; 
    padding: 20px; 
    border-radius: 8px; 
    box-shadow: 0 4px 12px rgba(0,0,0,0.08); 
}

/* Loading Indicators and Overlays */
#loading-indicator, 
#processing-indicator, 
#gemini-processing-indicator, 
#saving-indicator, 
#report-loading-indicator,
#saving-indicator-viz {
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%;
    background-color: rgba(255, 255, 255, 0.9);
    z-index: 9999; 
    display: none; /* Initially hidden */
    flex-direction: column; 
    align-items: center; 
    justify-content: center;
    backdrop-filter: blur(4px); 
}

.spinner, .spinner-viz {
    border: 6px solid rgba(0, 0, 0, 0.1); 
    width: 60px; 
    height: 60px; 
    border-radius: 50%;
    animation: spin 1s linear infinite; 
}
.spinner { border-left-color: #4f46e5; } /* Indigo */
.spinner-viz { border-left-color: #10b981; } /* Green */

.button-spinner {
    width: 20px; 
    height: 20px;
    border-width: 3px;
}

@keyframes spin { 
    0% { transform: rotate(0deg); } 
    100% { transform: rotate(360deg); } 
}

/* Form Elements */
select:focus, 
button:focus, 
input[type="file"]:focus, 
input[type="date"]:focus,
td input:focus, 
td textarea:focus {
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.3); 
    outline: 0; 
}

td input[type="text"], 
td input[type="number"], 
td input[type="date"], 
td textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid #cbd5e1;
    border-radius: 0.375rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    box-sizing: border-box; 
}

td input:focus, td textarea:focus {
    border-color: #4f46e5;
}


/* Modal Styles */
.modal {
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%;
    background-color: rgba(0,0,0,0.6);
    display: flex; 
    align-items: center; 
    justify-content: center;
    z-index: 10000; 
    opacity: 0; 
    visibility: hidden; 
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
.modal.active {
    opacity: 1; 
    visibility: visible;
}
.modal-content {
    background-color: white; 
    padding: 20px; 
    border-radius: 8px;
    width: 90%; 
    max-height: 90vh;
    max-width: 1000px; 
    display: flex; 
    flex-direction: column;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}
.modal-content-lg {
     max-width: 800px;
}
.modal-header {
    display: flex; 
    justify-content: space-between; 
    align-items: center;
    padding-bottom: 10px; 
    border-bottom: 1px solid #eee;
}
.modal-body {
    flex-grow: 1; 
    overflow-y: auto; 
    padding-top: 15px;
    display: flex; 
    align-items: center; 
    justify-content: center; 
    background-color: #f9fafb; 
}
.modal-body iframe {
    width: 100%; 
    height: calc(90vh - 100px); 
    border: none;
}
.modal-body img { 
    max-width: 100%;
    max-height: calc(90vh - 100px); 
    object-fit: contain; 
}

/* File Upload List */
#selected-files-list div {
    padding: 0.25rem 0.5rem;
    background-color: #e0e7ff; 
    border-radius: 0.375rem; 
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    font-size: 0.875rem;
    color: #4b5563; 
}
#selected-files-list .file-icon {
    margin-right: 0.5rem;
    color: #4f46e5; 
}

/* Tabs */
.tab-button { 
    transition: all 0.3s ease; 
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem 0.5rem 0 0;
    font-weight: 500;
}

/* Tables */
table { 
    width: 100%; 
    border-collapse: collapse; 
    margin-bottom: 1.5rem; 
}
th, td { 
    border: 1px solid #e2e8f0; 
    padding: 10px 12px; 
    text-align: left; 
    font-size: 0.9rem; 
}
th { 
    background-color: #eef2ff; 
    font-weight: 600; 
    color: #4338ca; 
}

/* informe_analisis.html specific styles */
.kpi-card { 
    background-color: #e0e7ff; 
    padding: 1.5rem; 
    border-radius: 0.5rem; 
    text-align: center; 
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}
.kpi-value { 
    font-size: 2rem; 
    font-weight: 700; 
    color: #4f46e5; 
}
.kpi-label { 
    font-size: 0.9rem; 
    color: #64748b; 
    margin-top: 0.25rem; 
}
.chart-container { 
    height: 350px; 
    margin-bottom: 2rem; 
}
.table-procesados-detalle { 
    margin-top: 1rem; 
    border: 1px solid #d1d5db; 
    border-radius: 0.375rem; 
}
.table-procesados-detalle th { 
    background-color: #f3f4f6; 
    color: #374151; 
}
.table-procesados-detalle td { 
    font-size: 0.8rem; 
}

/* index.html (Menu) specific styles */
.menu-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.menu-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
}
