/* Layout principal */
.layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 250px;
    background-color: #2c3e50;
    color: white;
    transition: width 0.3s ease;
    position: relative;
}

.sidebar.collapsed {
    width: 60px;
}

.sidebar-header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    position: relative;
    width: 100%;
}

.sidebar h1 {
    font-size: 1.5rem;
    margin: 0;
    margin-left: 1rem;
    font-family: 'Roboto', sans-serif;
    font-weight: 700;  /* Bold */
    letter-spacing: 0.5px;  /* Mejor espaciado entre letras */
}

#toggle-sidebar {
    position: absolute;
    right: 10px;
    top: 10px;
}

.sidebar.collapsed .sidebar-header h1 {
    display: none;
}

.sidebar.collapsed nav a {
    justify-content: center;
    padding: 1rem 0;
}

.sidebar.collapsed nav span {
    display: none;
}

.sidebar.collapsed nav i {
    margin: 0;
    width: auto;
}

/* Navegación */
.sidebar nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar nav a {
    display: flex;
    align-items: center;
    padding: 1rem;
    color: white;
    text-decoration: none;
    transition: background-color 0.3s;
    font-family: 'Roboto', sans-serif;
    font-weight: 400;
    font-size: 1rem;
}

.sidebar nav span {
    margin-left: 1rem;
    letter-spacing: 0.3px;
}

.sidebar nav a:hover {
    background-color: #34495e;
}

.sidebar nav i {
    margin-right: 1rem;
    width: 20px;
    text-align: center;
    font-size: 1.1rem;
}

/* Contenido principal */
.main-content {
    flex: 1;
    padding: 2rem;
    background-color: #f5f6fa;
    transition: margin-left 0.3s ease;
}

.main-content.expanded {
    margin-left: -190px;
}

/* Sección de carga */
.content-container {
    max-width: 1200px;
    margin: 0 auto;
}

.upload-section {
    background-color: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.results-section {
    background-color: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Formulario */
.upload-form {
    margin-top: 1rem;
}

.form-group {
    margin-bottom: 1rem;
}

.btn {
    background-color: #3498db;
    color: white;
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.btn:hover {
    background-color: #2980b9;
}

/* Alertas */
.alert {
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 4px;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.error-container {
    max-width: 800px;
    margin: 20px auto;
    padding: 20px;
    background-color: #fff;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.error-message {
    padding: 15px;
    margin: 10px 0;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    color: #721c24;
}

.error-help {
    margin-top: 20px;
}

.error-help ul {
    list-style-type: disc;
    margin-left: 20px;
}

.current-config {
    margin-top: 20px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 4px;
}

.current-config ul {
    list-style-type: none;
    padding: 0;
}

.current-config li {
    margin: 5px 0;
    font-family: monospace;
}

.logo-container {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 1rem;
    width: 100%;
}

.logo {
    width: 120px;
    height: auto;
    margin-bottom: 0.5rem;
    margin-left: 1rem;
}

.sidebar.collapsed .logo-container {
    display: none;
}

/* Estadísticas */
.stats-section {
    background-color: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.stats-table {
    overflow-x: auto;
}

.stats-table table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.stats-table th,
.stats-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #e1e1e1;
}

.stats-table th {
    background-color: #f8f9fa;
    font-weight: 500;
}

.lote-row:hover {
    background-color: #f8f9fa;
}

.lote-row.error {
    background-color: #fff3f3;
}

.details-row td {
    padding: 1rem 2rem;
    background-color: #f8f9fa;
}

.btn-details {
    background-color: transparent;
    border: 1px solid #3498db;
    color: #3498db;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-details:hover {
    background-color: #3498db;
    color: white;
}

/* Estilos para la página de inicio */
.welcome-section {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
}

.welcome-section h1 {
    font-family: 'Roboto', sans-serif;
    font-weight: 700;
    font-size: 2.5rem;
    color: #2c3e50;
    margin-bottom: 2rem;
}

.info-box {
    background-color: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-top: 2rem;
}

.info-box h2 {
    font-family: 'Roboto', sans-serif;
    font-weight: 500;
    font-size: 1.8rem;
    color: #2c3e50;
    margin-bottom: 1.5rem;
}

.info-box h3 {
    font-family: 'Roboto', sans-serif;
    font-weight: 500;
    font-size: 1.4rem;
    color: #34495e;
    margin: 1.5rem 0 1rem;
}

.info-box p, .info-box ul {
    font-family: 'Roboto', sans-serif;
    font-weight: 400;
    font-size: 1.1rem;
    line-height: 1.6;
}

.info-box ul {
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}

.info-box ul ul {
    margin: 0.5rem 0;
}

.action-box {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #eee;
    text-align: center;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background-color: #3498db;
    color: white;
    padding: 1rem 2rem;
    border-radius: 4px;
    text-decoration: none;
    margin-top: 1rem;
    transition: background-color 0.3s;
}

.btn-primary:hover {
    background-color: #2980b9;
}

/* Estilos para la página de carga */
.upload-section h2 {
    font-family: 'Roboto', sans-serif;
    font-weight: 500;
    font-size: 2rem;
    color: #2c3e50;
    margin-bottom: 1.5rem;
}

.results-section h3 {
    font-family: 'Roboto', sans-serif;
    font-weight: 500;
    font-size: 1.6rem;
    color: #34495e;
    margin-bottom: 1rem;
}

/* Configuración */
.config-section {
    background-color: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.config-section h2 {
    font-family: 'Roboto', sans-serif;
    font-weight: 500;
    font-size: 2rem;
    color: #2c3e50;
    margin-bottom: 2rem;
}

.features-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.feature-item {
    padding: 1rem;
    border-radius: 6px;
    background-color: #f8f9fa;
    transition: background-color 0.3s;
}

.feature-item:hover {
    background-color: #f1f3f5;
}

.checkbox-container {
    display: flex;
    align-items: center;
    position: relative;
    padding-left: 35px;
    cursor: pointer;
    user-select: none;
}

.checkbox-container input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    position: absolute;
    left: 0;
    height: 20px;
    width: 20px;
    background-color: #eee;
    border: 2px solid #ccc;
    border-radius: 4px;
}

.checkbox-container input:checked ~ .checkmark {
    background-color: #3498db;
    border-color: #3498db;
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

.checkbox-container input:checked ~ .checkmark:after {
    display: block;
}

.checkbox-container .checkmark:after {
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.feature-info {
    margin-left: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.feature-name {
    font-family: 'Roboto', sans-serif;
    font-size: 1.1rem;
    color: #2c3e50;
}

.feature-status {
    font-size: 0.9rem;
    padding: 0.3rem 0.8rem;
    border-radius: 12px;
    font-weight: 500;
}

.feature-status.active {
    background-color: #cce5ff;
    color: #004085;
}

.feature-status.coming-soon {
    background-color: #e2e3e5;
    color: #383d41;
}

/* Modal de advertencia */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background-color: white;
    padding: 0;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.modal-header {
    background-color: #fff3cd;
    color: #856404;
    padding: 1rem;
    border-radius: 8px 8px 0 0;
}

.modal-header h3 {
    margin: 0;
    font-family: 'Roboto', sans-serif;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-body {
    padding: 1.5rem;
}

.modal-body p {
    margin: 0;
    color: #2c3e50;
    font-family: 'Roboto', sans-serif;
    line-height: 1.5;
}

.modal-footer {
    padding: 1rem;
    text-align: right;
    border-top: 1px solid #eee;
}

/* Media queries para responsividad */
@media (max-width: 768px) {
    .layout {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        position: fixed;
        top: 0;
        z-index: 100;
        height: auto;
        min-height: 60px;
    }
    
    .sidebar-header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 0.5rem;
        background-color: #2c3e50;
    }
    
    .logo-container {
        flex-direction: row;
        align-items: center;
        padding: 0.5rem;
    }
    
    .logo {
        width: 40px;
        height: 40px;
        margin: 0 0.5rem 0 0;
    }
    
    .sidebar h1 {
        font-size: 1.2rem;
        margin: 0;
    }
    
    .sidebar nav {
        display: none;
        position: absolute;
        top: 60px;
        left: 0;
        width: 100%;
        background-color: #2c3e50;
        box-shadow: 0 4px 6px rgba(0,0,0,0.1);
        z-index: 1000;  /* Asegurar que está por encima del contenido */
    }
    
    .sidebar.expanded nav {
        display: block !important;  /* Forzar visibilidad cuando está expandido */
    }
    
    .sidebar nav ul {
        padding: 0;
        margin: 0;
    }
    
    .sidebar nav li {
        border-top: 1px solid rgba(255,255,255,0.1);
    }
    
    .sidebar nav a {
        padding: 1rem 1.5rem;
        display: flex;
        align-items: center;
    }
    
    .sidebar nav i {
        margin-right: 1rem;
    }
    
    .main-content {
        margin-top: 60px;
        padding: 1rem;
    }
}

/* Ajustes para el botón de menú en móvil */
#toggle-sidebar {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    display: none;  /* Oculto por defecto */
}

@media (max-width: 768px) {
    #toggle-sidebar {
        display: block;  /* Visible en móvil */
    }
}

/* Clase para cuando el menú está expandido en móvil */
.sidebar.expanded {
    height: auto;
}

/* Sección de resultados */
.results-section {
    margin-top: 2rem;
}

.results-section h2 {
    color: #2c3e50;
    margin-bottom: 1.5rem;
    font-family: 'Roboto', sans-serif;
}

.summary-box {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
}

.summary-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    background-color: #f8f9fa;
    border-radius: 8px;
    min-width: 200px;
}

.summary-item i {
    font-size: 2rem;
    color: #3498db;
}

.summary-info {
    display: flex;
    flex-direction: column;
}

.summary-label {
    font-size: 0.9rem;
    color: #6c757d;
}

.summary-value {
    font-size: 1.5rem;
    font-weight: 500;
    color: #2c3e50;
}

.files-table {
    margin-top: 2rem;
}

.files-table h3 {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.files-table table {
    width: 100%;
    border-collapse: collapse;
}

.files-table th,
.files-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
}

.files-table th {
    background-color: #f8f9fa;
    font-weight: 500;
    color: #495057;
}

.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.875rem;
}

.status-badge.success {
    background-color: #d4edda;
    color: #155724;
}

.error-box {
    margin-top: 2rem;
    padding: 1.5rem;
    background-color: #fff3cd;
    border-radius: 8px;
}

.error-box h3 {
    color: #856404;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.error-box i {
    color: #856404;
}

.error-message {
    background-color: white;
    padding: 1rem;
    border-radius: 4px;
    color: #721c24;
}

/* Responsividad para la sección de resultados */
@media (max-width: 768px) {
    .summary-box {
        flex-direction: column;
        gap: 1rem;
    }

    .summary-item {
        width: 100%;
    }

    .files-table {
        overflow-x: auto;
    }
}

/* Botón secundario */
.btn-secondary {
    background-color: #6c757d;
    color: white;
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: background-color 0.3s;
}

.btn-secondary:hover {
    background-color: #5a6268;
}

.actions-box {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #e9ecef;
    text-align: right;
}

/* Estilos para el detalle de errores */
.errors-detail {
    margin-top: 2rem;
    padding: 1.5rem;
    background-color: #fff3cd;
    border-radius: 8px;
}

.errors-detail h3 {
    color: #856404;
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.file-errors {
    background-color: white;
    border-radius: 6px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.file-errors h4 {
    color: #2c3e50;
    font-size: 1rem;
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #eee;
}

.errors-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.error-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.5rem;
    background-color: #f8f9fa;
    border-radius: 4px;
}

.error-row {
    background-color: #e9ecef;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-family: monospace;
    color: #721c24;
}

.error-message {
    color: #495057;
}

.btn-success {
    background-color: #28a745;
    color: white;
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: background-color 0.3s;
}

.btn-success:hover {
    background-color: #218838;
}