/* LMS Admin - Brand Colors */
:root {
    --lms-primary: #4CA6A8;
    --lms-primary-dark: #3d8587;
    --lms-secondary: #2E4B4E;
    --lms-background: #D8E5E4;
    --lms-accent: #A9D9D0;
    --lms-white: #FFFFFF;
    --lms-success: #28a745;
    --lms-warning: #ffc107;
    --lms-danger: #dc3545;
    --lms-info: #17a2b8;
    --lms-pending: #6c757d;
    --lms-processing: #ffa500;
    --lms-ready: #28a745;
    --lms-delivered: #007bff;
}

/* Global Styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f4f6f9;
}

/* Sidebar */
.sidebar {
    background: linear-gradient(180deg, var(--lms-primary) 0%, var(--lms-secondary) 100%);
    min-height: 100vh;
    width: 250px;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    transition: all 0.3s;
}

.sidebar .brand {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar .brand h2 {
    color: var(--lms-white);
    font-size: 1.5rem;
    margin: 0;
}

.sidebar .nav-menu {
    padding: 20px 0;
}

.sidebar .nav-item {
    margin: 5px 15px;
}

.sidebar .nav-link {
    color: rgba(255,255,255,0.8);
    padding: 12px 20px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    text-decoration: none;
    transition: all 0.3s;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
    background-color: rgba(255,255,255,0.2);
    color: var(--lms-white);
}

.sidebar .nav-link i {
    margin-right: 10px;
    width: 20px;
}

.sidebar .submenu {
    padding-left: 30px;
}

.sidebar .submenu .nav-link {
    padding: 8px 20px;
    font-size: 0.9rem;
}

/* Main Content */
.main-content {
    margin-left: 250px;
    padding: 20px;
    min-height: 100vh;
}

/* Top Header */
.top-header {
    background: var(--lms-white);
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.top-header .page-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--lms-secondary);
    margin: 0;
}

.top-header .user-menu {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Dashboard Cards */
.stat-card {
    background: var(--lms-white);
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    transition: transform 0.3s, box-shadow 0.3s;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.stat-card-clickable {
    cursor: pointer;
}

.stat-card .stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--lms-white);
}

.stat-card .stat-icon.pending { background-color: var(--lms-pending); }
.stat-card .stat-icon.processing { background-color: var(--lms-processing); }
.stat-card .stat-icon.ready { background-color: var(--lms-ready); }
.stat-card .stat-icon.delivered { background-color: var(--lms-delivered); }

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--lms-secondary);
}

.stat-card .stat-label {
    font-size: 0.85rem;
    color: #6c757d;
    text-transform: uppercase;
}

/* Summary Stats */
.summary-stat {
    padding: 10px;
    border-radius: 8px;
    transition: background-color 0.3s;
}

.summary-stat:hover {
    background-color: #f8f9fa;
}

/* List Group Items for Today's Deliveries */
.list-group-item {
    border-left: 3px solid transparent;
    transition: all 0.3s;
}

.list-group-item:hover {
    border-left-color: var(--lms-primary);
    background-color: #f8f9fa;
}

/* Filter Buttons */
.btn-group .btn-outline-primary.active {
    background-color: var(--lms-primary);
    border-color: var(--lms-primary);
    color: white;
}

/* Scrollable Containers */
.card-body::-webkit-scrollbar {
    width: 6px;
}

.card-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.card-body::-webkit-scrollbar-thumb {
    background: var(--lms-primary);
    border-radius: 10px;
}

.card-body::-webkit-scrollbar-thumb:hover {
    background: var(--lms-primary-dark);
}

/* Cards */
.card {
    border: none;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.card-header {
    background-color: var(--lms-white);
    border-bottom: 1px solid #eee;
    font-weight: 600;
    padding: 15px 20px;
}

/* Buttons */
.btn-primary {
    background-color: var(--lms-primary);
    border-color: var(--lms-primary);
}

.btn-primary:hover {
    background-color: var(--lms-primary-dark);
    border-color: var(--lms-primary-dark);
}

.btn-secondary {
    background-color: var(--lms-secondary);
    border-color: var(--lms-secondary);
}

.btn-outline-primary {
    color: var(--lms-primary);
    border-color: var(--lms-primary);
}

.btn-outline-primary:hover {
    background-color: var(--lms-primary);
    border-color: var(--lms-primary);
}

/* Tables */
.table {
    margin-bottom: 0;
}

.table thead th {
    background-color: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.8rem;
    color: #6c757d;
}

.table tbody tr:hover {
    background-color: #f8f9fa;
}

/* Status Badges */
.badge-status {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-pending { background-color: #e9ecef; color: #6c757d; }
.badge-pickedup { background-color: #fff3cd; color: #856404; }
.badge-processing { background-color: #ffe5cc; color: #cc7000; }
.badge-ready { background-color: #d4edda; color: #155724; }
.badge-delivered { background-color: #cce5ff; color: #004085; }
.badge-cancelled { background-color: #f8d7da; color: #721c24; }
.badge-returned { background-color: #f5c6cb; color: #721c24; }

/* Payment Status Badges */
.badge-payment-pending { background-color: #fff3cd; color: #856404; }
.badge-payment-partial { background-color: #cce5ff; color: #004085; }
.badge-payment-paid { background-color: #d4edda; color: #155724; }

/* Order Status Board */
.status-column {
    background: var(--lms-white);
    border-radius: 10px;
    padding: 15px;
    min-height: 400px;
    position: relative;
}

.status-column .column-header {
    font-weight: 600;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 15px;
    text-transform: uppercase;
    font-size: 0.85rem;
}

.status-column.pending .column-header { background: #e9ecef; color: #6c757d; }
.status-column.processing .column-header { background: #ffe5cc; color: #cc7000; }
.status-column.ready .column-header { background: #d4edda; color: #155724; }

.order-card {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 10px;
    border-left: 3px solid var(--lms-primary);
    position: relative;
    transition: all 0.3s ease;
    cursor: move;
}

.order-card:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.order-card.dragging {
    opacity: 0.5;
    cursor: grabbing;
}

.order-card .drag-handle {
    position: absolute;
    left: -3px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--lms-primary);
    font-size: 1.2rem;
    cursor: grab;
    opacity: 0.3;
    transition: opacity 0.3s;
}

.order-card:hover .drag-handle {
    opacity: 1;
}

.order-card .order-number {
    font-weight: 600;
    color: var(--lms-secondary);
}

.order-card .customer-name {
    font-size: 0.9rem;
    color: #6c757d;
}

.order-card .delivery-date {
    font-size: 0.8rem;
    color: #adb5bd;
}

/* Drop Zone Effects */
.drop-zone {
    transition: background-color 0.3s ease;
}

.drop-zone.drag-over {
    background-color: rgba(76, 166, 168, 0.1);
    border: 2px dashed var(--lms-primary);
    border-radius: 10px;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #adb5bd;
}

/* Loading Overlay */
#loadingOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

/* Toast Notifications */
.toast-notification {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 10000;
    min-width: 300px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Login Page */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--lms-primary) 0%, var(--lms-secondary) 100%);
}

.login-card {
    background: var(--lms-white);
    border-radius: 15px;
    padding: 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.login-card .logo {
    text-align: center;
    margin-bottom: 30px;
}

.login-card .logo h1 {
    color: var(--lms-primary);
    font-weight: 700;
}

.login-card .form-control {
    padding: 12px 15px;
    border-radius: 8px;
}

.login-card .btn-login {
    width: 100%;
    padding: 12px;
    background-color: var(--lms-primary);
    border: none;
    border-radius: 8px;
    font-weight: 600;
}

.login-card .btn-login:hover {
    background-color: var(--lms-primary-dark);
}

/* Form Styles */
.form-label {
    font-weight: 500;
    color: var(--lms-secondary);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--lms-primary);
    box-shadow: 0 0 0 0.2rem rgba(76, 166, 168, 0.25);
}

/* Alert Messages */
.alert {
    border-radius: 8px;
    border: none;
}

/* Modal */
.modal-header {
    background-color: var(--lms-primary);
    color: var(--lms-white);
    border-radius: 0;
}

.modal-header .btn-close {
    filter: brightness(0) invert(1);
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        width: 60px;
    }
    
    .sidebar .brand h2,
    .sidebar .nav-link span {
        display: none;
    }
    
    .main-content {
        margin-left: 60px;
    }
}

/* Utilities */
.text-primary { color: var(--lms-primary) !important; }
.bg-primary { background-color: var(--lms-primary) !important; }
.border-primary { border-color: var(--lms-primary) !important; }

/* Collapsible Sections */
.collapse-icon {
    transition: transform 0.3s ease;
}

.collapsed .collapse-icon {
    transform: rotate(-90deg);
}

.card-header[data-bs-toggle="collapse"] {
    user-select: none;
}

.card-header[data-bs-toggle="collapse"]:hover {
    background-color: #f8f9fa;
}

/* Loading Spinner */
.spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

/* Service Item Icons */
.service-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--lms-background);
    border-radius: 8px;
}

/* Action Buttons in Tables */
.btn-action {
    padding: 5px 10px;
    font-size: 0.8rem;
    margin: 2px;
}

/* Enhanced Order Details Page */
.order-details-header {
    background: var(--lms-white);
    padding: 15px 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.order-header-card {
    border: none;
    box-shadow: 0 2px 15px rgba(0,0,0,0.08);
}

.status-dropdown-btn {
    background-color: var(--lms-processing);
    color: white;
    border: none;
    padding: 6px 15px;
    font-weight: 500;
}

.status-dropdown-btn:hover {
    background-color: var(--lms-primary);
    color: white;
}

/* Items Table with Images */
.items-table thead {
    background-color: #f8f9fa;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #6c757d;
    letter-spacing: 0.5px;
}

.items-table tbody tr {
    border-bottom: 1px solid #f0f0f0;
}

.items-table tbody tr:last-child {
    border-bottom: none;
}

.item-image {
    width: 60px;
    height: 60px;
    object-fit: contain;
    border-radius: 8px;
    background: #f8f9fa;
    padding: 5px;
}

.item-image-placeholder {
    width: 60px;
    height: 60px;
    background: #f0f0f0;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #adb5bd;
    font-size: 1.5rem;
}

.qty-badge {
    background: #e9ecef;
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: 600;
    color: var(--lms-secondary);
}

/* Invoice Sections */
.invoice-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
}

.payment-details-box {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 20px;
    border-radius: 10px;
    border: 1px solid #dee2e6;
}

/* Addons Card */
.addons-card .card-header {
    background: linear-gradient(135deg, var(--lms-primary) 0%, var(--lms-primary-dark) 100%);
    color: white;
    border: none;
}

.addon-item {
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

.addon-item:last-child {
    border-bottom: none;
}

/* Payments Card */
.payments-card .card-header {
    background: var(--lms-white);
    border-bottom: 2px solid var(--lms-primary);
}

.payment-item {
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

.payment-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

/* Payment Timeline */
.payment-timeline {
    position: relative;
    padding-left: 30px;
}

.timeline-item {
    position: relative;
    padding-bottom: 30px;
    margin-bottom: 20px;
    border-left: 2px solid #dee2e6;
}

.timeline-item:last-child {
    border-left: 2px solid transparent;
    padding-bottom: 0;
    margin-bottom: 0;
}

.timeline-marker {
    position: absolute;
    left: -7px;
    top: 5px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--lms-primary);
    border: 2px solid var(--lms-white);
    box-shadow: 0 0 0 2px var(--lms-primary);
}

.timeline-content {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-left: 20px;
}

/* Status Badges Enhanced */
.badge-status {
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

/* Print Optimization */
@@media print {
    .sidebar,
    .top-header,
    .order-details-header,
    .btn,
    .dropdown,
    .modal,
    .card-footer {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0 !important;
        padding: 0 !important;
    }
    
    .card {
        box-shadow: none !important;
        border: 1px solid #000 !important;
        page-break-inside: avoid;
    }
    
    body {
        background: white !important;
    }
    
    h1, h2, h3, h4, h5, h6 {
        page-break-after: avoid;
    }
    
    .table {
        page-break-inside: auto;
    }
    
    tr {
        page-break-inside: avoid;
        page-break-after: auto;
    }
}

/* Responsive adjustments for Order Details */
@@media (max-width: 768px) {
    .order-header-card .row > div {
        text-align: left !important;
        margin-bottom: 15px;
    }
    
    .payment-details-box,
    .invoice-section {
        margin-bottom: 20px;
    }
    
    .item-image {
        width: 50px;
        height: 50px;
    }
}
