/* Estilos personalizados para el sistema de farmacia */
body {
    background: #ffffff;
    min-height: 100vh;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.container-fluid {
    padding-bottom: 2rem;
}

.card {
    border: none;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

.table th {
    border-top: none;
    font-weight: 600;
    font-size: 0.85rem;
    background-color: #343a40 !important;
    color: white;
    vertical-align: middle;
    position: sticky;
    top: 0;
    z-index: 10;
}

/* Hacer tabla redimensionable */
.table th, .table td {
    position: relative;
    white-space: nowrap;
    overflow: hidden;
}

.table th {
    resize: horizontal;
    overflow: visible;
    min-width: 50px;
}

.table th:last-child {
    resize: none;
}

/* Estilos para checkboxes */
.product-checkbox {
    transform: scale(1.2);
    cursor: pointer;
}

#selectAllCheckbox {
    transform: scale(1.3);
    cursor: pointer;
}

/* Estilos para nombres de productos completos */
.table td:nth-child(2) {
    word-wrap: break-word;
    white-space: normal;
    max-width: none;
}

.table td:nth-child(2) div {
    line-height: 1.4;
    padding: 4px 0;
}

/* Hover effects */
.table tbody tr:hover {
    background-color: rgba(0, 123, 255, 0.1);
    cursor: pointer;
}

.table tbody tr:hover .product-checkbox {
    opacity: 1;
}

/* Botones de selección */
.btn-selection {
    transition: all 0.3s ease;
}

.btn-selection:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.table td {
    vertical-align: middle;
    font-size: 0.85rem;
}

.btn {
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.alert {
    border-radius: 12px;
    border: none;
}

.product-card {
    background: white;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.product-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
}

.product-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
    margin-bottom: 10px;
}

.info-item {
    display: flex;
    flex-direction: column;
}

.info-label {
    font-size: 0.75rem;
    color: #6c757d;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.info-value {
    font-size: 0.9rem;
    font-weight: 600;
    color: #495057;
}

.price-sale {
    color: #28a745;
    font-size: 1rem;
}

.price-purchase {
    color: #6c757d;
    font-size: 0.85rem;
}

.stock-info {
    font-weight: bold;
    color: #007bff;
}

.barcode-display {
    font-family: monospace;
    background: #f8f9fa;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.8rem;
}

.lots-container {
    margin-top: 10px;
}

.lot-item {
    background: #f8f9fa;
    border-radius: 6px;
    padding: 6px 10px;
    margin-bottom: 4px;
    font-size: 0.8rem;
    border-left: 3px solid #007bff;
}

.lot-code {
    font-weight: 600;
    color: #007bff;
}

.lot-quantity {
    color: #28a745;
    font-weight: 500;
}

.lot-expiry {
    color: #dc3545;
    font-weight: 500;
}

.lot-expiry.expired {
    color: #dc3545;
    font-weight: bold;
}

.lot-expiry.warning {
    color: #fd7e14;
    font-weight: bold;
}

.modal-content {
    border-radius: 20px;
    border: none;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-header {
    border-radius: 20px 20px 0 0;
    border: none;
}

.loading {
    text-align: center;
    padding: 40px;
    color: #6c757d;
}

.no-results {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
}

.no-results i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Responsive */
@media (max-width: 768px) {
    .container-fluid {
        padding: 0.5rem;
    }

    .card {
        margin-bottom: 1rem;
        border-radius: 10px;
    }

    .product-info {
        grid-template-columns: 1fr;
    }

    .table-responsive {
        font-size: 0.75rem;
        max-height: 70vh;
        overflow-y: auto;
    }

    .table th, .table td {
        padding: 0.5rem;
    }

    .btn {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }

    .btn-group .btn {
        font-size: 0.8rem;
        padding: 0.5rem 0.75rem;
    }

    .modal-body {
        padding: 1rem;
    }

    h1 {
        font-size: 1.5rem;
    }

    .card-header h5 {
        font-size: 1rem;
    }
}

@media (max-width: 576px) {
    h1 {
        font-size: 1.5rem;
    }

    .product-card {
        padding: 12px;
    }

    .product-name {
        font-size: 1rem;
    }
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.product-card {
    animation: fadeIn 0.5s ease-out;
}

/* Custom scrollbar */
.table-responsive::-webkit-scrollbar {
    height: 8px;
}

.table-responsive::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.table-responsive::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 10px;
}

.table-responsive::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Status indicators */
.status-active {
    color: #28a745;
}

.status-inactive {
    color: #dc3545;
}

.stock-low {
    color: #fd7e14;
    font-weight: bold;
}

.stock-normal {
    color: #28a745;
}

.stock-high {
    color: #007bff;
}