/* order-management.css */
/* CSS riêng cho trang quản lý đơn hàng */

/* Cải thiện bố cục chung */
.order-create-container{
    padding: 1.5rem;
    background-color: var(--gray-light);
    min-height: calc(100vh - 60px);
}

/* Cải thiện giao diện các panel */
.card {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    margin-bottom: 1rem;
    overflow: hidden;
}

.card.bg-light {
    background-color: var(--text-light) !important;
    padding: 1rem;
}

/* Cải thiện header của card */
.card-header {
    background-color: #ffa414;
    color: var(--text-light);
    font-weight: 600;
    padding: 0.85rem 1rem;
    border: none;
}

/* Cải thiện giao diện input, select, button */
.input-group {
    margin-bottom: 0.75rem;
}

.input-group-text {
    background-color: var(--gray-light);
    border: 1px solid var(--gray-medium);
    color: var(--text-dark);
    font-weight: 500;
    min-width: 125px;
    justify-content: flex-start;
}

.form-control, .form-select {
    border: 1px solid var(--gray-medium);
    /* border-radius: 0 var(--border-radius) var(--border-radius) 0; */
    padding: 0.5rem 0.75rem;
    transition: var(--transition);
    line-height: 1.3 !important;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(242, 140, 48, 0.25);
}

    .form-select option {
        white-space: nowrap;
        text-overflow: ellipsis;
        overflow: hidden;
        max-width: 300px;
    }

/* Cải thiện các nút */
.btn {
    border-radius: var(--border-radius);
    font-weight: 500;
    transition: var(--transition);
    padding: 0.5rem 1rem;
}

.btn-success {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--text-light);
}

    .btn-success:hover {
        background-color: var(--primary-color);
        border-color: var(--primary-color);
        transform: translateY(-1px);
    }

.btn-danger {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--text-light);
}

.btn-danger:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    transform: translateY(-1px);
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--text-light);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
    transform: translateY(-1px);
}

.btn-border {
    border: 1px solid #cd7f02 !important;
}

/* Cải thiện bảng hiển thị sản phẩm */
.table {
    width: 100%;
    margin-bottom: 0;
    border-collapse: separate;
    border-spacing: 0;
}

.table thead th {
    background-color: var(--gray-light);
    color: var(--text-dark);
    font-weight: 600;
    padding: 0.65rem;
    border-bottom: 2px solid var(--gray-medium);
    text-transform: uppercase;
    font-size: 0.85rem;
}

.table tbody td {
    padding: 0.5rem;
    border-bottom: 1px solid var(--gray-medium);
    vertical-align: middle;
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(0, 0, 0, 0.02);
}

.table-bordered {
    border: 1px solid var(--gray-medium);
    border-radius: var(--border-radius);
    overflow: hidden;
}

/* Cải thiện kiểu hiển thị số liệu */
/* td[style*="text-align:right"], th[style*="text-align:right"] {
    font-weight: 600;
    font-family: 'Roboto Mono', monospace, sans-serif;
} */

/* Autocomplete dropdown */
.auto-list-group {
    position: absolute;
    z-index: 1000;
    width: 100%;
    max-height: 200px;
    overflow-y: auto;
    margin-top: 18px;
    padding-left: 0;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    background-color: var(--text-light);
    list-style: none;
}

.auto-list-group-item {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--gray-medium);
    cursor: pointer;
    transition: var(--transition);
}

.auto-list-group-item:hover {
    background-color: var(--primary-light);
    color: var(--text-light);
}

/* Cải thiện form thông tin khách hàng */
.input-group.mb-1 {
    margin-bottom: 0.75rem !important;
}

/* Cải thiện bảng tính tiền */
.payment-summary-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 0.5rem;
}

.payment-summary-table td {
    padding: 0.5rem 0.25rem;
    vertical-align: middle;
}

.payment-summary-table td[style*="text-align:right"] {
    font-weight: 600;
    padding-right: 1rem;
}

.payment-summary-table td:first-child {
    width: 180px;
    text-align: right;
    font-weight: 500;
    color: var(--text-dark);
}

.payment-summary-table td:last-child {
    text-align: right;
    font-weight: 600;
}

.discount-options {
    display: flex;
    gap: 0.5rem;
    width: 100%;
}

.discount-type-select {
    min-width: 120px;
    flex: 0 0 auto;
}

.discount-value-container {
    flex: 1;
    display: flex;
}

.discount-percentage {
    display: flex;
    align-items: center;
    width: 100%;
}

.discount-percentage input {
    max-width: 120px;
    text-align: right;
}

.discount-percentage .result-separator {
    padding: 0 0.5rem;
    display: flex;
    align-items: center;
    color: var(--text-dark);
    font-weight: 500;
}

.discount-percentage .result-value {
    padding: 0 0.5rem;
    font-weight: 600;
    color: var(--primary-color);
    min-width: 120px;
    text-align: right;
}

/* Định dạng khi chọn số tiền cố định */
.discount-fixed {
    width: 100%;
}

.discount-fixed input {
    text-align: right;
}



/* Cải thiện khu vực thanh toán */
.total-amount {
    font-size: 1.25rem !important;
    color: var(--primary-color) !important;
    font-weight: 700 !important;
    background-color: rgba(242, 140, 48, 0.1);
    border-radius: var(--border-radius);
    padding: 0.5rem 1rem !important;
}

.payment-methods {
    display: flex;
    gap: 1rem;
}

/* Checkbox và Radio button */
.form-check-input {
    cursor: pointer;
    width: 1.15em;
    height: 1.15em;
}

.form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.form-check-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(242, 140, 48, 0.25);
}

.form-check-inline {
    margin-right: 1.5rem;
    display: inline-flex;
    align-items: center;
}

/* Cải thiện dropdown */
.dropdown-menu {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 0.5rem 0;
}

.dropdown-item {
    padding: 0.65rem 1rem;
    transition: var(--transition);
    display: flex;
    align-items: center;
}

.dropdown-item:hover {
    background-color: var(--gray-light);
}

/* Input số lượng */
.input-xs {
    min-width: 80px;
    text-align: center;
}

/* Hiệu ứng khi hover lên các dòng table */
.table tbody tr {
    transition: var(--transition);
}

.table tbody tr:hover {
    background-color: rgba(242, 140, 48, 0.05);
}

/* Bố cục mới cho các cột chính */
.order-main-content {
    flex: 1 0 auto;
    display: flex;
    flex-direction: row;
    gap: 1.5rem;
}

.order-left-panel {
    flex: 2;
    display: flex;
    flex-direction: column;
}

.order-right-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Cải thiện hiển thị thông tin đơn hàng */
.order-attributes {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding: 1rem;
    background-color: var(--text-light);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.attribute-item {
    flex: 1 0 280px;
    display: flex;
    align-items: center;
}

/* Phần thông tin khách hàng */
.customer-info {
    display: flex;
    flex-direction: column;
    padding: 1rem;
    background-color: var(--text-light);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    margin-bottom: 1rem;
}

.delivery-options {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

/* Phần thanh toán */
.payment-section {
    padding: 1rem;
    background-color: var(--text-light);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    margin-bottom: 1rem;
}

/* Cải thiện hiển thị tiêu đề bảng */
.table thead th:first-child {
    border-top-left-radius: 0.5rem;
}

.table thead th:last-child {
    border-top-right-radius: 0.5rem;
}

/* Cải thiện khu vực tìm kiếm sản phẩm */
.products-search {
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* Thêm một số hiệu ứng khi focus để UX tốt hơn */
.form-control:focus, .form-select:focus {
    outline: none;
}

/* Cải thiện giao diện các nút checkbox và radio */
.form-check .form-check-input {
    margin-right: 0.5rem;
}

/* Hiệu ứng khi hover nút */
.btn:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Giao diện cho nút xóa sản phẩm */
button.btn-danger.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.85rem;
}

/* Cải thiện giao diện nút lưu */
.save-order-btn {
    min-width: 100px;
    font-weight: 600;
    margin-left: auto;
}

/* Hiển thị thông tin thời gian */
.date-display {
    display: flex;
    align-items: center;
    margin-left: auto;
    padding: 0.5rem 1rem;
    background-color: var(--gray-light);
    border-radius: var(--border-radius);
    font-weight: 500;
}

/* Phần bảng sản phẩm */
.products-table-container {
    flex: 1 0 auto;
    display: flex;
    flex-direction: column;
    margin-bottom: 1rem;
}

/* Layout responsive cho các thiết bị nhỏ hơn */
@media (max-width: 1200px) {
    .order-main-content {
        flex-direction: column;
    }
    
    .order-left-panel, .order-right-panel {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .container-fluid {
        padding: 1rem 0.5rem;
    }
    
    .attribute-item {
        flex: 1 0 100%;
    }
    
    .input-group-text {
        min-width: 100px;
    }

    .table thead th {
        padding: 0.65rem;
        font-size: 0.8rem;
    }
    
    .table tbody td {
        padding: 0.65rem;
    }

    .payment-summary-table td:first-child {
        width: 120px;
    }
    
    .discount-percentage {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .discount-percentage input {
        max-width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .discount-options {
        flex-direction: column;
    }
    
    .discount-type-select {
        width: 100%;
    }
}
