/* NAMGO Courier & Uber Platform Design System */

@import url('https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css');
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
    --bg-dark: #090d16;
    --surface-dark: #121827;
    --surface-card: #1a2234;
    --surface-hover: #242f47;
    --border-color: rgba(255, 255, 255, 0.08);
    --border-highlight: rgba(99, 102, 241, 0.4);

    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --primary-glow: rgba(99, 102, 241, 0.25);

    --accent-emerald: #10b981;
    --accent-amber: #f59e0b;
    --accent-rose: #f43f5e;
    --accent-cyan: #06b6d4;

    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --text-dim: #64748b;

    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    
    --shadow-glass: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

body, html {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

/* App Container */
.namgo-app-layout {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: radial-gradient(circle at 50% 0%, #171d33 0%, var(--bg-dark) 70%);
}

/* Role Switcher Bar */
.role-switcher-bar {
    background: rgba(18, 24, 39, 0.85);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-color);
    padding: 0.75rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    font-weight: 800;
    font-size: 1.35rem;
    letter-spacing: -0.5px;
    color: #fff;
}

.brand-logo i {
    color: var(--primary);
    font-size: 1.5rem;
    background: linear-gradient(135deg, #6366f1, #a855f7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand-tag {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.2rem 0.55rem;
    border-radius: 20px;
    background: rgba(99, 102, 241, 0.15);
    color: #a5b4fc;
    border: 1px solid rgba(99, 102, 241, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.role-pills {
    display: flex;
    background: rgba(0, 0, 0, 0.4);
    padding: 4px;
    border-radius: 30px;
    border: 1px solid var(--border-color);
}

.role-pill-btn {
    border: none;
    background: transparent;
    color: var(--text-muted);
    padding: 0.45rem 1.1rem;
    border-radius: 24px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.role-pill-btn:hover {
    color: #fff;
}

.role-pill-btn.active {
    background: linear-gradient(135deg, var(--primary), #4f46e5);
    color: #fff;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
}

/* Glass Card */
.glass-card {
    background: var(--surface-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-glass);
    padding: 1.5rem;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.glass-card:hover {
    border-color: rgba(255, 255, 255, 0.14);
}

/* Buttons */
.btn-namgo {
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    padding: 0.85rem 1.5rem;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 4px 18px var(--primary-glow);
}

.btn-namgo:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(99, 102, 241, 0.45);
}

.btn-emerald {
    background: linear-gradient(135deg, #10b981, #059669);
    box-shadow: 0 4px 18px rgba(16, 185, 129, 0.3);
}

.btn-emerald:hover {
    box-shadow: 0 6px 24px rgba(16, 185, 129, 0.45);
}

.btn-indigo {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: #fff;
}

.btn-outline-custom {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    border-radius: var(--radius-md);
    padding: 0.75rem 1.25rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-outline-custom:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
}

/* Map Containers */
.namgo-map-container {
    width: 100%;
    height: 260px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border-color);
    box-shadow: inset 0 0 20px rgba(0,0,0,0.5);
    z-index: 1;
}

.map-compact,
.map-half {
    height: 260px;
}

.map-tall {
    height: 280px;
}

.map-full {
    height: 280px;
}

/* Autocomplete Dropdown Popups */
.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 2000;
    background: #1e293b;
    border: 2px solid #6366f1;
    border-radius: 12px;
    max-height: 280px;
    overflow-y: auto;
    margin-top: 6px;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.95);
}

.autocomplete-header {
    background: #0f172a;
    color: #94a3b8;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    padding: 8px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.autocomplete-item {
    padding: 10px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    color: #ffffff;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

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

.autocomplete-item:hover,
.autocomplete-item.active {
    background: #334155;
    color: #ffffff;
}

.autocomplete-item .item-title {
    font-weight: 700;
    color: #f8fafc;
    font-size: 0.9rem;
}

.autocomplete-item .item-address {
    color: #cbd5e1;
    font-size: 0.8rem;
}

.cursor-pointer {
    cursor: pointer;
}

/* Custom Leaflet Map Pins */
.namgo-custom-pin {
    display: flex;
    align-items: center;
    justify-content: center;
}

.pickup-pin .pin-inner {
    background: #10b981;
    color: #fff;
    border: 2px solid #fff;
    border-radius: 50%;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.85rem;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.5);
}

.dropoff-pin .pin-inner {
    background: #f43f5e;
    color: #fff;
    border: 2px solid #fff;
    border-radius: 50%;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.85rem;
    box-shadow: 0 4px 12px rgba(244, 63, 94, 0.5);
}

.driver-pin .driver-inner {
    background: #6366f1;
    color: #fff;
    border: 2.5px solid #fff;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    position: relative;
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.6);
}

.batch-pin .batch-num-inner {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff;
    border: 2px solid #fff;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.85rem;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.6);
}

.pulse-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid #6366f1;
    animation: pulse-ring-anim 1.8s infinite ease-out;
}

@keyframes pulse-ring-anim {
    0% { transform: scale(1); opacity: 0.8; }
    100% { transform: scale(2.2); opacity: 0; }
}

/* Status Badges */
.status-badge {
    padding: 0.35rem 0.85rem;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.status-pending {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.status-driverassigned {
    background: rgba(99, 102, 241, 0.15);
    color: #818cf8;
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.status-intransit {
    background: rgba(6, 182, 212, 0.15);
    color: #38bdf8;
    border: 1px solid rgba(6, 182, 212, 0.3);
}

.status-delivered {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

/* Surge Badge */
.surge-badge {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #fff;
    font-weight: 800;
    padding: 0.25rem 0.65rem;
    border-radius: 12px;
    font-size: 0.75rem;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.4);
}

/* Category Grid */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 0.75rem;
}

.category-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.9rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.category-card:hover {
    border-color: rgba(99, 102, 241, 0.4);
    background: rgba(99, 102, 241, 0.05);
}

.category-card.selected {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.15);
    box-shadow: 0 0 14px rgba(99, 102, 241, 0.2);
}

.category-icon {
    font-size: 1.6rem;
    margin-bottom: 0.35rem;
    color: #a5b4fc;
}

.category-name {
    font-size: 0.82rem;
    font-weight: 700;
}

/* Form Inputs */
.namgo-input-group {
    margin-bottom: 1.1rem;
}

.namgo-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.namgo-input {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    color: #fff;
    font-size: 0.9rem;
    box-sizing: border-box;
    transition: border-color 0.2s ease;
}

.namgo-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

/* Step Progress Tracker */
.tracker-steps {
    display: flex;
    justify-content: space-between;
    position: relative;
    margin: 1.5rem 0;
}

.tracker-steps::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 3px;
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-50%);
    z-index: 0;
}

.tracker-step {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
}

.step-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--surface-dark);
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.tracker-step.completed .step-icon {
    background: var(--accent-emerald);
    border-color: var(--accent-emerald);
    color: #fff;
}

.tracker-step.active .step-icon {
    background: var(--primary);
    border-color: #a5b4fc;
    color: #fff;
    box-shadow: 0 0 14px var(--primary);
}

.step-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
}

/* Chat Panel & Drawer */
.chat-wrapper {
    position: relative;
}

.chat-drawer-panel {
    position: fixed;
    bottom: 80px;
    right: 30px;
    width: 360px;
    max-width: 90vw;
    z-index: 2000;
    animation: slide-up 0.25s ease-out;
}

@keyframes slide-up {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.chat-messages-box {
    max-height: 280px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    padding-right: 4px;
}

.chat-bubble-container {
    display: flex;
    flex-direction: column;
}

.chat-bubble-container.mine {
    align-items: flex-end;
}

.chat-bubble-container.theirs {
    align-items: flex-start;
}

.chat-sender-name {
    font-size: 0.68rem;
    color: var(--text-muted);
    margin-bottom: 2px;
}

.chat-bubble {
    padding: 0.55rem 0.85rem;
    border-radius: 14px;
    font-size: 0.82rem;
    max-width: 82%;
    word-break: break-word;
}

.chat-timestamp {
    font-size: 0.62rem;
    color: var(--text-dim);
    margin-top: 2px;
}

/* SOS Modal */
.modal-backdrop-custom {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.sos-modal-card {
    max-width: 440px;
    width: 100%;
    border: 2px solid var(--accent-rose);
}

.toast-custom {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 4000;
}

/* High-Contrast Text Readability Overrides for Dark Mode & Modals */
.text-muted,
.text-secondary {
    color: #cbd5e1 !important;
}

.text-dim {
    color: #94a3b8 !important;
}

.glass-card p,
.sos-modal-card p,
.modal-backdrop-custom p,
.modal-backdrop-custom div:not(.btn-close):not(.btn) {
    color: #cbd5e1;
}

@media (min-width: 768px) {
    .col-md-2-4 {
        flex: 0 0 auto;
        width: 20%;
    }
}


