/**
 * Orders Page Styles
 * Admin Order Management
 */

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
}

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 250px;
    background-color: #343a40;
    padding-top: 20px;
    overflow-y: auto;
    z-index: 100;
}

.sidebar-header {
    padding: 0 20px 20px;
    border-bottom: 1px solid #495057;
}

.sidebar-brand {
    color: white;
    font-size: 20px;
    font-weight: 600;
    text-decoration: none;
    display: flex;
    align-items: center;
}

.sidebar-brand span {
    color: #3f51b5;
}

.sidebar-menu {
    padding: 20px 0;
}

.sidebar-menu-item {
    padding: 12px 20px;
    display: flex;
    align-items: center;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.3s;
}

.sidebar-menu-item:hover,
.sidebar-menu-item.active {
    color: white;
    background-color: rgba(255, 255, 255, 0.1);
}

.sidebar-menu-item i {
    margin-right: 10px;
    width: 20px;
    text-align: center;
}

.main-content {
    margin-left: 250px;
    padding: 20px;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.page-title h1 {
    font-size: 24px;
    margin-bottom: 5px;
}

.page-title p {
    color: #6c757d;
    margin-bottom: 0;
}

.filter-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: white;
    padding: 15px;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filter-bar .search-box {
    flex: 1;
    min-width: 250px;
}

.filter-bar .filters {
    flex-wrap: wrap;
}

.search-box {
    position: relative;
    width: 300px;
}

.search-box input {
    width: 100%;
    padding: 10px 40px 10px 15px;
    border: 1px solid #ced4da;
    border-radius: 4px;
}

.search-box i {
    position: absolute;
    right: 15px;
    top: 12px;
    color: #6c757d;
}

/* Order Tabs */
.order-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.tab-btn {
    padding: 12px 24px;
    border: none;
    background: #e9ecef;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
}

.tab-btn:hover {
    background: #dee2e6;
}

.tab-btn.active {
    background: linear-gradient(135deg, #3f51b5, #7c4dff);
    color: white;
}

.tab-btn .badge {
    background: rgba(255,255,255,0.2);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
}

.tab-btn.active .badge {
    background: rgba(255,255,255,0.3);
}

/* Order Cards */
.order-card {
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    margin-bottom: 20px;
    overflow: hidden;
    border: 1px solid #e9ecef;
}

.order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: linear-gradient(135deg, #343a40, #495057);
    color: white;
}

.order-header .order-id {
    font-size: 16px;
    font-weight: 600;
}

.order-header .order-id i {
    margin-right: 8px;
    opacity: 0.8;
}

.order-status {
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.status-completed {
    background-color: #d4edda;
    color: #155724;
}

.status-processing {
    background-color: #fff3cd;
    color: #856404;
}

.status-pending {
    background-color: #cce5ff;
    color: #004085;
}

.status-cancelled {
    background-color: #f8d7da;
    color: #721c24;
}

.order-body {
    padding: 15px;
}

.order-info {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 15px;
}

.info-group {
    flex: 1;
    min-width: 200px;
}

.info-group h3 {
    font-size: 14px;
    color: #6c757d;
    margin-bottom: 5px;
}

.info-group h3 i {
    margin-right: 6px;
    opacity: 0.7;
}

.info-group p {
    margin-bottom: 0;
    font-size: 15px;
}

/* Customer Info */
.customer-name {
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 5px !important;
}

.customer-email, .customer-phone {
    font-size: 13px;
    color: #6c757d;
    margin-bottom: 3px !important;
}

.customer-email i, .customer-phone i {
    width: 16px;
    margin-right: 5px;
}

/* Address Group */
.address-group {
    min-width: 250px;
}

.address-details {
    font-size: 13px;
    line-height: 1.6;
}

.address-details strong {
    color: #495057;
}

/* Order Items */
.order-items {
    width: 100%;
    border-top: 1px solid #e9ecef;
    padding-top: 15px;
}

.order-items-section {
    border-top: 1px solid #e9ecef;
    padding-top: 15px;
    margin-top: 15px;
}

.order-items-section h4 {
    font-size: 14px;
    color: #495057;
    margin-bottom: 12px;
}

.order-items-section h4 i {
    margin-right: 8px;
}

.order-item {
    display: flex;
    align-items: center;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 8px;
}

.order-item .item-image,
.item-image {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    object-fit: cover;
    margin-right: 12px;
    border: 1px solid #dee2e6;
}

.item-details {
    flex: 1;
}

.order-item .item-name,
.item-name {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 3px;
}

.order-item .item-meta,
.item-meta {
    font-size: 12px;
    color: #6c757d;
    margin-top: 2px;
}

.order-item .item-quantity {
    font-weight: 600;
    color: #495057;
    margin: 0 15px;
}

.order-item .item-price,
.item-price {
    font-weight: 700;
    color: #28a745;
    width: 100px;
    text-align: right;
}

.shop-badge {
    display: inline-block;
    background: linear-gradient(135deg, #7c4dff, #3f51b5);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

/* Order Footer */
.order-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background-color: #f8f9fa;
    border-top: 1px solid #e9ecef;
    flex-wrap: wrap;
    gap: 10px;
}

.order-total {
    font-size: 18px;
    font-weight: 600;
}

.order-total .label {
    color: #6c757d;
    margin-right: 5px;
}

.order-total .amount {
    font-weight: 700;
    color: #28a745;
}

/* Order Action Buttons */
.order-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    position: relative;
    z-index: 10;
}

.order-actions .btn {
    font-size: 13px;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    cursor: pointer !important;
    pointer-events: auto !important;
    position: relative;
    z-index: 11;
    margin-left: 10px;
}

.order-actions .btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.order-actions .btn i {
    font-size: 12px;
}

.order-actions .btn-info {
    background: #17a2b8;
    border-color: #17a2b8;
}

.order-actions .btn-warning {
    background: #ffc107;
    border-color: #ffc107;
}

.order-actions .btn-success {
    background: #28a745;
    border-color: #28a745;
}

.order-actions .btn.active {
    box-shadow: 0 0 0 3px rgba(0,0,0,0.15);
    transform: scale(1.02);
}

.order-actions .btn-info.active {
    background: #0d8aa8;
    border-color: #0d8aa8;
}

.order-actions .btn-warning.active {
    background: #e0a800;
    border-color: #e0a800;
}

/* Camera Capture Button */
.camera-capture-btn input[type="file"] {
    display: none;
}

.camera-capture-btn::before {
    content: '\f030  Take Photo';
    font-family: 'Font Awesome 5 Free', sans-serif;
    display: block;
    padding: 15px 20px;
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    border-radius: 10px;
    text-align: center;
    cursor: pointer;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.3s;
}

.camera-capture-btn:hover::before {
    background: linear-gradient(135deg, #218838, #1aa179);
    transform: scale(1.02);
}

.camera-capture-btn.has-photo::before {
    content: '\f00c  Photo Taken - Tap to Retake';
    background: linear-gradient(135deg, #17a2b8, #138496);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
}

.empty-state i {
    font-size: 60px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state h3 {
    margin-bottom: 10px;
}

/* Toast Notification */
.toast-notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #343a40;
    color: white;
    padding: 15px 25px;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 10px;
    transform: translateX(120%);
    transition: transform 0.3s ease;
}

.toast-notification.show {
    transform: translateX(0);
}

.toast-notification.success {
    background: linear-gradient(135deg, #28a745, #20c997);
}

.toast-notification.error {
    background: linear-gradient(135deg, #dc3545, #e83e8c);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    margin-top: 30px;
}

/* Product Categories Modal */
.category-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.category-card {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    border-color: #3f51b5;
}

.category-card img {
    width: 100%;
    height: 140px;
    object-fit: cover;
}

.category-card h4 {
    padding: 10px;
    margin: 0;
    text-align: center;
    background-color: #f8f9fa;
    font-size: 16px;
}

/* Shop Filter / Offline Mode Badge */
#shopFilterContainer .badge {
    font-size: 13px;
    display: inline-flex;
    align-items: center;
}

#shopFilterContainer .badge i {
    font-size: 12px;
}

/* Modal Backdrop Fix */
body:not(.modal-open) .modal-backdrop {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
}

.modal-backdrop.removing {
    display: none !important;
}

/* Responsive */
@media (max-width: 576px) {
    .category-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: 70px;
    }
    .sidebar-brand span,
    .sidebar-menu-item span {
        display: none;
    }
    .sidebar-menu-item {
        justify-content: center;
        padding: 15px;
    }
    .sidebar-menu-item i {
        margin-right: 0;
    }
    .main-content {
        margin-left: 70px;
    }
    .order-info {
        flex-direction: column;
    }
    .order-actions {
        width: 100%;
        justify-content: flex-end;
    }
    .tab-btn {
        padding: 10px 16px;
        font-size: 13px;
    }
}
