/* Custom styles for Warehouses API */

/* Smooth transitions */
.card, .btn, .form-control {
    transition: all 0.3s ease;
}

/* Custom Category Dropdown Styles */
#categoryDropdownBtn {
    text-align: right;
    font-size: 0.875rem;
    padding: 0.375rem 0.75rem;
    border: 1px solid #ced4da;
}
/* 
#categoryDropdownBtn:hover {
    background-color: #f8f9fa;
    border-color: #86b7fe;
} */

#categoryDropdownMenu {
    max-height: 300px;
    overflow-y: auto;
    padding: 0.5rem;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.dropdown-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.25rem;
    border-radius: 0.25rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.dropdown-item:hover {
    background-color: #f8f9fa;
}

.dropdown-item.selected {
    background-color: #e7f3ff;
    border: 1px solid #b3d9ff;
}

.dropdown-item-left {
    display: flex;
    align-items: center;
    flex: 1;
}

.dropdown-item-checkbox {
    width: 16px;
    height: 16px;
    margin-left: 0.5rem;
    border: 2px solid #007bff;
    border-radius: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    color: white;
    background-color: white;
    transition: all 0.2s ease;
}

.dropdown-item-checkbox.checked {
    background-color: #007bff;
}

.dropdown-item-checkbox.checked::before {
    content: "✓";
}

.dropdown-item-name {
    margin: 0;
    font-size: 0.9rem;
    color: #212529;
}

.dropdown-item small.text-muted {
    font-size: 0.75rem;
    font-weight: 500;
}

.dropdown-divider {
    margin: 0.5rem 0;
    border-color: #e9ecef;
}

.dropdown-item-controls {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.dropdown-item-btn {
    width: 20px;
    height: 20px;
    border: 1px solid #dee2e6;
    background-color: white;
    border-radius: 0.125rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.6rem;
    color: #6c757d;
}

.dropdown-item-btn:hover {
    background-color: #007bff;
    color: white;
    border-color: #007bff;
    transform: scale(1.1);
}

.dropdown-item-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.dropdown-item-btn:disabled:hover {
    background-color: white;
    color: #6c757d;
    border-color: #dee2e6;
    transform: none;
}

/* Enhanced Filter Management Styles */
#filterOrderSection {
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

/* Category Checkboxes */
.category-checkboxes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.5rem;
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: 0.375rem;
    border: 1px solid #e9ecef;
    max-height: 200px;
    overflow-y: auto;
}

.category-checkbox-item {
    display: flex;
    align-items: center;
    padding: 0.5rem;
    background-color: white;
    border: 1px solid #dee2e6;
    border-radius: 0.25rem;
    transition: all 0.2s ease;
    cursor: pointer;
}

.category-checkbox-item:hover {
    background-color: #f0f8ff;
    border-color: #007bff;
    transform: translateY(-1px);
}

.category-checkbox-item input[type="checkbox"] {
    margin-left: 0.5rem;
    transform: scale(1.1);
}

.category-checkbox-item label {
    margin: 0;
    cursor: pointer;
    flex: 1;
    font-size: 0.9rem;
}

/* Order List */
.order-list {
    min-height: 150px;
    max-height: 300px;
    overflow-y: auto;
    padding: 0.5rem;
    background-color: #f8f9fa;
    border-radius: 0.375rem;
    border: 1px solid #e9ecef;
}

.order-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    background-color: white;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.order-item:hover {
    background-color: #f8f9fa;
    border-color: #007bff;
    transform: translateX(2px);
}

.order-item-info {
    display: flex;
    align-items: center;
    flex: 1;
}

.order-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background-color: #007bff;
    color: white;
    border-radius: 50%;
    font-size: 0.8rem;
    font-weight: bold;
    margin-left: 0.5rem;
}

.order-controls {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.order-btn {
    width: 28px;
    height: 28px;
    border: 1px solid #dee2e6;
    background-color: white;
    border-radius: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.8rem;
}

.order-btn:hover {
    background-color: #007bff;
    color: white;
    border-color: #007bff;
    transform: scale(1.1);
}

.order-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.order-btn:disabled:hover {
    background-color: white;
    color: inherit;
    border-color: #dee2e6;
    transform: none;
}

/* Empty state */
.order-list:empty::before {
    content: "لم يتم اختيار أي فئات";
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100px;
    color: #6c757d;
    font-style: italic;
}

/* Animation for adding/removing items */
.order-item {
    animation: slideIn 0.3s ease;
}

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

/* Hover effects */
.card:hover {
    /* transform: translateY(-2px); */
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.btn:hover {
    transform: translateY(-1px);
}

/* Image upload styles */
.image-upload-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 10px;
}

.image-upload-label {
    cursor: pointer;
    display: inline-block;
}

.image-upload-box {
    width: 120px;
    height: 120px;
    border: 2px dashed #ccc;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
    background-color: #f8f9fa;
}

.image-upload-box:hover {
    border-color: #007bff;
    background-color: #f0f8ff;
}

.image-preview {
    position: relative;
    width: 120px;
    height: 120px;
    margin-bottom: 10px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-delete {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 24px;
    height: 24px;
    background-color: rgba(220, 53, 69, 0.8);
    color: white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}

.image-delete:hover {
    background-color: #dc3545;
    transform: scale(1.1);
}

/* Loading animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Status badges */
.status-active {
    background-color: #198754;
    color: white;
}

.status-inactive {
    background-color: #6c757d;
    color: white;
}

.status-maintenance {
    background-color: #fd7e14;
    color: white;
}

/* Form validation styles */
.form-control.is-invalid {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

.form-select.is-invalid {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

/* Responsive improvements */
@media (max-width: 768px) {
    .hero-section {
        padding: 2rem 0;
    }
    
    .display-4 {
        font-size: 2.5rem;
    }
    
    .btn-lg {
        padding: 0.5rem 1rem;
        font-size: 1rem;
    }
}

/* Global mobile responsiveness */
@media (max-width: 992px) {
    .card-header .d-flex {
        gap: .75rem;
    }
}

@media (max-width: 576px) {
    /* Stack header controls */
    .card-header .d-flex {
        flex-direction: column !important;
        align-items: stretch !important;
    }

    .card-header .d-flex > * {
        width: 100% !important;
    }

    /* Inputs/selects full width */
    .input-group,
    .form-select,
    .form-control {
        width: 100% !important;
    }

    /* Table adjustments */
    .table td,
    .table th {
        padding: .5rem .5rem;
        font-size: .9rem;
        white-space: nowrap;
    }
    .table td .badge {
        white-space: nowrap;
        font-size: .75rem;
    }
    /* Product images in tables smaller on mobile */
    table img.img-thumbnail {
        width: 40px !important;
        height: 40px !important;
    }

    /* Buttons tighter on mobile */
    .btn {
        padding: .4rem .6rem;
        font-size: .9rem;
    }
    .btn-group .btn {
        padding: .35rem .55rem;
        font-size: .85rem;
    }

    /* Cards spacing */
    .card-body {
        padding: .9rem;
    }
    .card-header {
        padding: .75rem 1rem;
    }
}

/* Utilities */
.mobile-hidden { display: inherit; }
.mobile-only { display: none; }
@media (max-width: 576px) {
    .mobile-hidden { display: none !important; }
    .mobile-only { display: inherit !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;
}

/* Animation for page load */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

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

/* Table improvements */
.table th {
    border-top: none;
    font-weight: 600;
    color: #495057;
}

.table td {
    vertical-align: middle;
}

/* Modal improvements */
.modal-header {
    border-bottom: 2px solid #dee2e6;
}

.modal-footer {
    border-top: 2px solid #dee2e6;
}

/* Button group improvements */
.btn-group .btn {
    border-radius: 0;
}

.btn-group .btn:first-child {
    border-top-left-radius: 0.375rem;
    border-bottom-left-radius: 0.375rem;
}

.btn-group .btn:last-child {
    border-top-right-radius: 0.375rem;
    border-bottom-right-radius: 0.375rem;
}

/* Enhanced image preview styles */
.image-previews-container {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 15px;
}

.image-preview-wrapper {
    position: relative;
    width: 150px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.image-preview-wrapper:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.image-preview {
    position: relative;
    width: 100%;
    height: 150px;
    overflow: hidden;
}

.image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.image-preview-wrapper:hover .image-overlay {
    opacity: 1;
}

.image-delete {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    background-color: rgba(220, 53, 69, 0.9);
    color: white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    font-size: 16px;
    z-index: 2;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.image-delete:hover {
    background-color: #dc3545;
    transform: scale(1.1);
}

.image-number {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    text-align: center;
    padding: 5px;
    font-size: 12px;
}

.add-image-btn-container {
    display: flex;
    justify-content: center;
    margin-bottom: 15px;
}

.add-image-btn {
    width: 150px;
    height: 150px;
    border: 2px dashed #007bff;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background-color: #f8f9fa;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1);
}

.add-image-btn:hover {
    border-color: #0056b3;
    background-color: #e7f1ff;
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.add-image-btn i {
    color: #007bff;
    margin-bottom: 5px;
}

.add-image-btn small {
    color: #6c757d;
    font-weight: 500;
}

/* Responsive adjustments for image previews */
@media (max-width: 576px) {
    .image-preview-wrapper,
    .add-image-btn {
        width: 100px;
        height: 100px;
    }
    
    .image-preview {
        height: 100px;
    }
    
    .image-number {
        font-size: 10px;
        padding: 3px;
    }
    
    .image-delete {
        width: 24px;
        height: 24px;
        font-size: 14px;
    }
}

/* Product image styles in order details */
.product-image-container img {
    transition: transform 0.3s ease;
}

.product-image-container:hover img {
    transform: scale(1.05);
}

.card-title small {
    font-weight: 600;
    color: #495057;
} 
    .clickable-row {
        cursor: pointer;
    }
.table tbody tr.clickable-row:hover > td,
.table tbody tr.clickable-row:hover > th {
    background-color: #e6f2ff  !important;
}
/* Fix modal backdrop z-index issue */
.modal-backdrop {
    z-index: 1040 !important;
}

.modal {
    z-index: 1050 !important;
}

.modal-dialog {
    z-index: 1051 !important;
}

.modal-open .modal {
    overflow-x: hidden;
    overflow-y: auto;
}

.loader {
  color: #6495ed;
  font-size: 10px;
  width: 1em;
  height: 1em;
  border-radius: 50%;
  position: relative;
  text-indent: -9999em;
  animation: mulShdSpin 1.3s infinite linear;
  transform: translateZ(0);
}

@keyframes mulShdSpin {
  0%,
  100% {
    box-shadow: 0 -3em 0 0.2em, 
    2em -2em 0 0em, 3em 0 0 -1em, 
    2em 2em 0 -1em, 0 3em 0 -1em, 
    -2em 2em 0 -1em, -3em 0 0 -1em, 
    -2em -2em 0 0;
  }
  12.5% {
    box-shadow: 0 -3em 0 0, 2em -2em 0 0.2em, 
    3em 0 0 0, 2em 2em 0 -1em, 0 3em 0 -1em, 
    -2em 2em 0 -1em, -3em 0 0 -1em, 
    -2em -2em 0 -1em;
  }
  25% {
    box-shadow: 0 -3em 0 -0.5em, 
    2em -2em 0 0, 3em 0 0 0.2em, 
    2em 2em 0 0, 0 3em 0 -1em, 
    -2em 2em 0 -1em, -3em 0 0 -1em, 
    -2em -2em 0 -1em;
  }
  37.5% {
    box-shadow: 0 -3em 0 -1em, 2em -2em 0 -1em,
     3em 0em 0 0, 2em 2em 0 0.2em, 0 3em 0 0em, 
     -2em 2em 0 -1em, -3em 0em 0 -1em, -2em -2em 0 -1em;
  }
  50% {
    box-shadow: 0 -3em 0 -1em, 2em -2em 0 -1em,
     3em 0 0 -1em, 2em 2em 0 0em, 0 3em 0 0.2em, 
     -2em 2em 0 0, -3em 0em 0 -1em, -2em -2em 0 -1em;
  }
  62.5% {
    box-shadow: 0 -3em 0 -1em, 2em -2em 0 -1em,
     3em 0 0 -1em, 2em 2em 0 -1em, 0 3em 0 0, 
     -2em 2em 0 0.2em, -3em 0 0 0, -2em -2em 0 -1em;
  }
  75% {
    box-shadow: 0em -3em 0 -1em, 2em -2em 0 -1em, 
    3em 0em 0 -1em, 2em 2em 0 -1em, 0 3em 0 -1em, 
    -2em 2em 0 0, -3em 0em 0 0.2em, -2em -2em 0 0;
  }
  87.5% {
    box-shadow: 0em -3em 0 0, 2em -2em 0 -1em, 
    3em 0 0 -1em, 2em 2em 0 -1em, 0 3em 0 -1em, 
    -2em 2em 0 0, -3em 0em 0 0, -2em -2em 0 0.2em;
  }
}
  
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}
.loading-text{
    color:#00438a;
    margin-top:3rem;
    font-size:1.2rem;
    font-weight:600;
}