/* =====================
   GLOBAL RESET
===================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Segoe UI", Arial, sans-serif;
}




:root {
    --primary: hsl(16, 90%, 55%);
    --primary-dark: hsl(16, 90%, 45%);
    --secondary: hsl(174, 62%, 47%);
    --background: hsl(0, 0%, 98%);
    --foreground: hsl(222, 47%, 11%);
    --card: hsl(0, 0%, 100%);
    --border: hsl(214, 32%, 91%);
    --muted: hsl(210, 40%, 96%);
    --muted-foreground: hsl(215, 16%, 47%);
    --success: hsl(142, 71%, 45%);
    --warning: hsl(38, 92%, 50%);
    --destructive: hsl(0, 84%, 60%);
}

body {
    background: #f4f6f8;
    color: #222;
}

/* LOADER OVERLAY */
.loader-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255,255,255,0.8);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.loader-overlay.active {
  display: flex;
}

/* SPINNER */
.loader {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border-top: 3px solid var(--primary);
  border-right: 3px solid transparent;
  animation: rotation-2 1s linear infinite;
}

@keyframes rotation-2 {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
/* =====================
   DASHBOARD LAYOUT
===================== */
.dashboard {
    display: flex;

}

/* =====================
   SIDEBAR (DELIVERY)
===================== */
.sidebar {
    width: 260px;
    background-color: #f5f5f5;
    color: #333;
    padding: 25px 20px;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #e5e5e5;
}

.sidebar .logo {
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 20px;
    letter-spacing: 0.3px;
    color: #333;
}

.sidebar nav ul {
    list-style: none;
}

.sidebar nav ul li {
    padding: 12px 13px;
    margin-bottom: 8px;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.sidebar nav ul li:hover {
    background: #e9e9e9;
}

.sidebar nav ul li.active {
    background: #dcdcdc;
    color: #000;
}

/* =====================
   MAIN CONTENT
===================== */
.main-content {
    flex: 1;
    padding: 30px;
    background: #fff;
    overflow-y: auto;
}

.section {
    animation: fadeIn 0.3s ease-in;
}

.hidden {
    display: none;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* =====================
   DELIVERY ORDERS GRID
===================== */
.delivery-orders-grid {
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    margin-top: 20px;
}

/* =====================
   ORDER CARD
===================== */
.order-card {
    background: #fff;
    border: 1px solid #eee; /* Softer border */
    border-left: 5px solid orangered; /* Accent strip */
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.order-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.12);
}

/* =====================
   ORDER HEADER
===================== */
.order-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 12px;
    margin-bottom: 15px;
}
.order-id {
  font-size: 14px;
  color: #64748b;
  font-weight: 500;
}


.cod-badge {
    background: #fff3e0;
    color: #e65100;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 700;
    border: 1px solid #ffe0b2;
}

/* Timeline Style for Addresses */
.delivery-route {
    position: relative;
    padding-left: 25px;
    margin-bottom: 20px;
}

.delivery-route::before {
    content: '';
    position: absolute;
    left: 7px;
    top: 10px;
    bottom: 10px;
    width: 2px;
    border-left: 2px dashed #ccc;
}

.route-step {
    position: relative;
    margin-bottom: 15px;
}

.route-step::after {
    content: '';
    position: absolute;
    left: -22px;
    top: 5px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid orangered;
}

.route-step.buyer::after {
    background: orangered;
}

.route-label {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    color: #999;
    font-weight: 700;
}

.route-info {
    font-size: 14px;
    color: #333;
    font-weight: 500;
    line-height: 1.4;
}

/* Action Area */
.order-footer {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #f0f0f0;
}

.status-select {
    flex: 1;
    margin-bottom: 0 !important; /* Override your global form margin */
}

.btn-call {
    background: #f4f4f4;
    color: #333;
    padding: 10px;
    border-radius: 8px;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}



.copy-btn {
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 0.85rem;
  color: #1976d2;
  font-weight: 500;
  padding: 2px 6px;
}

.copy-btn:hover {
  text-decoration: underline;
  background: transparent !important;
}

/* =====================
   BUYER / SELLER INFO
===================== */
.order-info {
    margin-bottom: 15px;
}

.order-info h5 {
    margin-bottom: 5px;
    color: orangered;
    font-size: 14px;
    font-weight: 600;
}

.order-info p {
    font-size: 14px;
    margin-bottom: 8px;
    color: #555;
    line-height: 1.4;
}

/* =====================
   ITEMS LIST
===================== */
.order-items ul {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.order-items li {
    padding: 8px 0;
    border-bottom: 1px dashed #eee;
    font-size: 14px;
    color: #333;
}

.order-items li:last-child {
    border-bottom: none;
}

/* =====================
   DELIVERY STATUS TAGS
===================== */
.status {
    display: inline-block;
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 20px;
    font-weight: 600;
    margin-top: 8px;
    text-transform: capitalize;
}

.status.pending {
    background: #fff3cd;
    color: #856404;
}

.status.assigned {
    background: #d1ecf1;
    color: #0c5460;
}

.status.out_for_delivery {
    background: #ffeeba;
    color: #856404;
}

.status.delivered {
    background: #d4edda;
    color: #155724;
}

.status.cancelled {
    background: #f8d7da;
    color: #721c24;
}

/* =====================
   ACTIONS
===================== */
.order-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.order-actions select,
.order-actions button {
    padding: 10px 14px;
    border-radius: 6px;
    border: 1px solid #ccc;
    font-size: 14px;
}

.order-actions select:disabled,
.order-actions button:disabled {
    background: #f0f0f0;
    cursor: not-allowed;
    color: #aaa;
}

.order-actions button {
    background: orangered;
    color: #fff;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.order-actions button:hover {
    background: orangered;
    transform: translateY(-1px);
}

/* =====================
   BUTTONS & UPDATES
===================== */
.dashboard button,
.dashboard .btn-update {
    background: orangered;
    color: #fff;
    border: none;
    padding: 10px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.dashboard button:hover,
.dashboard .btn-update:hover {
    background: orangered;
    transform: translateY(-1px);
}


/* =====================
   RESPONSIVE
===================== */
@media (max-width: 768px) {
    .delivery-orders-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }

    .order-actions {
        flex-direction: column;
        align-items: stretch;
    }
}

@media (max-width: 480px) {
    .order-card {
        padding: 15px;
    }

    .order-info h5,
    .order-info p,
    .order-header h4 {
        font-size: 13px;
    }

    .status-label {
        font-size: 12px;
        padding: 4px 10px;
    }

    .order-actions select,
    .order-actions button {
        width: 100%;
    }
}

/* =====================
   FORMS (PROFILE & AVAILABILITY)
===================== */
form {
    background: #fff;
    padding: 25px;
    border-radius: 12px;
    max-width: 600px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

form label {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 5px;
    display: block;
}

form input,
form select,
textarea {
    width: 100%;
    padding: 10px 12px;
    border-radius: 6px;
    border: 1px solid #ccc;
    margin-bottom: 15px;
    font-size: 14px;
}

form input:focus,
form select:focus {
    outline: none;
    border-color: orangered;
}

/* Checkbox alignment */
form input[type="checkbox"] {
    width: auto;
    margin-right: 8px;
}

/* Force the update button onto a new line */
.btn-update.availability {
    display: block; 
    width: 100%;    /* Makes it full width like your other inputs */
    margin-top: 10px;
}

/* =====================
   ALERTS
===================== */
.alert {
    padding: 6px 14px;
    margin: 20px;
    border-radius: 8px;
    font-weight: 600;
    
}

.alert.success {
    background: #28a745;
    color: #fff;
}

.alert.error {
    background: #dc3545;
    color: #fff;
}





/* =====================
   MOBILE SIDEBAR FIX
===================== */


.mobile-menu-container{
    display: none;
}



.menu-icon {
    width: 18px;
    height: 18px;
    color: var(--primary);

}

.sidebar nav ul li {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* =====================
   MOBILE VIEW (APP STYLE)
===================== */

@media (max-width: 768px) {

    .dashboard {
        flex-direction: column;
    }

    .sidebar {
    display: none;
}

.mobile-menu-container {
    display: block !important;
    background: #fff;
    border-radius: 0;
    box-shadow: none;
}

    .main-content {
        padding: 20px;
        
    }

    .section {
        display: none;
    }

    .section.active {
        display: block;
    }

    

    /* =====================
   MOBILE MENU (JUMIA STYLE)
===================== */

.mobile-menu-container {
    background: #fff;
    width: 100%;
}

.mobile-menu-header {
    padding: 16px 18px;
    font-weight: 700;
    font-size: 16px;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    gap: 10px;
}

.mobile-menu-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mobile-menu-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 18px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    background: #fff;
    transition: background 0.2s ease;
}

.mobile-menu-item:hover {
    background: #f8f8f8;
}

.mobile-menu-item-left {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 15px;
    font-weight: 500;
    color: #333;
}

.mobile-menu-item-right {
    font-size: 20px;
    color: #999;
}
}


/* =====================
   MOBILE PAGE MODE
===================== */

@media (max-width: 768px) {

    .mobile-page {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background: #f4f6f8;
        z-index: 1000;
        overflow-y: auto;
        padding: 20px;
    }


    .mobile-back-btn {
        font-size: 15px;
        font-weight: 600;
        color: orangered;
        margin-bottom: 20px;
        cursor: pointer;
    }
    .alert{
        text-align: center;
    }
}

.hidden-ui {
    display: none !important;
}


/* Container for the View Mode */
.profile-details-card {
    background: #fff;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    max-width: 800px;
}

/* Header Section */
.profile-view-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 20px;
    margin-bottom: 30px;
}

#view-name {
    font-size: 22px;
    font-weight: 700;
    color: #333;
    margin-bottom: 5px;
}

/* Availability Badge Logic */
.availability-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    background: #f0f0f0; /* Default */
    color: #666;
}

/* These classes can be toggled via JS if needed, 
   but for now, we use a clean neutral look */
.availability-badge:contains("Available") {
    background: #e7f9ee;
    color: #28a745;
}

/* Info Grid Layout */
.info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 25px 40px;
}

.info-group label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: #999;
    text-transform: uppercase;
    margin-bottom: 6px;
    letter-spacing: 0.5px;
}

.info-group p {
    font-size: 16px;
    font-weight: 500;
    color: #333;
    margin: 0;
}

.full-width {
    grid-column: span 2;
}

.text-capitalize {
    text-transform: capitalize;
}

/* Secondary Action Button */
.btn-edit-profile {
    background: transparent;
    color: orangered;
    border: 1.5px solid orangered;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-edit-profile:hover {
    background: #fff5f2;
    transform: translateY(-1px);
}

/* Cancel button style */
.btn.small {
    padding: 10px 16px;
    border-radius: 8px;
    border: 1px solid #ccc;
    background: #eee;
    font-size: 14px;
    cursor: pointer;
    color: #000;
}

.btn.small:hover {
    background: #ddd;
}


/* --- Shared Card Layout --- */
.order-card {
    background: #fff;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border: 1px solid #eee;
}

.order-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f5f5f5;
}

.order-id {
    font-size: 14px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 5px 0;
}

/* --- Badges --- */
.badge-cod, .badge-paid, .badge-return {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    border: 1px solid;
}

.badge-cod { background: #fff8e1; color: #f57c00; border-color: #ffe082; }
.badge-paid { background: #e8f5e9; color: #2e7d32; border-color: #c8e6c9; }
.badge-return { background: #fff3e0; color: #e65100; border-color: #ffe0b2; }

/* --- Routing (The 'Jumia' Look) --- */
.delivery-route {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 15px;
    position: relative;
}

.route-step {
    padding-left: 20px;
    border-left: 2px dashed #ddd;
    position: relative;
}

.route-step::before {
    content: '';
    position: absolute;
    left: -7px;
    top: 0;
    width: 12px;
    height: 12px;
    background: #fff;
    border: 2px solid #ddd;
    border-radius: 50%;
}

.route-step.buyer::before {
    border-color: #f68b1e; /* Jumia Orange */
    background: #f68b1e;
}

.route-label {
    display: block;
    font-size: 10px;
    color: #888;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.route-info {
    font-size: 13px;
    line-height: 1.4;
    color: #444;
}

/* --- Item Box & List --- */
.items-summary-box {
    background: #f9f9f9;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 15px;
}

.items-list {
    font-size: 13px;
    margin-top: 8px;
    list-style: none;
    padding: 0;
}

.items-list li {
    padding: 4px 0;
    color: #555;
}

/* --- Buttons & Footer --- */
.order-footer {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    margin-top: 15px;
}

.pay-btn {
    width: 100%;
    background: #28a745;
    color: white;
    border: none;
    padding: 10px;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    margin-bottom: 10px;
}

.update-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 600;
}

.status-select {
    padding: 8px;
    border-radius: 6px;
    border: 1px solid #ddd;
    font-size: 13px;
}

.load-more-btn {
    width: 100%;
    padding: 12px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
}

.mobile-only {
    display: none;
}
/* Responsive Fix */
@media (max-width: 768px) {
    .info-grid {
        grid-template-columns: 1fr;
    }
    .full-width {
        grid-column: span 1;
    }
    
}

/* Mobile View Header (Force Two Columns) */
@media (max-width: 768px) {
    .profile-view-header {
        display: flex;
        flex-direction: row !important; /* Force side-by-side */
        justify-content: space-between;  /* Name left, Button right */
        align-items: center;            /* Vertical alignment */
        gap: 10px;
        padding-bottom: 15px;
    }

    #view-name {
        font-size: 18px; /* Slightly smaller for mobile screens */
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis; /* Prevents long names from pushing the button off screen */
        max-width: 150px;       /* Adjust based on your preference */
    }

    .btn-edit-profile {
        padding: 6px 12px;      /* Slimmer button for mobile */
        font-size: 13px;
        white-space: nowrap;    /* Keeps "Edit Profile" on one line */
    }

    .order-items li{
        padding: 6px;
    }
    
    .delivery_logout.mobile-only {
    background-color: var(--muted);
    color: var(--muted-foreground);
    border: none;
  
    padding: 6px 13px;
    width: 100%;
    cursor: pointer;
    display: block;
}
}

