/* ARCHIVO: css/style.css 
   Propiedad de APV Services - Diseño Sobrio y Responsivo
*/

:root {
    --primary-blue: #003049;
    --accent-red: #D62828;
    --accent-orange: #F77F00;
    --bg-light: #ffffff;
    --text-light: #333333;
    --card-bg: #f8f9fa;
    --transition: all 0.3s ease;
}

/* Variables para Modo Oscuro */
[data-theme="dark"] {
    --bg-light: #1a1a1a;
    --text-light: #f5f5f5;
    --card-bg: #2d2d2d;
}

body {
    background-color: var(--bg-light);
    color: var(--text-light);
    font-family: 'Source Serif Pro', serif;
    margin: 0;
    padding: 0;
    transition: var(--transition);
}

h1, h2, h3, .supporting-text {
    font-family: 'Inria Serif', serif;
}

/* Contenedor Principal */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Switch Modo Oscuro */
.theme-switch-wrapper {
    display: flex;
    align-items: center;
    position: fixed;
    top: 20px;
    right: 20px;
}

.theme-switch {
    display: inline-block;
    height: 34px;
    position: relative;
    width: 60px;
}

.theme-switch input { display:none; }

.slider {
    background-color: #ccc;
    bottom: 0;
    cursor: pointer;
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    background-color: white;
    bottom: 4px;
    content: "";
    height: 26px;
    left: 4px;
    position: absolute;
    transition: .4s;
    width: 26px;
    border-radius: 50%;
}

input:checked + .slider { background-color: var(--primary-blue); }
input:checked + .slider:before { transform: translateX(26px); }

/* Ventanas Emergentes (Modales) */
.modal {
    display: none; 
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.6);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: var(--bg-light);
    margin: 5% auto;
    padding: 30px;
    border-radius: 15px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    position: relative;
    animation: slideDown 0.4s ease;
}

@keyframes slideDown {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Botones y Formularios */
.btn-apv {
    background-color: var(--primary-blue);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    transition: var(--transition);
}

.btn-apv:hover {
    background-color: var(--accent-orange);
    transform: scale(1.05);
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: var(--primary-blue);
    font-weight: 600;
}

.form-control {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    box-sizing: border-box; /* Importante para responsivo */
}

/* Checkbox Estilizado para Monto Exento */
.checkbox-container {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 15px 0;
}

/* Responsividad para móviles */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        margin: 10% auto;
        padding: 15px;
    }
    
    .btn-apv {
        width: 100%;
    }
}

/* Estilo para el input de Fecha (solo día) */
.date-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
}

.read-only-input {
    background-color: #eee;
    cursor: not-allowed;
}

/* Icono de Papelera CSS Puro */
.btn-delete {
    width: 30px;
    height: 30px;
    border-radius: 4px;
    border: none;
    background: transparent;
    cursor: pointer;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.trash-icon {
    width: 12px;
    height: 14px;
    background: var(--accent-red);
    position: relative;
    border-radius: 0 0 2px 2px;
}

.trash-icon::before {
    content: '';
    position: absolute;
    width: 16px;
    height: 2px;
    background: var(--accent-red);
    top: -4px;
    left: -2px;
    border-radius: 2px;
}

.trash-icon::after {
    content: '';
    position: absolute;
    width: 6px;
    height: 2px;
    background: var(--accent-red);
    top: -7px;
    left: 3px;
    border-radius: 2px 2px 0 0;
}

/* Estilo para campos deshabilitados */
input:disabled {
    background-color: #e9ecef !important;
    cursor: not-allowed;
    opacity: 0.6;
}

/* Responsividad para la tabla en móviles */
@media screen and (max-width: 768px) {
    #tablaExcel, #tablaExcel thead, #tablaExcel tbody, #tablaExcel th, #tablaExcel td, #tablaExcel tr {
        display: block; /* Convierte la tabla en bloques */
    }
    
    #tablaExcel thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }
    
    #tablaExcel tr {
        border: 1px solid var(--primary-blue);
        margin-bottom: 15px;
        border-radius: 10px;
        padding: 10px;
        background: #fff;
    }
    
    #tablaExcel td {
        border: none;
        position: relative;
        padding-left: 50% !important;
        text-align: right;
        min-height: 35px;
    }
    
    #tablaExcel td:before {
        position: absolute;
        left: 10px;
        width: 45%;
        padding-right: 10px;
        white-space: nowrap;
        text-align: left;
        font-weight: bold;
        color: var(--primary-blue);
        content: attr(data-label); /* Usa el nombre de la columna */
    }
}