/* POS Subcategories Styles */

/* Custom width adjustments for POS layout */
@media (min-width: 992px) {
    .pos-wrapper .col-lg-6 {
        flex: 0 0 auto;
        width: 58.33%;
    }

    .pos-wrapper .col-lg-2 {
        flex: 0 0 auto;
        width: 12%;
    }

    .pos-wrapper .col-lg-4 {
        flex: 0 0 auto;
        width: 29.67%;
    }
}

/* Price Edit Button Styles */
.price-edit-icon {
    color: #6c757d !important;
    transition: all 0.3s ease;
    padding: 4px 6px !important;
    font-size: 12px !important;
    font-weight: bold;
    text-decoration: none;
    border-radius: 3px;
    background-color: transparent;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
}

.price-edit-icon:hover {
    color: #28a745 !important;
    background-color: #f8f9fa;
    transform: scale(1.05);
}

/* Price display styling */
.price-display {
    font-weight: 600;
    color: #28a745;
    margin: 0;
}

.pos-subcategories {
    background-color: #f8f9fa;
    padding: 10px;
    border-radius: 8px;
    height: calc(100vh - 200px);
    overflow-y: auto;
    border: 1px solid #e9ecef;
}

.pos-subcategories h5 {
    color: #0D3B66; /* updated for consistency */
    font-weight: 600;
    margin-bottom: 10px;
    border-bottom: 2px solid #FF9F43;
    padding-bottom: 5px;
    font-size: 14px;
}

.subcategory-container {
    min-height: 200px;
}

/* ---------- Improved Subcategory Styles ---------- */
.subcategory-item {
    background-color: #0D3B66; /* professional navy */
    border: 1px solid #FF9F43; /* accent orange */
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 8px;
    cursor: pointer;
    text-align: center;
    font-weight: 700;
    font-size: 16px;
    color: #FFFFFF;
    transition: all 0.25s ease;
    letter-spacing: 0.3px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
}

.subcategory-item:hover {
    background-color: #FF9F43;
    border-color: #0D3B66;
    color: #FFFFFF;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(13, 59, 102, 0.25);
}

.subcategory-item.active {
    background-color: #4DA1A9; /* teal for active */
    border-color: #4DA1A9;
    color: #FFFFFF;
    box-shadow: 0 4px 8px rgba(77, 161, 169, 0.35);
}

.subcategory-item .subcategory-name {
    font-size: 16px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.subcategory-item .subcategory-count {
    font-size: 13px;
    opacity: 0.8;
    margin-top: 4px;
}

/* Sub-category Color Variants */
.subcategory-item[data-color="primary"] {
    background-color: #FF9F43 !important;
    border-color: #FF9F43 !important;
    color: #FFFFFF !important;
}

.subcategory-item[data-color="success"] {
    background-color: #28C76F !important;
    border-color: #28C76F !important;
    color: #FFFFFF !important;
}

.subcategory-item[data-color="danger"] {
    background-color: #FF0000 !important;
    border-color: #FF0000 !important;
    color: #FFFFFF !important;
}

.subcategory-item[data-color="warning"] {
    background-color: #FF9900 !important;
    border-color: #FF9900 !important;
    color: #FFFFFF !important;
}

.subcategory-item[data-color="info"] {
    background-color: #17a2b8 !important;
    border-color: #17a2b8 !important;
    color: #FFFFFF !important;
}

.subcategory-item[data-color="purple"] {
    background-color: #7367F0 !important;
    border-color: #7367F0 !important;
    color: #FFFFFF !important;
}

.subcategory-item[data-color="teal"] {
    background-color: #02a8b5 !important;
    border-color: #02a8b5 !important;
    color: #FFFFFF !important;
}

.subcategory-item[data-color="pink"] {
    background-color: #ff63a5 !important;
    border-color: #ff63a5 !important;
    color: #FFFFFF !important;
}

.subcategory-item[data-color="yellow"] {
    background-color: #ffff00 !important;
    border-color: #ffff00 !important;
    color: #333333 !important;
}

/* Enhanced Held Orders Modal Styles */
.order-row {
    transition: background-color 0.2s ease;
}

.order-row:hover {
    background-color: #f8f9fa !important;
}

.order-row.table-active {
    background-color: #e3f2fd !important;
    border-left: 4px solid #2196f3;
}

.order-items-list {
    scrollbar-width: thin;
    scrollbar-color: #dee2e6 #f8f9fa;
}

.order-items-list::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

.order-items-list::-webkit-scrollbar-track {
    background: #f8f9fa;
    border-radius: 3px;
}

.order-items-list::-webkit-scrollbar-thumb {
    background: #dee2e6;
    border-radius: 3px;
}

.order-items-list::-webkit-scrollbar-thumb:hover {
    background: #0d6efd;
}

.feather-12 {
    width: 12px;
    height: 12px;
}

.feather-48 {
    width: 48px;
    height: 48px;
}

.feather-spin {
    animation: spin 1s linear infinite;
}

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

/* Modal size adjustments for better UX */
.modal-xl {
    max-width: 1200px;
}

/* Button group improvements */
.btn-group-sm .btn {
    padding: 0.2rem 0.25rem;
    font-size: 0.75rem;
    min-width: 28px;
    height: 28px;
}

/* Resume button prominence */
.resume-order-btn {
    font-weight: 600 !important;
    min-width: 32px;
    box-shadow: 0 2px 4px rgba(40, 167, 69, 0.2);
    transition: all 0.2s ease;
    padding: 0.25rem 0.5rem;
}

.resume-order-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(40, 167, 69, 0.3);
}

.resume-order-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(40, 167, 69, 0.2);
}

/* Card improvements for order details */
.card-body .card {
    border: 1px solid #e9ecef;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.card-body .card:hover {
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

/* Badge improvements */
.badge {
    font-size: 0.75em;
    font-weight: 500;
}

/* Table improvements */
.table-hover tbody tr:hover {
    background-color: rgba(0,0,0,.075);
}

.table-light {
    background-color: #f8f9fa;
}

/* Ensure table container is scrollable */
.table-responsive {
    overflow-x: auto;
    overflow-y: visible;
}

/* Button group container improvements */
.btn-group {
    display: flex;
    flex-wrap: nowrap;
    gap: 1px;
}

/* Ensure Action column has enough width for buttons */
#held-orders-table th:last-child,
#held-orders-table td:last-child {
    min-width: 180px;
    width: 180px;
    white-space: nowrap;
    position: relative;
    z-index: 10;
}

/* Ensure table columns don't get cut off */
#held-orders-table {
    table-layout: fixed;
    width: 100%;
}

#held-orders-table td {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#held-orders-table td:last-child {
    white-space: nowrap;
    overflow: visible;
}

/* Responsive adjustments */
@media (max-width: 991.98px) {
    .pos-subcategories {
        height: auto;
        max-height: 300px;
        margin-bottom: 20px;
    }

    .subcategory-container {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }

    .subcategory-item {
        flex: 1;
        min-width: 120px;
        margin-bottom: 0;
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .modal-xl {
        max-width: 95%;
        margin: 1rem auto;
    }

    .col-md-7, .col-md-5 {
        margin-bottom: 1rem;
    }

    /* On mobile, stack the columns */
    .col-md-7, .col-md-5 {
        flex: 0 0 100%;
        max-width: 100%;
    }

    /* Ensure buttons are visible on mobile */
    #held-orders-table .btn-group-sm .btn {
        padding: 0.15rem 0.2rem;
        font-size: 0.65rem;
        min-width: 24px;
        height: 24px;
    }

    /* Adjust action column width on mobile */
    #held-orders-table th:last-child,
    #held-orders-table td:last-child {
        min-width: 160px;
        width: 160px;
    }
}

/* ---------- Dark Mode ---------- */
[data-layout-mode="dark_mode"] .pos-subcategories {
    background-color: #2a2e39;
    border-color: #3a3f4b;
}

[data-layout-mode="dark_mode"] .pos-subcategories h5 {
    color: #ffffff;
    border-bottom-color: #FF9F43;
}

[data-layout-mode="dark_mode"] .subcategory-item {
    background-color: #3a3f4b;
    border-color: #FF9F43;
    color: #e4e7ec;
}

[data-layout-mode="dark_mode"] .subcategory-item:hover {
    background-color: #FF9F43;
    border-color: #3a3f4b;
    color: #ffffff;
}

[data-layout-mode="dark_mode"] .subcategory-item.active {
    background-color: #4DA1A9;
    border-color: #4DA1A9;
    color: #ffffff;
}
