/* TPV CBTA256 Estilos */

#tpv-container {
    max-width: 900px;
    margin: 20px auto;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background-color: #f9f9f9;
    font-family: Arial, sans-serif;
}

#tpv-container h3 {
    color: #2c3e50;
    text-align: center;
    margin-bottom: 30px;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
}

.tpv-section {
    margin-bottom: 25px;
    padding: 15px;
    background-color: white;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.tpv-section label {
    font-weight: bold;
    display: block;
    margin-bottom: 8px;
    color: #34495e;
}

#buscar-aspirante {
    width: 100%;
    padding: 12px;
    border: 2px solid #bdc3c7;
    border-radius: 4px;
    font-size: 16px;
    transition: border-color 0.3s;
}

#buscar-aspirante:focus {
    border-color: #3498db;
    outline: none;
    box-shadow: 0 0 5px rgba(52, 152, 219, 0.3);
}

#datos-aspirante {
    background-color: white;
    padding: 20px;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.aspirante-info {
    background-color: #ecf0f1;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.aspirante-info p {
    margin: 5px 0;
    font-size: 14px;
}

.conceptos-pago {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.concepto-item {
    text-align: center;
}

.btn-concepto, .btn-todos {
    width: 100%;
    padding: 15px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: all 0.3s;
}

.btn-concepto {
    background-color: #3498db;
    color: white;
}

.btn-concepto:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
}

.btn-concepto.selected {
    background-color: #27ae60;
}

.btn-concepto.ya-pagado {
    background-color: #95a5a6;
    cursor: not-allowed;
    opacity: 0.6;
}

.btn-todos {
    background-color: #e74c3c;
    color: white;
}

.btn-todos:hover {
    background-color: #c0392b;
}

/* Estilos para la sección de observaciones */
.observaciones-section {
    margin-bottom: 25px;
    padding: 15px;
    background-color: white;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

#observaciones {
    width: 100%;
    padding: 12px;
    border: 2px solid #bdc3c7;
    border-radius: 4px;
    font-size: 14px;
    font-family: Arial, sans-serif;
    resize: vertical;
    min-height: 80px;
    transition: border-color 0.3s;
}

#observaciones:focus {
    border-color: #3498db;
    outline: none;
    box-shadow: 0 0 5px rgba(52, 152, 219, 0.3);
}

#observaciones::placeholder {
    color: #7f8c8d;
    font-style: italic;
}

#recibo-preview {
    background-color: white;
    border: 2px solid #34495e;
    border-radius: 5px;
    padding: 20px;
    margin-top: 20px;
}

.recibo-header {
    text-align: center;
    border-bottom: 1px solid #bdc3c7;
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.recibo-header h5 {
    font-size: 24px;
    margin: 0 0 10px 0;
    color: #2c3e50;
}

.recibo-tabla {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.recibo-tabla th,
.recibo-tabla td {
    border: 1px solid #bdc3c7;
    padding: 10px;
    text-align: center;
}

.recibo-tabla th {
    background-color: #34495e;
    color: white;
    font-weight: bold;
}

.recibo-tabla tbody tr:nth-child(even) {
    background-color: #f8f9fa;
}

.recibo-tabla tfoot td {
    background-color: #ecf0f1;
    font-weight: bold;
    font-size: 16px;
}

/* Estilos para la preview de observaciones */
.observaciones-preview {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 12px;
    margin: 15px 0;
}

.observaciones-preview p {
    margin: 0;
    font-size: 14px;
    line-height: 1.4;
}

#observaciones-preview {
    font-style: italic;
    color: #6c757d;
}

.recibo-acciones {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 20px;
}

.btn-pagar, .btn-limpiar {
    padding: 12px 30px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.3s;
}

.btn-pagar {
    background-color: #27ae60;
    color: white;
}

.btn-pagar:hover:not(:disabled) {
    background-color: #229954;
}

.btn-pagar:disabled {
    background-color: #95a5a6;
    cursor: not-allowed;
}

.btn-limpiar {
    background-color: #f39c12;
    color: white;
}

.btn-limpiar:hover {
    background-color: #e67e22;
}

/* Modal Styles */
#modal-confirmacion {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.7);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: white;
    padding: 30px;
    border-radius: 8px;
    text-align: center;
    max-width: 400px;
    width: 90%;
}

.modal-content h4 {
    color: #2c3e50;
    margin-bottom: 15px;
}

.modal-acciones {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 20px;
}

.modal-acciones button {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
}

#confirmar-pago {
    background-color: #27ae60;
    color: white;
}

#cancelar-pago {
    background-color: #e74c3c;
    color: white;
}

/* Dashboard Styles */
#dashboard-container {
    max-width: 1200px;
    margin: 20px auto;
    padding: 20px;
}

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    text-align: center;
    border-left: 4px solid #3498db;
}

.stat-card h4 {
    margin: 0 0 10px 0;
    color: #34495e;
}

.stat-number {
    font-size: 28px;
    font-weight: bold;
    color: #2c3e50;
}

.dashboard-charts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.chart-section {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.chart-section h4 {
    margin: 0 0 15px 0;
    color: #34495e;
    border-bottom: 2px solid #3498db;
    padding-bottom: 8px;
}

.dashboard-table {
    width: 100%;
    border-collapse: collapse;
}

.dashboard-table th,
.dashboard-table td {
    border: 1px solid #ddd;
    padding: 10px;
    text-align: left;
    font-size: 13px;
}

.dashboard-table th {
    background-color: #f8f9fa;
    font-weight: bold;
}

.dashboard-table tbody tr:hover {
    background-color: #f1f2f6;
}

.dashboard-filters {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.filter-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    align-items: end;
}

.filter-row label {
    font-weight: bold;
    margin-bottom: 5px;
    display: block;
}

.filter-row input {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.filter-row button {
    padding: 8px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
}

#aplicar-filtros {
    background-color: #3498db;
    color: white;
}

#exportar-excel {
    background-color: #27ae60;
    color: white;
}

/* Resumen de filtros */
.resumen-filtros {
    background-color: #e8f5e8;
    border: 1px solid #4caf50;
    border-radius: 5px;
    padding: 15px;
    margin-bottom: 20px;
}

.resumen-filtros p {
    margin: 5px 0;
    font-weight: bold;
}

/* jQuery UI Autocomplete customization */
.ui-autocomplete {
    max-height: 200px;
    overflow-y: auto;
    overflow-x: hidden;
    border: 1px solid #3498db;
    border-radius: 4px;
}

.ui-menu-item {
    padding: 8px 12px;
    border-bottom: 1px solid #ecf0f1;
}

.ui-state-active {
    background-color: #3498db !important;
    color: white !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    .conceptos-pago {
        grid-template-columns: 1fr;
    }
    
    .recibo-acciones {
        flex-direction: column;
    }
    
    .dashboard-stats {
        grid-template-columns: 1fr;
    }
    
    .dashboard-charts {
        grid-template-columns: 1fr;
    }
    
    .filter-row {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        margin: 20px;
        width: calc(100% - 40px);
    }
    
    .dashboard-table th,
    .dashboard-table td {
        font-size: 11px;
        padding: 6px;
    }
    
    /* Para móviles, hacer que las tablas sean scrollables horizontalmente */
    .dashboard-table {
        font-size: 12px;
    }
    
    .chart-section {
        overflow-x: auto;
    }
}

@media (max-width: 480px) {
    #tpv-container {
        margin: 10px;
        padding: 15px;
    }
    
    .aspirante-info p {
        font-size: 12px;
    }
    
    .btn-concepto, .btn-todos {
        padding: 12px;
        font-size: 12px;
    }
    
    .recibo-tabla th,
    .recibo-tabla td {
        padding: 6px;
        font-size: 12px;
    }
    
    #observaciones {
        font-size: 12px;
        min-height: 60px;
    }
}

/* Animation for loading states */
.loading {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.loading::after {
    content: "Cargando...";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(255,255,255,0.9);
    padding: 10px 20px;
    border-radius: 4px;
    font-weight: bold;
    z-index: 1000;
}

/* Success and error messages */
.mensaje-exito {
    background-color: #d4edda;
    color: #155724;
    padding: 12px;
    border: 1px solid #c3e6cb;
    border-radius: 4px;
    margin: 10px 0;
    animation: slideDown 0.3s ease-out;
}

.mensaje-error {
    background-color: #f8d7da;
    color: #721c24;
    padding: 12px;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    margin: 10px 0;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mejoras adicionales */
.recibo-header p {
    margin: 3px 0;
    font-size: 14px;
}

/* Estilos para secciones mejor organizadas */
.datos-aspirante h4 {
    color: #2c3e50;
    border-bottom: 1px solid #bdc3c7;
    padding-bottom: 5px;
    margin-bottom: 15px;
}

/* Separadores visuales */
.tpv-section + .tpv-section {
    margin-top: 20px;
}

/* Hover effects mejorados */
.btn-concepto:not(.ya-pagado):hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.btn-todos:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* Focus states mejorados */
.btn-concepto:focus,
.btn-todos:focus,
.btn-pagar:focus,
.btn-limpiar:focus {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

/* Print styles para cuando se necesite imprimir */
@media print {
    #tpv-container {
        box-shadow: none;
        border: none;
        background-color: white;
    }
    
    .btn-concepto,
    .btn-todos,
    .recibo-acciones,
    .tpv-section:not(#recibo-preview) {
        display: none !important;
    }
    
    #recibo-preview {
        border: 2px solid #000;
        page-break-inside: avoid;
    }
}