/* Custom CSS for TomaPedidos System */

/* General Styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.navbar-brand {
    font-weight: bold;
}

.card {
    transition: all 0.3s ease;
}

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

/* Dashboard Cards */
.dashboard-card {
    border-left: 4px solid;
    background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
}

.dashboard-card.primary {
    border-left-color: #0d6efd;
}

.dashboard-card.success {
    border-left-color: #198754;
}

.dashboard-card.warning {
    border-left-color: #ffc107;
}

.dashboard-card.danger {
    border-left-color: #dc3545;
}

.dashboard-card .card-icon {
    font-size: 2.5rem;
    opacity: 0.8;
}

/* Tables */
.table {
    font-size: 0.9rem;
}

.table th {
    background-color: #f8f9fa;
    border-top: none;
    font-weight: 600;
}

.table-hover tbody tr:hover {
    background-color: rgba(13, 110, 253, 0.05);
}

/* Buttons */
.btn {
    border-radius: 0.375rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.btn-sm {
    padding: 0.25rem 0.75rem;
    font-size: 0.8rem;
}

/* Forms */
.form-control:focus {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.15);
}

.form-select:focus {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.15);
}

/* Login Page */
.login-container {
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* Status badges */
.badge {
    font-size: 0.75rem;
    font-weight: 500;
}

/* Loading */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.spinner-border-sm {
    width: 1rem;
    height: 1rem;
    border-width: 0.1rem;
}

/* DataTables Custom */
.dataTables_wrapper .dataTables_paginate .paginate_button {
    padding: 0.375rem 0.75rem;
    margin: 0 0.125rem;
    border-radius: 0.25rem;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: #0d6efd !important;
    border-color: #0d6efd !important;
    color: white !important;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .container-fluid {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    .table-responsive {
        font-size: 0.8rem;
    }
    
    .btn-group-vertical .btn {
        margin-bottom: 0.25rem;
    }
}

/* Print styles */
@media print {
    .navbar, .btn, .no-print {
        display: none !important;
    }
    
    .container-fluid {
        margin: 0;
        padding: 0;
    }
}

/* Animation utilities */
.fade-in {
    animation: fadeIn 0.3s ease-in;
}

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

.slide-up {
    animation: slideUp 0.3s ease-out;
}

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

/* Modal improvements */
.modal-content {
    border-radius: 0.5rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.modal-header {
    border-bottom: 1px solid #dee2e6;
    background-color: #f8f9fa;
}

/* Utilities */
.text-primary-custom {
    color: #0d6efd !important;
}

.bg-primary-light {
    background-color: rgba(13, 110, 253, 0.1) !important;
}

.border-primary-light {
    border-color: rgba(13, 110, 253, 0.3) !important;
}

/* Buscadores dinámicos */
.dropdown-menu {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    z-index: 1050;
}

.dropdown-item {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f8f9fa;
    cursor: pointer;
    transition: all 0.2s ease;
}

.dropdown-item:hover {
    background-color: #f8f9fa;
    transform: translateX(2px);
}

.dropdown-item:last-child {
    border-bottom: none;
}

.cliente-item:hover {
    background-color: rgba(25, 135, 84, 0.1);
    border-left: 3px solid #198754;
}

.producto-item:hover {
    background-color: rgba(13, 110, 253, 0.1);
    border-left: 3px solid #0d6efd;
}

.crear-cliente-item {
    background-color: rgba(25, 135, 84, 0.05);
    border-left: 3px solid #198754;
    font-weight: 500;
}

.crear-cliente-item:hover {
    background-color: rgba(25, 135, 84, 0.15);
}

.crear-producto-item {
    background-color: rgba(13, 202, 240, 0.05);
    border-left: 3px solid #0dcaf0;
    font-weight: 500;
}

.crear-producto-item:hover {
    background-color: rgba(13, 202, 240, 0.15);
}

/* Efectos de búsqueda */
.input-group input:focus {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.15);
}

.searching {
    position: relative;
}

.searching::after {
    content: '';
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    border: 2px solid #0d6efd;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: translateY(-50%) rotate(360deg);
    }
}

/* Estilos para tabla de productos en ventas */
#productosVentaTable {
    white-space: nowrap;
}

#productosVentaTable .comentarios-producto {
    font-size: 0.85rem;
    min-height: 32px;
    resize: horizontal;
}

#productosVentaTable .comentarios-producto:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

#productosVentaTable th:nth-child(5) {
    min-width: 180px;
}

#productosVentaTable td {
    vertical-align: middle;
    padding: 0.5rem 0.3rem;
}

#productosVentaTable .cantidad-producto,
#productosVentaTable .precio-producto {
    text-align: center;
}

/* Responsive adjustments for product table */
@media (max-width: 768px) {
    #productosVentaTable .comentarios-producto {
        min-width: 120px;
        font-size: 0.8rem;
    }
    
    #productosVentaTable th:nth-child(5) {
        min-width: 130px;
    }
}