@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
    --bg-dark: #08090c;
    --bg-surface: #10121a;
    --bg-card: rgba(18, 20, 29, 0.75);
    --bg-card-hover: rgba(28, 31, 45, 0.85);
    --border-color: rgba(255, 255, 255, 0.07);
    --border-focus: rgba(139, 92, 246, 0.5);
    --primary: #8b5cf6;
    --primary-hover: #7c3aed;
    --secondary: #06b6d4;
    --secondary-hover: #0891b2;
    --success: #10b981;
    --success-glow: rgba(16, 185, 129, 0.15);
    --warning: #f59e0b;
    --warning-glow: rgba(245, 158, 11, 0.15);
    --danger: #ef4444;
    --danger-glow: rgba(239, 68, 68, 0.15);
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Plus Jakarta Sans', sans-serif;
    --shadow-premium: 0 12px 40px -10px rgba(0, 0, 0, 0.7);
    --transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease, background-color 0.2s ease;
}

html {
    scroll-behavior: smooth;
}

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-body);
    min-height: 100vh;
    overflow-x: hidden;
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(139, 92, 246, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(6, 182, 212, 0.08) 0%, transparent 40%);
}

.announcement-ticker {
    background: linear-gradient(90deg, #1a0505 0%, #2d0a0a 20%, #3b1204 50%, #2d0a0a 80%, #1a0505 100%);
    border-top: 1px solid rgba(239, 68, 68, 0.4);
    border-bottom: 2px solid rgba(239, 68, 68, 0.5);
    overflow: hidden;
    padding: 9px 0;
    display: flex;
    align-items: center;
    position: relative;
    z-index: 1000;
    box-shadow: 0 2px 20px rgba(220, 38, 38, 0.2), inset 0 1px 0 rgba(245, 158, 11, 0.1);
}

.announcement-ticker::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 60%;
    height: 100%;
    background: linear-gradient(90deg, transparent 0%, rgba(245, 158, 11, 0.06) 50%, transparent 100%);
    animation: ticker-shimmer 4s ease-in-out infinite;
    pointer-events: none;
}

@keyframes ticker-shimmer {
    0% { left: -100%; }
    100% { left: 200%; }
}

/* Escrow-only ticker: spans full width inside the 2-col grid */
.escrow-ticker-wrapper {
    grid-column: span 2;
    margin-bottom: 4px;
    border-radius: 10px;
    border-top: 1px solid rgba(239, 68, 68, 0.3);
    border-bottom: 2px solid rgba(239, 68, 68, 0.4);
    z-index: 10;
}

.ticker-track {
    display: flex;
    width: max-content;
    animation: marquee-scroll 30s linear infinite;
}

.ticker-track:hover {
    animation-play-state: paused;
}

.ticker-text {
    font-size: 12.5px;
    font-weight: 600;
    color: #fcd34d;
    padding: 0 60px;
    white-space: nowrap;
    letter-spacing: 0.01em;
}

.ticker-text .ticker-warn-icon {
    display: inline-block;
    color: #ef4444;
    margin-right: 6px;
    animation: icon-pulse 1.5s ease-in-out infinite;
}

.ticker-text b {
    color: #ffffff;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.ticker-text .ticker-safe {
    color: #86efac;
    font-weight: 700;
}

@keyframes icon-pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.7; }
}

@keyframes marquee-scroll {
    0% {
        transform: translate3d(0, 0, 0);
    }
    100% {
        transform: translate3d(-50%, 0, 0);
    }
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 600;
    letter-spacing: -0.02em;
}

a {
    color: inherit;
    text-decoration: none;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-dark);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* Glassmorphism Containers */
.glass-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: var(--shadow-premium);
    padding: 24px;
    transition: var(--transition);
}
.glass-card:hover {
    border-color: rgba(255, 255, 255, 0.12);
}

/* App Header & Navigation */
header {
    background: rgba(8, 9, 12, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 16px 5%;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 24px;
    font-weight: 800;
    color: var(--text-main);
    font-family: var(--font-heading);
}
.logo span {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* Role Switcher Widget */
.role-switcher-container {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 30px;
    padding: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}
.role-btn {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-muted);
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 13px;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    transition: var(--transition);
}
.role-btn.active {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}
.role-btn.admin-role.active {
    background: var(--secondary);
    box-shadow: 0 4px 15px rgba(6, 182, 212, 0.3);
}

/* Wallet widget in header */
.wallet-widget {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 8px 16px;
}
.wallet-icon {
    color: var(--secondary);
    font-size: 18px;
}
.wallet-balance {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 15px;
}

.user-profile-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-main);
}
.avatar {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-heading);
    font-weight: 800;
    color: white;
}

/* Grid & Layout System */
main {
    max-width: 1400px;
    margin: 30px auto;
    padding: 0 20px;
}

.view-section {
    display: none; /* Controlled by JS Router */
}
.view-section.active {
    display: block;
    animation: fadeInUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Hero Section */
.hero-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    position: relative;
    overflow: hidden;
}
.hero-text {
    max-width: 60%;
}
.hero-title {
    font-size: 48px;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 16px;
    background: linear-gradient(135deg, #fff 40%, var(--text-muted) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.hero-title span {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.hero-desc {
    color: var(--text-muted);
    font-size: 16px;
    margin-bottom: 24px;
    max-width: 500px;
}

/* Search and Category Filter Block */
.filter-bar {
    display: grid;
    grid-template-columns: 2fr 1fr 1.5fr;
    gap: 16px;
    margin-bottom: 30px;
}
.input-group {
    position: relative;
}
.input-group input, .input-group select {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 14px 20px;
    border-radius: 12px;
    outline: none;
    font-family: var(--font-body);
    transition: var(--transition);
}
.input-group input:focus, .input-group select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 15px var(--border-focus);
    background: rgba(255, 255, 255, 0.08);
}

/* Category Slider */
.categories-container {
    display: flex;
    gap: 12px;
    margin-bottom: 30px;
    overflow-x: auto;
    padding-bottom: 8px;
}
.category-pill {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    border-radius: 30px;
    padding: 10px 24px;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    white-space: nowrap;
    transition: var(--transition);
}
.category-pill:hover, .category-pill.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.25);
}

.sort-tab {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
}

.sort-tab:hover, .sort-tab.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 4px 10px rgba(139, 92, 246, 0.2);
}

/* Product Listings Grid */
.listings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}
.listing-card {
    cursor: pointer;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.listing-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: 0 8px 30px rgba(139, 92, 246, 0.15);
}
.listing-img {
    height: 180px;
    width: 100%;
    background-size: cover;
    background-position: center;
    border-radius: 12px;
    position: relative;
}
.category-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(8, 9, 12, 0.85);
    border: 1px solid var(--border-color);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}
.listing-content {
    padding-top: 16px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}
.listing-title {
    font-size: 18px;
    margin-bottom: 8px;
    font-weight: 700;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.seller-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 12px;
}
.verify-badge {
    background: var(--secondary);
    color: #fff;
    font-size: 9px;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 10px;
}
.listing-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}
.listing-price {
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 800;
    color: var(--secondary);
}
.listing-specs {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: var(--text-muted);
}
.spec-item span {
    font-weight: 700;
    color: var(--text-main);
}

/* Product Detail Page */
.detail-layout {
    display: grid;
    grid-template-columns: 1.8fr 1fr;
    gap: 30px;
}
.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    color: var(--text-muted);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}
.back-btn:hover {
    color: var(--primary);
}
.detail-gallery {
    height: 380px;
    border-radius: 16px;
    background-size: cover;
    background-position: center;
    border: 1px solid var(--border-color);
    margin-bottom: 24px;
}
.detail-header {
    margin-bottom: 24px;
}
.detail-title {
    font-size: 28px;
    margin-bottom: 12px;
    font-weight: 800;
}
.detail-meta {
    display: flex;
    align-items: center;
    gap: 20px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 20px;
}
.detail-desc {
    margin-top: 24px;
    line-height: 1.6;
    color: var(--text-main);
}
.specs-table {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-top: 24px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
}
.table-row {
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    padding-bottom: 8px;
}
.table-label {
    color: var(--text-muted);
    font-size: 14px;
}
.table-val {
    font-weight: 700;
    font-size: 14px;
}

/* Buy Action Card */
.buy-panel {
    position: sticky;
    top: 100px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.buy-price-label {
    color: var(--text-muted);
    font-size: 14px;
}
.buy-price {
    font-size: 32px;
    font-weight: 800;
    color: var(--secondary);
    font-family: var(--font-heading);
    margin-bottom: 12px;
}
.btn {
    display: block;
    width: 100%;
    text-align: center;
    border: none;
    outline: none;
    font-family: var(--font-heading);
    font-weight: 700;
    padding: 16px 24px;
    border-radius: 12px;
    cursor: pointer;
    transition: var(--transition);
}
.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.3);
}
.btn-primary:hover {
    background: var(--primary-hover);
    box-shadow: 0 6px 25px rgba(139, 92, 246, 0.4);
}
.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-main);
    border: 1px solid var(--border-color);
}
.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
}
.insurance-opt {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: rgba(6, 182, 212, 0.05);
    border: 1px dashed rgba(6, 182, 212, 0.3);
    padding: 14px;
    border-radius: 10px;
    cursor: pointer;
}
.insurance-opt input {
    margin-top: 3px;
    cursor: pointer;
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(8, 9, 12, 0.85);
    backdrop-filter: blur(10px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}
.modal-overlay.active {
    display: flex;
    animation: fadeIn 0.3s ease-out;
}
.modal-content {
    width: 90%;
    max-width: 500px;
    animation: zoomIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.close-modal {
    cursor: pointer;
    font-size: 20px;
    color: var(--text-muted);
}

/* Checkout Stepper UI */
.checkout-method {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}
.payment-card {
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.03);
    padding: 16px;
    border-radius: 12px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
}
.payment-card:hover, .payment-card.active {
    border-color: var(--secondary);
    background: rgba(6, 182, 212, 0.06);
}
.payment-card-logo {
    font-size: 24px;
    margin-bottom: 8px;
    color: var(--secondary);
}

/* Escrow / Transaction Room */
.escrow-layout {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 30px;
}

/* Steps wizard */
.escrow-stepper {
    display: flex;
    justify-content: space-between;
    margin-bottom: 30px;
    grid-column: span 2;
    position: relative;
    padding: 10px 0;
}
.escrow-stepper::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 4%;
    right: 4%;
    height: 2px;
    background: var(--border-color);
    z-index: 1;
    transform: translateY(-50%);
}
.step-node {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 20%;
}
.step-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-surface);
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    color: var(--text-muted);
    transition: var(--transition);
}
.step-node.active .step-circle {
    border-color: var(--primary);
    background: var(--bg-dark);
    color: var(--primary);
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.4);
}
.step-node.completed .step-circle {
    border-color: var(--success);
    background: var(--success);
    color: #fff;
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.4);
}
.step-node.disputed .step-circle {
    border-color: var(--danger);
    background: var(--danger);
    color: #fff;
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.4);
}
.step-label {
    font-size: 12px;
    margin-top: 8px;
    color: var(--text-muted);
    font-weight: 600;
    text-align: center;
}
.step-node.active .step-label {
    color: var(--text-main);
}

/* Chat container styling */
.chat-container {
    height: 480px;
    display: flex;
    flex-direction: column;
    border-radius: 16px;
    background: rgba(18, 20, 29, 0.5);
    border: 1px solid var(--border-color);
    overflow: hidden;
}
.chat-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.02);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.chat-body {
    flex-grow: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.chat-footer {
    padding: 16px;
    border-top: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.02);
    display: flex;
    gap: 12px;
}
.chat-footer input {
    flex-grow: 1;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 12px 18px;
    border-radius: 10px;
    outline: none;
    transition: var(--transition);
}
.chat-footer input:focus {
    border-color: var(--primary);
}

/* Chat bubble aesthetics */
.chat-bubble {
    max-width: 75%;
    padding: 12px 16px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.5;
    position: relative;
}
.chat-bubble.sent {
    align-self: flex-end;
    background: var(--primary);
    color: white;
    border-bottom-right-radius: 2px;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.15);
}
.chat-bubble.received {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.07);
    color: var(--text-main);
    border-bottom-left-radius: 2px;
    border: 1px solid var(--border-color);
}
.chat-meta {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 4px;
    display: flex;
    justify-content: space-between;
}
.received .chat-meta {
    color: var(--text-muted);
}
.chat-time {
    font-size: 9px;
    text-align: right;
    margin-top: 4px;
    opacity: 0.8;
}

/* System notice in chat */
.chat-system-notice {
    align-self: center;
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.2);
    color: var(--warning);
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 13px;
    text-align: center;
    max-width: 90%;
    margin: 10px 0;
}
.chat-system-notice.danger {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.25);
    color: var(--danger);
}

/* Action forms in Escrow Room */
.action-box {
    margin-bottom: 24px;
}
.action-box h3 {
    margin-bottom: 12px;
    font-size: 20px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
}

/* Tab details */
.tab-nav {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
}
.tab-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-family: var(--font-heading);
    font-weight: 600;
    padding: 12px 24px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: var(--transition);
}
.tab-btn.active {
    color: var(--primary);
    border-color: var(--primary);
}

/* Dashboards (Seller & Admin) */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 3fr;
    gap: 30px;
}
.sidebar-menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.menu-item {
    padding: 14px 20px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    font-family: var(--font-heading);
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-muted);
}
.menu-item:hover, .menu-item.active {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-main);
}
.menu-item.active {
    border-left: 3px solid var(--primary);
    background: rgba(139, 92, 246, 0.06);
    color: var(--primary);
}

.dashboard-pane {
    display: none;
}
.dashboard-pane.active {
    display: block;
    animation: fadeInUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.stats-card-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}
.stat-card {
    text-align: center;
}
.stat-num {
    font-size: 28px;
    font-weight: 800;
    font-family: var(--font-heading);
    color: var(--secondary);
    margin-top: 8px;
}

/* Forms general */
.form-group {
    margin-bottom: 20px;
}
.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 600;
}
.form-group input, .form-group textarea, .form-group select {
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 12px 16px;
    border-radius: 10px;
    outline: none;
    font-family: var(--font-body);
    transition: var(--transition);
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 10px var(--border-focus);
}

/* Enforce high-contrast light background on dropdown select options for readability */
select option {
    background-color: #ffffff !important;
    color: #111111 !important;
}

/* Tables styling (KYC, Withdrawals, Admin) */
.custom-table-container {
    overflow-x: auto;
}
table.custom-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}
table.custom-table th, table.custom-table td {
    padding: 14px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}
table.custom-table th {
    font-family: var(--font-heading);
    color: var(--text-muted);
    font-weight: 600;
}
table.custom-table tr:hover td {
    background: rgba(255, 255, 255, 0.01);
}

/* Badges for status */
.badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    display: inline-block;
}
.badge-pending {
    background: var(--warning-glow);
    color: var(--warning);
    border: 1px solid rgba(245, 158, 11, 0.3);
}
.badge-approved, .badge-completed, .badge-success {
    background: var(--success-glow);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.3);
}
.badge-rejected, .badge-disputed, .badge-danger {
    background: var(--danger-glow);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Toast Notification */
#toast-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 20000;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.toast {
    background: rgba(18, 20, 29, 0.9);
    border-left: 4px solid var(--primary);
    box-shadow: var(--shadow-premium);
    backdrop-filter: blur(8px);
    color: var(--text-main);
    padding: 16px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    min-width: 300px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    animation: slideInRight 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--warning); }
.toast-close {
    cursor: pointer;
    margin-left: 12px;
    opacity: 0.6;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.desktop-grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

/* Responsive Utilities */
@media (max-width: 992px) {
    .detail-layout, .escrow-layout {
        grid-template-columns: 1fr;
    }
    .hero-banner {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
    }
    .hero-text {
        max-width: 100%;
    }
    .filter-bar {
        grid-template-columns: 1fr;
    }
}

/* Custom Auth Tabs styles */
.active-tab {
    color: var(--text-main) !important;
}
.active-tab::after {
    content: '';
    position: absolute;
    bottom: -9px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary);
    border-radius: 2px;
}

/* Mobile Responsiveness Improvements */
@media (max-width: 768px) {
    .escrow-layout {
        display: flex !important;
        flex-direction: column !important;
        gap: 20px !important;
    }
    .escrow-stepper {
        order: 1 !important;
    }
    .chat-container {
        order: 2 !important;
        height: 400px !important;
    }
    .escrow-details-container {
        order: 3 !important;
    }
    .dashboard-grid {
        grid-template-columns: 1fr !important;
    }
    header {
        padding: 16px 16px !important;
    }
    /* Header optimizations */
    .logo {
        font-size: 20px !important; /* Smaller logo font on mobile */
    }
    #header-wallet {
        display: none !important; /* Completely hide wallet on mobile header */
    }
    #mode-switcher-btn {
        padding: 8px !important;
        font-size: 0 !important;
        width: 38px !important;
        display: flex;
        justify-content: center;
        align-items: center;
    }
    #mode-switcher-btn i {
        font-size: 14px;
        margin-right: 0 !important;
    }
    #header-username-wrapper {
        display: none !important;
    }
    #notification-btn {
        padding: 8px !important;
        width: 38px !important;
    }
    
    /* Make sidebar horizontally scrollable instead of stacked blocks */
    .sidebar-menu {
        flex-direction: row !important;
        overflow-x: auto;
        white-space: nowrap;
        padding-bottom: 12px !important;
        margin-bottom: 16px;
    }
    .sidebar-menu::-webkit-scrollbar {
        height: 6px;
    }
    .sidebar-menu::-webkit-scrollbar-thumb {
        background: rgba(255,255,255,0.1);
        border-radius: 10px;
    }
    .menu-item {
        flex-shrink: 0;
        padding: 10px 16px !important;
        border-radius: 30px !important;
    }
    
    /* Better spacing on dashboard panels */
    .dashboard-pane .glass-card {
        padding: 16px !important;
    }
    
    /* Fix table responsiveness */
    .custom-table th, .custom-table td {
        font-size: 11px !important;
        padding: 8px !important;
    }
    
    /* Show bottom nav on mobile */
    #mobile-bottom-nav {
        display: flex !important;
    }
    
    /* Add padding to body to prevent content from hiding behind bottom nav */
    body {
        padding-bottom: 70px;
    }
    /* Product grid 2-columns portrait on mobile */
    .listings-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px !important;
    }
    .listing-card {
        padding: 10px !important;
    }
    .listing-img {
        height: 140px !important; /* Portrait mode */
        border-radius: 10px !important;
    }
    .listing-title {
        font-size: 12px !important;
        line-height: 1.3 !important;
        margin-bottom: 6px !important;
    }
    .listing-price {
        font-size: 13px !important;
    }
    .category-badge {
        font-size: 9px !important;
        padding: 3px 6px !important;
        top: 8px !important;
        right: 8px !important;
    }

    /* Proportional hero fonts */
    .hero-title {
        font-size: 32px !important;
        line-height: 1.2 !important;
    }
    .hero-desc {
        font-size: 14px !important;
        line-height: 1.5 !important;
    }
    
    /* Hide specific elements on mobile */
    .filter-bar,
    .dashboard-sidebar,
    #explore-btn,
    #sell-btn-shortcut,
    #category-filters,
    #dashboard-user-title,
    #admin-panel-title,
    #header-username-wrapper {
        display: none !important;
    }
    
    /* Responsive forms */
    #withdrawal-form {
        grid-template-columns: 1fr !important;
    }

    
    /* Show mobile search icon in header */
    #mobile-search-btn {
        display: flex !important;
        align-items: center;
        justify-content: center;
    }
}

/* Hide mobile search btn on desktop */
#mobile-search-btn {
    display: none;
}

/* Mobile Bottom Navigation Styles */
#mobile-bottom-nav {
    display: none; /* Hidden by default on desktop */
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(18, 20, 29, 0.95);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--border-color);
    z-index: 1050;
    justify-content: space-between;
    align-items: center;
    padding: 0 16px;
    height: 64px;
    padding-bottom: env(safe-area-inset-bottom);
}

#mobile-bottom-nav .nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    text-decoration: none;
    flex: 1;
    font-size: 20px;
    transition: color 0.3s;
}

#mobile-bottom-nav .nav-item.active {
    color: var(--primary);
}

#mobile-bottom-nav .nav-item-center {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    color: white;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    font-size: 20px;
    transform: translateY(-16px);
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    flex-shrink: 0;
}

#mobile-bottom-nav .nav-item-center:active {
    transform: translateY(-14px) scale(0.95);
    box-shadow: 0 2px 10px rgba(239, 68, 68, 0.3);
}

/* Mobile Main Menu Modal */
.mobile-menu-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 10px;
    border-radius: 12px;
    transition: background 0.2s;
}
.mobile-menu-item:active {
    background: rgba(255, 255, 255, 0.05);
}
.mobile-menu-item .icon-circle {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: var(--text-main);
}
.mobile-menu-item span {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

/* Responsive admin & form grids */
.responsive-grid-5 {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
}
.responsive-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}
.responsive-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.responsive-grid-wd {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 20px;
}
.responsive-grid-specs {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr auto;
    gap: 8px;
    align-items: flex-end;
}

@media (max-width: 992px) {
    .responsive-grid-5 {
        grid-template-columns: repeat(3, 1fr);
    }
    .responsive-grid-wd {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .responsive-grid-5 {
        grid-template-columns: repeat(2, 1fr);
    }
    .responsive-grid-3,
    .responsive-grid-2 {
        grid-template-columns: 1fr;
    }
    .responsive-grid-specs {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    .responsive-grid-specs button {
        width: 100% !important;
        margin-top: 8px;
    }
    
    /* Clean rounded pill active menu item on mobile (remove left border) */
    .sidebar-menu .menu-item.active {
        border-left: none !important;
        background: rgba(139, 92, 246, 0.15) !important;
        color: var(--primary) !important;
    }
}

@media (max-width: 480px) {
    .responsive-grid-5 {
        grid-template-columns: 1fr;
    }
}

/* ==========================================
   TABLE CONTROLS & PAGINATION STYLES (DATATABLE-LIKE)
   ========================================== */
.table-control-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}
.table-control-limit {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-muted);
}
.table-control-limit select {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 6px 10px;
    border-radius: 8px;
    outline: none;
    cursor: pointer;
    font-size: 12px;
}
.table-control-search {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 7px 14px;
    border-radius: 8px;
    outline: none;
    font-size: 12.5px;
    width: 220px;
    transition: var(--transition);
}
.table-control-search:focus {
    border-color: var(--primary);
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.1);
}
.table-footer-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--border-color);
    flex-wrap: wrap;
    gap: 12px;
}
.table-info-text {
    font-size: 12.5px;
    color: var(--text-muted);
}
.table-pagination {
    display: flex;
    align-items: center;
    gap: 4px;
}
.page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    user-select: none;
}
.page-link:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.08);
}
.page-link.active {
    color: white;
    background: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.25);
}
.page-link.disabled {
    opacity: 0.35;
    cursor: not-allowed;
    pointer-events: none;
}
