/* =========================================================
   INVENTORY MODULE STYLES
   ========================================================= */

/* Main Container Styles */
.inventory-container {
    background-color: #f8f9fa;
    border-radius: 0.5rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

/* Card Styles */
.inventory-card {
    border: none;
    border-radius: 0.5rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
    margin-bottom: 1.5rem;
    overflow: hidden;
    
    &:hover {
        transform: translateY(-5px);
        box-shadow: 0 1rem 2rem rgba(0, 0, 0, 0.15);
    }
    
    .card-header {
        background: linear-gradient(135deg, #4A90E2 0%, #2A4E6D 100%);
        color: #fff;
        font-weight: 600;
        border: none;
        padding: 1rem 1.25rem;
        
        .card-title {
            margin-bottom: 0;
            font-size: 1.2rem;
        }
    }
    
    .card-body {
        padding: 1.5rem;
    }
    
    .card-footer {
        background-color: #f8f9fa;
        border-top: 1px solid rgba(0, 0, 0, 0.05);
        padding: 1rem 1.25rem;
    }
}

/* Table Styles */
.inventory-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    
    thead {
        background: linear-gradient(135deg, #4A90E2 0%, #2A4E6D 100%);
        color: #fff;
    }
    
    th {
        padding: 1rem;
        font-weight: 600;
        text-transform: uppercase;
        font-size: 0.8rem;
        letter-spacing: 0.05rem;
        border: none;
    }
    
    tbody tr {
        transition: background-color 0.2s ease;
        
        &:hover {
            background-color: rgba(74, 144, 226, 0.05);
        }
    }
    
    td {
        padding: 0.75rem 1rem;
        vertical-align: middle;
        border-top: 1px solid #dee2e6;
    }
    
    .img-thumbnail {
        width: 60px;
        height: 60px;
        object-fit: cover;
        border-radius: 0.25rem;
        border: 1px solid #dee2e6;
        padding: 0.25rem;
        background-color: #fff;
    }
}

/* Badge Styles */
.badge-inventory {
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 50rem;
    text-transform: uppercase;
    letter-spacing: 0.05rem;
    
    &-success {
        background-color: #28a745;
        color: #fff;
    }
    
    &-warning {
        background-color: #ffc107;
        color: #212529;
    }
    
    &-danger {
        background-color: #dc3545;
        color: #fff;
    }
    
    &-info {
        background-color: #17a2b8;
        color: #fff;
    }
    
    &-secondary {
        background-color: #6c757d;
        color: #fff;
    }
}

/* Button Styles */
.btn-inventory {
    padding: 0.5rem 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05rem;
    border-radius: 0.25rem;
    transition: all 0.2s ease-in-out;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    
    i {
        margin-right: 0.5rem;
    }
    
    &-primary {
        background: linear-gradient(135deg, #4A90E2 0%, #2A4E6D 100%);
        border: none;
        color: #fff;
        
        &:hover {
            background: linear-gradient(135deg, #2A4E6D 0%, #4A90E2 100%);
            transform: translateY(-2px);
            box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
        }
    }
    
    &-success {
        background: linear-gradient(135deg, #28a745 0%, #145523 100%);
        border: none;
        color: #fff;
        
        &:hover {
            background: linear-gradient(135deg, #145523 0%, #28a745 100%);
            transform: translateY(-2px);
            box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
        }
    }
    
    &-danger {
        background: linear-gradient(135deg, #dc3545 0%, #881c24 100%);
        border: none;
        color: #fff;
        
        &:hover {
            background: linear-gradient(135deg, #881c24 0%, #dc3545 100%);
            transform: translateY(-2px);
            box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
        }
    }
    
    &-warning {
        background: linear-gradient(135deg, #ffc107 0%, #b28603 100%);
        border: none;
        color: #212529;
        
        &:hover {
            background: linear-gradient(135deg, #b28603 0%, #ffc107 100%);
            transform: translateY(-2px);
            box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
        }
    }
    
    &-info {
        background: linear-gradient(135deg, #17a2b8 0%, #0c525d 100%);
        border: none;
        color: #fff;
        
        &:hover {
            background: linear-gradient(135deg, #0c525d 0%, #17a2b8 100%);
            transform: translateY(-2px);
            box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
        }
    }
}

/* Form Styles */
.form-inventory {
    .form-group {
        margin-bottom: 1.5rem;
    }
    
    label {
        font-weight: 600;
        font-size: 0.9rem;
        margin-bottom: 0.5rem;
        color: #2A4E6D;
    }
    
    .form-control {
        border-radius: 0.25rem;
        border: 1px solid #ced4da;
        padding: 0.75rem 1rem;
        height: auto;
        transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
        
        &:focus {
            border-color: #4A90E2;
            box-shadow: 0 0 0 0.2rem rgba(74, 144, 226, 0.25);
        }
    }
    
    .select2-container--default {
        .select2-selection--single {
            border-radius: 0.25rem;
            border: 1px solid #ced4da;
            height: calc(2.5rem + 2px);
            padding: 0.375rem 0.75rem;
            
            .select2-selection__rendered {
                line-height: 1.5;
                padding-left: 0;
                color: #495057;
            }
            
            .select2-selection__arrow {
                height: calc(2.5rem);
            }
        }
    }
}

/* Filter Card Styles */
.filter-card {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
    
    .card-header {
        background-color: transparent;
        border-bottom: 1px solid #dee2e6;
        padding: 1rem 1.25rem;
    }
    
    .card-body {
        padding: 1.25rem;
    }
}

/* Status Indicators */
.status-indicator {
    display: inline-block;
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 50%;
    margin-right: 0.5rem;
    
    &-active {
        background-color: #28a745;
    }
    
    &-inactive {
        background-color: #6c757d;
    }
    
    &-maintenance {
        background-color: #ffc107;
    }
    
    &-low {
        background-color: #dc3545;
    }
}

/* Modal Styles */
.inventory-modal {
    .modal-header {
        background: linear-gradient(135deg, #4A90E2 0%, #2A4E6D 100%);
        color: #fff;
        border: none;
    }
    
    .modal-title {
        font-weight: 600;
    }
    
    .modal-body {
        padding: 1.5rem;
    }
    
    .modal-footer {
        border-top: 1px solid rgba(0, 0, 0, 0.05);
        padding: 1rem 1.25rem;
    }
    
    &.fade {
        transition: opacity 0.2s linear !important;
    }
    
    &.fade .modal-dialog {
        transition: transform 0.2s ease-out !important;
        transform: translate(0, -25px) !important;
    }
    
    &.show .modal-dialog {
        transform: translate(0, 0) !important;
    }
}

/* Modal Backdrop específico para evitar parpadeo */
.modal-backdrop {
    opacity: 0;
    transition: opacity 0.15s linear;
    
    &.show {
        opacity: 0.5;
    }
    
    &.fade {
        opacity: 0;
    }
}

/* Modal abierto */
.modal.show {
    padding-right: 17px;
    
    .modal-dialog {
        transform: translate(0, 0) !important;
    }
}

/* Para categorías con productos asociados */
.modal-static {
    .modal-dialog {
        transform: none !important;
    }
}

/* Details View */
.product-details {
    position: relative;
    padding: 1.5rem;
    background-color: #fff;
    border-radius: 0.5rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    margin-bottom: 1.5rem;
    
    .product-image {
        max-width: 100%;
        height: auto;
        border-radius: 0.25rem;
        box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    }
    
    h2 {
        color: #2A4E6D;
        margin-bottom: 1.5rem;
        font-weight: 700;
    }
    
    dl {
        dt {
            font-weight: 600;
            color: #6c757d;
            margin-bottom: 0.25rem;
        }
        
        dd {
            margin-bottom: 1rem;
        }
    }
}

/* Category & Supplier Badge */
.entity-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 0.75rem;
    background-color: #e9ecef;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    margin: 0.25rem;
    color: #495057;
    transition: all 0.2s ease-in-out;
    
    &:hover {
        background-color: #dee2e6;
        text-decoration: none;
        color: #212529;
    }
    
    i {
        margin-right: 0.5rem;
        color: #4A90E2;
    }
}

/* Low Stock Alert */
.low-stock-alert {
    background-color: #fff3cd;
    color: #856404;
    border-left: 5px solid #ffc107;
    padding: 1rem;
    margin-bottom: 1.5rem;
    border-radius: 0.25rem;
    
    i {
        font-size: 1.5rem;
        margin-right: 0.5rem;
    }
}

/* Transaction History */
.transaction-history {
    max-height: 400px;
    overflow-y: auto;
}

.transaction-item {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    border-bottom: 1px solid #dee2e6;
    transition: background-color 0.2s ease;
    
    &:hover {
        background-color: rgba(74, 144, 226, 0.05);
    }
    
    &:last-child {
        border-bottom: none;
    }
    
    .transaction-icon {
        width: 2.5rem;
        height: 2.5rem;
        display: flex;
        align-items: center;
        justify-content: center;
        background-color: #e9ecef;
        border-radius: 50%;
        margin-right: 1rem;
    }
    
    .transaction-entry .transaction-icon {
        background-color: #d4edda;
        color: #28a745;
    }
    
    .transaction-exit .transaction-icon {
        background-color: #f8d7da;
        color: #dc3545;
    }
    
    .transaction-adjustment .transaction-icon {
        background-color: #fff3cd;
        color: #ffc107;
    }
    
    .transaction-info {
        flex: 1;
        
        .transaction-title {
            font-weight: 600;
            margin-bottom: 0.25rem;
        }
        
        .transaction-meta {
            color: #6c757d;
            font-size: 0.875rem;
        }
    }
    
    .transaction-quantity {
        font-weight: 700;
        font-size: 1.1rem;
    }
} 