/* Customer Dashboard Styles */
#customer-dashboard {
    background: #f8f9fa;
    min-height: 100vh;
    padding: 20px;
}

.dashboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 24px;
}

.dashboard-header h2 {
    margin: 0;
    font-size: 1.5rem;
    color: #333;
}

.dashboard-header button {
    padding: 8px 16px;
    border-radius: 8px;
    border: none;
    font-weight: 500;
    transition: all 0.2s ease;
}

.dashboard-header button:not(.logout-btn) {
    background: #e8f5e9;
    color: #2E7D32;
    margin-right: 12px;
}

.dashboard-header button:not(.logout-btn):hover {
    background: #c8e6c9;
    transform: translateY(-1px);
}

.dashboard-header .logout-btn {
    background: #ffebee;
    color: #d32f2f;
}

.dashboard-header .logout-btn:hover {
    background: #ffcdd2;
    transform: translateY(-1px);
}

/* Balance Box Styling - refreshed */
.balance-box {
    position: relative;
    background: linear-gradient(135deg, #1b5e20 0%, #43a047 100%);
    color: #ffffff;
    padding: 20px 24px;
    border-radius: 16px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    box-shadow: 0 10px 25px rgba(67, 160, 71, 0.16);
    overflow: hidden;
}

.balance-box:before {
    /* subtle glossy sweep */
    content: '';
    position: absolute;
    right: -30%;
    top: -30%;
    width: 120%;
    height: 120%;
    background: radial-gradient(circle at 10% 10%, rgba(255,255,255,0.12), transparent 25%);
    transform: rotate(25deg);
    pointer-events: none;
    filter: blur(6px);
}

.balance-box .icon {
    background: rgba(255,255,255,0.12);
    padding: 10px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    box-shadow: 0 6px 18px rgba(0,0,0,0.08);
}

.balance-box h2 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 14px;
}

.balance-box .balance-details {
    display: flex;
    flex-direction: column;
    line-height: 1;
}

.balance-box #customer-balance-label {
    font-size: 0.95rem;
    opacity: 0.95;
    color: rgba(255,255,255,0.95);
    font-weight: 600;
}

.balance-box #customer-balance {
    font-weight: 800;
    font-size: 1.9rem;
    margin-top: 6px;
    color: #fff;
    letter-spacing: 0.6px;
    text-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

/* Pay button / call-to-action */
#show-customer-payment-modal, .pay-now-btn {
    background: #ffffff;
    color: #1b5e20;
    border: none;
    padding: 10px 18px;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.12);
    font-size: 14px;
}

#show-customer-payment-modal:hover, .pay-now-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 40px rgba(20,70,20,0.18);
}

#show-customer-payment-modal:active, .pay-now-btn:active {
    transform: translateY(-1px);
}

/* Table Container Styling */
.table-container {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.table-container h3 {
    color: #333;
    font-size: 1.2rem;
    margin: 0 0 16px 0;
    padding-bottom: 12px;
    border-bottom: 2px solid #e8f5e9;
}

.order-table, .payment-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.order-table th, .payment-table th {
    background: #f8f9fa;
    color: #2E7D32;
    font-weight: 600;
    padding: 12px;
    text-align: left;
    border-bottom: 2px solid #e8f5e9;
}

.order-table td, .payment-table td {
    padding: 12px;
    border-bottom: 1px solid #f0f0f0;
    color: #444;
}

.order-table tr:hover td, .payment-table tr:hover td {
    background-color: #f8f9fa;
}

/* Status Badges */
.status-badge {
    padding: 6px 12px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 500;
    text-align: center;
    display: inline-block;
}

.status-badge.pending {
    background: #fff3e0;
    color: #e65100;
}

.status-badge.in-progress {
    background: #e3f2fd;
    color: #1565c0;
}

.status-badge.completed {
    background: #e8f5e9;
    color: #2e7d32;
}

/* Receipt Link Styling */
.receipt-link {
    color: #2E7D32;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.receipt-link:hover {
    background: #e8f5e9;
}

/* Mobile Responsive Design - Updated */
@media (max-width: 768px) {
    #customer-dashboard {
        padding: 12px;
    }

    .dashboard-header {
        flex-direction: column;
        gap: 12px;
        text-align: center;
        padding: 16px;
    }

    .dashboard-header div {
        width: 100%;
    }

    #customer-dashboard .dashboard-header button {
        width: 100% !important;
        margin: 4px 0 !important;
        text-align: center !important;
        justify-content: center !important;
        display: flex !important;
        align-items: center !important;
    }

    #customer-dashboard .dashboard-header button .icon {
        margin-right: 5px !important;
    }

    .balance-box {
        flex-direction: column;
        gap: 16px;
        text-align: center;
        padding: 18px 20px !important;
        min-height: 90px !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        box-sizing: border-box !important;
    }

    .balance-box h2 {
        font-size: 1.1rem !important;
        line-height: 1.3 !important;
        margin: 0 !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        gap: 12px !important;
    }

    .balance-box h2 .icon {
        font-size: 1.2rem !important;
    }

    .balance-box #customer-balance {
        font-size: 2rem !important;
        font-weight: 700 !important;
        display: block !important;
        margin: 0 !important;
        color: #fff !important;
        letter-spacing: 1px !important;
    }

    #pay-now-btn {
        width: 100%;
    }

    .table-container {
        padding: 12px;
        overflow-x: auto;
    }

    .order-table, .payment-table {
        min-width: 600px;
    }
}

/* Sidebar Overlay */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.sidebar-overlay:not(.hidden) {
    opacity: 1;
    visibility: visible;
}

/* Customer Profile Sidebar Styles */
.profile-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    width: 350px;
    height: 100vh;
    background: #fff;
    box-shadow: -4px 0 15px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
    border-left: 1px solid #e0e0e0;
    visibility: hidden;
}

.profile-sidebar.active {
    transform: translateX(0);
    visibility: visible;
}

.profile-sidebar.hidden {
    visibility: hidden;
}

.sidebar-header {
    background: linear-gradient(135deg, #2E7D32 0%, #4CAF50 100%);
    color: white;
    padding: 20px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1001;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.sidebar-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sidebar-header h3:before {
    content: "👤";
    font-size: 22px;
}

.close-sidebar-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    padding: 8px 10px;
    border-radius: 6px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
}

.close-sidebar-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.sidebar-content {
    padding: 25px;
}

.profile-info-section {
    margin-bottom: 30px;
    padding: 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    border: 1px solid #dee2e6;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.profile-info-section h4 {
    color: #2E7D32;
    margin: 0 0 20px 0;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e9ecef;
}

.info-item {
    margin-bottom: 16px;
    transition: all 0.2s ease;
}

.info-item:last-child {
    margin-bottom: 0;
}

.info-item:hover {
    transform: translateX(4px);
}

.info-item label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #495057;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-value {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    font-size: 14px;
    color: #333;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
}

.info-value:hover {
    border-color: #2E7D32;
    box-shadow: 0 2px 8px rgba(46, 125, 50, 0.1);
}

.info-icon {
    font-size: 18px;
    color: #2E7D32;
    background: #e8f5e9;
    padding: 6px;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.password-section {
    border-top: 2px solid #e9ecef;
    padding-top: 25px;
}

.password-section h4 {
    color: #2E7D32;
    margin: 0 0 20px 0;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e9ecef;
}

.change-password-btn {
    width: 100%;
    padding: 14px 20px;
    background: linear-gradient(135deg, #2E7D32 0%, #4CAF50 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 2px 8px rgba(46, 125, 50, 0.2);
    position: relative;
    overflow: hidden;
}

.change-password-btn:before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.change-password-btn:hover:before {
    left: 100%;
}

.change-password-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(46, 125, 50, 0.3);
}

.change-password-btn:active {
    transform: translateY(0);
}

.password-form {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #dee2e6;
    margin-top: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    animation: slideDown 0.3s ease;
}

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

.password-form .form-group {
    margin-bottom: 18px;
}

.password-form .form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #495057;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.password-form .input-wrapper {
    position: relative;
    margin-bottom: 5px;
}

.password-form input {
    width: 100%;
    padding: 14px 14px 14px 45px;
    border: 1px solid #ced4da;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: white;
    box-sizing: border-box;
}

.password-form input:focus {
    border-color: #2E7D32;
    box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.1);
    outline: none;
    transform: translateY(-1px);
}

.password-form .input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 16px;
    color: #2E7D32;
    pointer-events: none;
    background: #e8f5e9;
    padding: 4px;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.primary-btn {
    flex: 1;
    padding: 14px 20px;
    background: linear-gradient(135deg, #2E7D32 0%, #4CAF50 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(46, 125, 50, 0.2);
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(46, 125, 50, 0.3);
}

.secondary-btn {
    flex: 1;
    padding: 14px 20px;
    background: #f8f9fa;
    color: #6c757d;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.secondary-btn:hover {
    background: #e9ecef;
    border-color: #adb5bd;
    transform: translateY(-1px);
}

.message {
    margin-bottom: 16px;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    border-left: 4px solid;
    animation: slideIn 0.3s ease;
}

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

.message.success {
    background-color: #d4edda;
    border-left-color: #28a745;
    color: #155724;
}

.message.error {
    background-color: #f8d7da;
    border-left-color: #dc3545;
    color: #721c24;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .profile-sidebar {
        width: 100%;
        right: 0;
    }
    
    .sidebar-content {
        padding: 20px;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .primary-btn, .secondary-btn {
        width: 100%;
    }
}
.toast {
    position: fixed;
    background-color: #333;
    color: #fff;
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    font-size: 14px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    z-index: 9999;
    
    /* --- Mobile styles (default) --- */
    top: 375px;
    left: 20px;
    right: 20px; 
    text-align: center;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}
.toast.error { background-color: #e74c3c; }
.toast.info { background-color: #3498db; }


/* --- PC styles (for screens wider than 768px) --- */
@media (min-width: 768px) {
    .toast {
        top: 310px;
        left: auto; 
        right: 370px; 
        text-align: left;
    }
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast.success {
  background-color: #2ecc71;
}

.toast.error {
  background-color: #e74c3c;
}

.toast.info {
  background-color: #3498db;
}
