/* ========== WILLISHOP – MASTER STYLES v22.0 FINAL ========== */
/* Professional design, social‑media feel for dashboards, full dark‑mode support,
   feed header compact, class‑based modals, advanced previews, AI chat, Academy,
   buyer avatar overlap, larger touch targets, and all new features. */

/* ---------- CSS Variables (Light/Dark) ---------- */
:root {
    --bg-body: #f5f7fb;
    --bg-card: #ffffff;
    --bg-card-alt: #f8fafc;
    --text-primary: #1a2a3a;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --border: #e2e8f0;
    --accent: #2c7da0;
    --accent-hover: #1f5e7a;
    --accent-light: rgba(44,125,160,0.1);
    --danger: #ef4444;
    --success: #10b981;
    --warning: #f59e0b;
    --purple: #8b5cf6;
    --shadow: 0 2px 6px rgba(0,0,0,0.08);
    --shadow-hover: 0 8px 20px rgba(0,0,0,0.12);
    --header-gradient: linear-gradient(135deg, #1e6f5f, #2c7da0);
    --footer-bg: #1e293b;
    --footer-text: #94a3b8;
    --star-color: #f59e0b;
    --btn-hover-shadow: 0 6px 16px rgba(0,0,0,0.15);
    --gender-women-bg: #fce4ec;
    --gender-men-bg: #e3f2fd;
    --gender-kids-bg: #fff9c4;
    --radius-card: 20px;
    --radius-btn: 40px;
}
body.dark-mode {
    --bg-body: #0f1724;
    --bg-card: #1e293b;
    --bg-card-alt: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border: #475569;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --accent-light: rgba(59,130,246,0.1);
    --shadow: 0 2px 6px rgba(0,0,0,0.3);
    --shadow-hover: 0 8px 20px rgba(0,0,0,0.4);
    --header-gradient: linear-gradient(135deg, #0b1f3a, #1e3a5f);
    --footer-bg: #0f1724;
    --footer-text: #94a3b8;
    --star-color: #f59e0b;
    --btn-hover-shadow: 0 6px 16px rgba(0,0,0,0.4);
}

/* ---------- Reset ---------- */
* { margin:0; padding:0; box-sizing:border-box; }
body {
    font-family: 'Roboto', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-body);
    color: var(--text-primary);
    transition: background 0.3s, color 0.3s;
    overflow-x: hidden;
    max-width: 100vw;
}
body, html { overflow-x: hidden; width: 100%; max-width: 100%; }
.swipe-viewport, .swipe-page { width: 100%; max-width: 100%; }

/* ---------- Inputs ---------- */
input, select, textarea {
    width: 100%;
    padding: 14px 16px;
    margin: 8px 0;
    border-radius: 12px;
    border: 1px solid var(--border);
    font-size: 16px;
    display: block;
    box-sizing: border-box;
    font-family: inherit;
    background: var(--bg-card);
    color: var(--text-primary);
    transition: border-color 0.2s, box-shadow 0.2s;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}
input[type="radio"], input[type="checkbox"] { width: auto; display: inline-block; margin: 0 8px 0 0; padding: 0; }
input[type="file"] { padding: 10px; font-size: 14px; }

/* ---------- Gender Backgrounds ---------- */
body.gender-women { background: var(--gender-women-bg); }
body.gender-men { background: var(--gender-men-bg); }
body.gender-kids { background: var(--gender-kids-bg); }
body.gender-default { background: var(--bg-body); }
#home-page.gender-women { background: var(--gender-women-bg); }
#home-page.gender-men { background: var(--gender-men-bg); }
#home-page.gender-kids { background: var(--gender-kids-bg); }
#home-page.gender-default { background: var(--bg-body); }
body.dark-mode.gender-women,
body.dark-mode.gender-men,
body.dark-mode.gender-kids { background: var(--bg-body); }
body.dark-mode #home-page.gender-women,
body.dark-mode #home-page.gender-men,
body.dark-mode #home-page.gender-kids { background: var(--bg-body); }

/* Gender tab active colors */
.tab-women.active { background: #ec4899; }
.tab-men.active { background: #3b82f6; }
.tab-kids.active { background: #eab308; }

/* ---------- Animations ---------- */
@keyframes fadeIn { from { opacity:0; transform:translateY(10px); } to { opacity:1; transform:translateY(0); } }
@keyframes slideDown { from { opacity:0; max-height:0; } to { opacity:1; max-height:500px; } }

/* ---------- Page containers ---------- */
.page { display: none; padding-top: 0 !important; margin-top: 0 !important; min-height: calc(100vh - 70px); padding-bottom: 80px; }
.page.active { display: block; animation: fadeIn 0.3s ease; }
.page.container { padding: 0; max-width: 100%; }

/* ---------- Swipe Viewport ---------- */
.swipe-viewport { width: 100vw; height: calc(100vh - 70px); overflow: hidden; position: relative; touch-action: pan-y; }
.swipe-container { display: flex; width: 200vw; height: 100%; transition: transform 0.35s cubic-bezier(0.25,0.46,0.45,0.94); will-change: transform; transform: translateX(0); }
.swipe-page { width: 100vw; height: 100%; overflow-y: auto; overflow-x: hidden; flex-shrink: 0; -webkit-overflow-scrolling: touch; scroll-behavior: smooth; overscroll-behavior: none; }
.swipe-page-home { background: var(--bg-body); }
.swipe-page-feed { background: #ffffff; padding-bottom: 60px; overscroll-behavior: contain; }
body.dark-mode .swipe-page-feed { background: var(--bg-body); }

/* ---------- Header ---------- */
.header { background: var(--header-gradient); padding:12px 24px; display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap; gap:12px; color:white; position:sticky; top:0; z-index:1000; box-shadow:0 4px 20px rgba(0,0,0,0.2); }
.logo { display:flex; align-items:center; gap:8px; cursor:pointer; }
.logo span { font-size:20px; font-weight:800; background:linear-gradient(135deg, #fff, #cbe9fe); -webkit-background-clip:text; background-clip:text; color:transparent; }
.location-btn, .cart-icon, .wishlist-icon-header, .notification-icon, .settings-btn, .signin-btn, .messages-btn {
    background:rgba(255,255,255,0.25); padding:8px 16px; border-radius:40px; display:inline-flex; align-items:center; gap:8px; cursor:pointer; font-weight:500; border:1px solid rgba(255,255,255,0.4); transition:all 0.2s; color:white;
}
.location-btn svg, .cart-icon svg, .wishlist-icon-header svg, .notification-icon svg, .settings-btn svg, .signin-btn svg, .messages-btn svg { stroke:white; opacity:1; }
.location-btn:hover, .cart-icon:hover, .wishlist-icon-header:hover, .notification-icon:hover, .settings-btn:hover, .signin-btn:hover, .messages-btn:hover {
    background:rgba(255,255,255,0.4); transform:translateY(-2px); box-shadow:0 6px 16px rgba(0,0,0,0.2);
}
.search-bar { flex:1; max-width:480px; display:flex; margin:0 16px; }
.search-bar input { flex:1; padding:10px 18px; border:none; border-radius:40px 0 0 40px; font-size:14px; background:white; margin:0; }
.search-bar button { background:white; border:none; border-radius:0 40px 40px 0; padding:8px 20px; cursor:pointer; }
.header-actions { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }

/* ========== FEED PAGE HEADER REDESIGN ========== */
.header.feed-active .logo { display: none !important; }
.header.feed-active .location-btn { display: none !important; }
.header.feed-active + #locationBanner { display: none !important; }

/* ---------- Floating Home Button ---------- */
.floating-home {
    position: fixed;
    bottom: 24px;
    right: 20px;
    width: 48px;
    height: 48px;
    background: var(--accent);
    color: white;
    border-radius: 50%;
    display: none; /* shown by JS */
    align-items: center;
    justify-content: center;
    font-size: 22px;
    cursor: pointer;
    z-index: 1500;
    box-shadow: 0 6px 16px rgba(0,0,0,0.25);
    border: 2px solid rgba(255,255,255,0.3);
}

/* ========== FLOATING POST BUTTON ========== */
.floating-post-btn {
    position:fixed; bottom:24px; left:24px;
    width:60px; height:60px; background:var(--accent); border-radius:16px;
    display:none; align-items:center; justify-content:center;
    box-shadow:0 8px 20px rgba(0,0,0,0.3), 0 0 20px rgba(44,125,160,0.3);
    cursor:pointer; z-index:9999; color:white;
    border:2px solid rgba(255,255,255,0.4);
    transition:transform 0.2s, box-shadow 0.2s;
}
.floating-post-btn:hover { transform:scale(1.1); box-shadow:0 12px 28px rgba(0,0,0,0.4), 0 0 30px rgba(44,125,160,0.5); }
.floating-post-btn svg { width:28px; height:28px; filter:drop-shadow(0 0 4px rgba(255,255,255,0.5)); }

/* ---------- Buttons ---------- */
.add-btn, .follow-btn, .settings-nav-item, .save-settings-btn, .tab-btn, #goToDashboardBtn, #editProfileBtn, #saveProfileBtn, #accountDetailsBtn,
#proceedToCheckoutBtn, #continueToPaymentBtn, #placeOrderBtn {
    border-radius: var(--radius-btn)!important; transition:transform 0.2s, box-shadow 0.2s, background 0.2s;
    cursor:pointer; padding:12px 24px!important; font-size:16px!important; font-weight:600!important;
    border:none; display:inline-flex; align-items:center; gap:8px;
    box-shadow: var(--shadow); background: var(--accent); color: white;
}
.add-btn:hover { transform:translateY(-3px); background:var(--accent-hover); box-shadow:var(--btn-hover-shadow); }
.add-btn.secondary { background:transparent; border:1px solid var(--accent); color:var(--accent); }
.add-btn.secondary:hover { background:var(--accent); color:white; }

/* ---------- Tabs ---------- */
.main-tabs, .sub-tabs {
    display:flex; flex-wrap:nowrap; overflow-x:auto; gap:8px;
    margin: 4px 12px 8px; padding:8px 0; scrollbar-width:thin;
}
.tab-btn { background:var(--bg-card-alt); border:none; white-space:nowrap; color:var(--text-primary); padding:10px 18px!important; font-size:14px!important; }
.tab-btn.active { background:var(--accent); color:white; }

.main-tabs { padding: 0 4px; overflow-x: auto; scrollbar-width: thin; }
.main-tabs::-webkit-scrollbar { height: 4px; }
.main-tabs::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 10px; }

/* ---------- Seller Tabs ---------- */
.seller-tabs { display:flex; gap:8px; border-bottom:1px solid var(--border); margin:0 20px; overflow-x:auto; padding-bottom:4px; }
.seller-tab { background:none; border:none; cursor:pointer; font-weight:500; color:var(--text-secondary); padding:10px 16px; white-space:nowrap; }
.seller-tab.active { color:var(--accent); border-bottom:2px solid var(--accent); }

/* ---------- Products Grid ---------- */
.products { display:grid; grid-template-columns:repeat(auto-fill, minmax(220px, 1fr)); gap:20px; }
.product-card { background:var(--bg-card); border-radius: var(--radius-card); overflow:hidden; box-shadow:var(--shadow); transition:transform 0.3s, box-shadow 0.3s; cursor:pointer; }
.product-card:hover { transform:translateY(-6px); box-shadow:0 20px 30px -12px rgba(0,0,0,0.15); }
.product-img { width:100%; height:180px; object-fit:cover; }
.product-info { padding:12px; }
.product-title { font-weight:600; font-size:14px; color:var(--text-primary); }
.price { font-size:16px; font-weight:700; color:var(--success); }
.seller-name { font-size:12px; color:var(--accent); cursor:pointer; }
.add-to-cart { width:100%; background:var(--accent); color:white; border:none; padding:10px; border-radius:40px; font-weight:600; cursor:pointer; transition:all 0.2s; }
.add-to-cart:hover { background:var(--accent-hover); }

/* ---------- Home Promo ---------- */
.home-promo { background:linear-gradient(135deg, #1e6f5f, #2c7da0); color:white; border-radius:20px; padding:24px 20px; margin:16px 0; text-align:center; box-shadow:0 6px 20px rgba(0,0,0,0.15); }
.home-promo h3 { font-size:22px; font-weight:800; margin-bottom:6px; text-shadow:0 2px 4px rgba(0,0,0,0.2); }
.home-promo p { font-size:14px; opacity:0.95; font-weight:500; }

/* ---------- Feed Stories ---------- */
.feed-stories-row { display:flex; gap:14px; overflow-x:auto; padding:12px 0 16px; scroll-behavior:smooth; }
.feed-story-circle { display:flex; flex-direction:column; align-items:center; gap:5px; cursor:pointer; flex-shrink:0; min-width:70px; }
.feed-story-avatar { width:64px; height:64px; border-radius:50%; object-fit:cover; border:3px solid var(--accent); padding:2px; background:linear-gradient(45deg, #f59e0b, #ec4899, #8b5cf6); }
.feed-story-avatar.unviewed { background:linear-gradient(45deg, #ff4b4b, #ec4899); border-color:transparent; }
.feed-story-avatar.viewed { background:#d1d5db; border-color:#d1d5db; }
.feed-story-name { font-size:11px; font-weight:500; text-align:center; max-width:70px; overflow:hidden; color:var(--text-secondary); }
.story-plus-badge { position:absolute; bottom:18px; right:-2px; background:var(--accent); border-radius:50%; width:22px; height:22px; display:flex; align-items:center; justify-content:center; border:2px solid white; color:white; font-size:14px; font-weight:bold; }

/* Feed bottom padding */
.feed-posts-list { padding-bottom: 80px; }

/* ---------- Feed Post Card ---------- */
.feed-post-card { background:var(--bg-card); border-radius:24px; overflow:hidden; box-shadow:0 2px 8px rgba(0,0,0,0.08); margin-bottom:24px; }
.feed-post-header { display:flex; align-items:center; gap:12px; padding:14px 16px; position:relative; }
.feed-post-avatar { width:40px; height:40px; border-radius:50%; object-fit:cover; cursor:pointer; }
.feed-post-author-info { display:flex; flex-direction:column; cursor:pointer; }
.feed-post-author-name { font-weight:700; font-size:14px; }
.feed-post-handle { font-size:12px; color:var(--text-muted); }
.feed-post-time { font-size:12px; color:var(--text-muted); margin-left:auto; }
.feed-post-carousel { position:relative; overflow:hidden; }
.feed-post-carousel-inner { display:flex; transition:transform 0.3s; width:100%; }
.feed-post-carousel-image { width:100%; height:auto; max-height:550px; object-fit:contain; flex-shrink:0; }
.feed-post-actions { display:flex; gap:18px; padding:12px 16px; align-items:center; }
.feed-post-action-btn { background:none; border:none; cursor:pointer; display:flex; align-items:center; gap:6px; color:var(--text-secondary); font-size:14px; padding:0; transition:color 0.2s; }
.feed-post-action-btn svg { width:24px; height:24px; stroke:currentColor; fill:none; }
.feed-post-action-btn.liked { color:#ff4b4b; }
.feed-post-action-btn.liked svg { fill:#ff4b4b; stroke:#ff4b4b; }
.feed-post-caption { padding:0 16px 12px; font-size:14px; }
.post-author-name-inline { font-weight:700; }

/* Three-dot menu */
.post-options-btn { margin-left:auto; background:none; border:none; cursor:pointer; color:var(--text-muted); padding:4px; }
.post-options-btn svg { width:20px; height:20px; stroke:currentColor; }
.post-options-dropdown { position:absolute; top:40px; right:16px; background:var(--bg-card); border:1px solid var(--border); border-radius:12px; box-shadow:0 4px 12px rgba(0,0,0,0.1); overflow:hidden; z-index:50; display:none; }
.post-options-dropdown.show { display:block; }
.post-options-dropdown button { display:block; width:100%; padding:10px 18px; background:none; border:none; text-align:left; font-size:14px; color:var(--text-primary); cursor:pointer; }
.post-options-dropdown button:hover { background:var(--bg-card-alt); }

/* ---------- Comment Section ---------- */
.comment-section { margin-top:20px; padding:0 16px; }
.comment-list { display:flex; flex-direction:column; gap:12px; margin-bottom:12px; }
.comment-item { display:flex; gap:10px; }
.comment-item-avatar { width:32px; height:32px; border-radius:50%; object-fit:cover; flex-shrink:0; }
.comment-item-body { flex:1; }
.comment-item-username { font-weight:600; font-size:13px; }
.comment-item-text { font-size:13px; margin-top:2px; }
.comment-item-time { font-size:11px; color:var(--text-muted); margin-top:2px; }
.comment-input-area { display:flex; gap:8px; margin-top:8px; }
.comment-input-area input { flex:1; margin:0; }

/* ---------- Search Dropdown (Feed Page) ---------- */
.search-results-dropdown { position:absolute; top:60px; left:50%; transform:translateX(-50%); width:90%; max-width:480px; background:var(--bg-card); border-radius:16px; box-shadow:var(--shadow-lg); overflow:hidden; z-index:1100; display:none; }
.search-results-dropdown.show { display:block; }
.search-result-item { padding:12px 16px; cursor:pointer; display:flex; align-items:center; gap:10px; border-bottom:1px solid var(--border); }
.search-result-item:hover { background:var(--bg-card-alt); }
.search-result-avatar { width:36px; height:36px; border-radius:50%; object-fit:cover; }
.search-result-name { font-weight:600; font-size:14px; }
.search-result-handle { font-size:12px; color:var(--text-muted); }

/* ========== STORY RING (ALL DASHBOARDS) ========== */
.seller-avatar-wrapper, .professional-avatar-wrapper, .buyer-avatar-wrapper, .profile-avatar-col {
    position: relative;
}
.seller-avatar-wrapper .story-ring,
.professional-avatar-wrapper .story-ring,
.buyer-avatar-wrapper .story-ring,
.profile-avatar-col .story-ring {
    position: absolute;
    top: -6px; left: -6px;
    width: calc(100% + 12px); height: calc(100% + 12px);
    border-radius: 50%;
    background: linear-gradient(45deg, #f59e0b, #ec4899, #8b5cf6);
    padding: 3px;
    z-index: 0;
    display: none;
}
.seller-avatar-wrapper.has-story .story-ring,
.professional-avatar-wrapper.has-story .story-ring,
.buyer-avatar-wrapper.has-story .story-ring,
.profile-avatar-col.has-story .story-ring {
    display: block;
}
.seller-avatar-large, .professional-avatar-large, .buyer-public-avatar, .profile-avatar-col img {
    position: relative;
    z-index: 1;
    cursor: pointer;
}

/* ========== ORIGINAL SELLER DASHBOARD LAYOUT ========== */
.seller-dashboard-container { background: var(--bg-card); border-radius:28px; overflow:hidden; max-width:1200px; margin:0 auto; }
.seller-banner-wrapper { position:relative; width:100%; height:200px; background:linear-gradient(135deg, #1e6f5f, #2c7da0); }
.seller-banner { width:100%; height:100%; object-fit:cover; }
.banner-upload-icon, .avatar-upload-icon { position:absolute; background:rgba(0,0,0,0.6); color:white; border-radius:50%; display:flex; align-items:center; justify-content:center; cursor:pointer; transition: opacity 0.2s; }
.banner-upload-icon { top:12px; right:12px; width:36px; height:36px; }
.avatar-upload-icon { bottom:4px; right:4px; width:28px; height:28px; }
.seller-avatar-wrapper { position:relative; margin-top:-50px; margin-left:24px; width:100px; height:100px; }
.seller-avatar-large { width:100px; height:100px; border-radius:50%; border:4px solid white; object-fit:cover; }
.seller-info-centered { text-align:left; margin-top:16px; padding:0 20px 20px; color: var(--text-primary); }
.seller-name-large { font-size:28px; font-weight:700; }
.seller-bio { color: var(--text-secondary); margin-bottom:12px; }
.seller-stats { display:flex; gap:32px; margin:16px 0; font-size:14px; font-weight:bold; }
.seller-actions { display:flex; flex-wrap:wrap; gap:12px; margin:20px 0; }
.products-grid-3col { display:grid; grid-template-columns:repeat(3, 1fr); gap:12px; }
.products-grid-item { aspect-ratio:1/1; overflow:hidden; cursor:pointer; border-radius:12px; transition: transform 0.2s; }
.products-grid-item:hover { transform: scale(1.02); }
.products-grid-item img { width:100%; height:100%; object-fit:cover; }
.posts-grid { display:grid; grid-template-columns:repeat(3, 1fr); gap:4px; }
.posts-grid-item { aspect-ratio:1/1; overflow:hidden; cursor:pointer; transition: transform 0.2s; }
.posts-grid-item:hover { transform: scale(1.02); }
.posts-grid-item img { width:100%; height:100%; object-fit:cover; }

/* ========== PROFESSIONAL (SERVICE) & BUYER PUBLIC DASHBOARD ========== */
.professional-public-page,
.buyer-public-page {
    max-width: 1000px;
    margin: 0 auto;
    background: var(--bg-card);
    border-radius: 28px;
    padding: 0 20px 20px 20px;
    overflow: visible;
    box-shadow: var(--shadow);
    position: relative;
}

/* Banner */
.professional-banner-wrapper,
.buyer-banner-wrapper {
    position: relative;
    width: 100%;
    height: 220px;
    background: linear-gradient(135deg, #1e6f5f, #2c7da0);
    border-radius: 28px 28px 0 0;
    overflow: hidden;
}
.professional-banner,
.buyer-public-banner {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Avatar – centered over banner */
.professional-avatar-wrapper,
.profile-avatar-col {
    position: absolute;
    top: 160px;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 120px;
    z-index: 2;
}
.buyer-public-page .profile-avatar-col {
    top: 160px;
    left: 50%;
    transform: translateX(-50%);
}
.professional-avatar-large,
.buyer-public-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 4px solid white;
    object-fit: cover;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Info area – below avatar, centered */
.professional-public-info,
.buyer-public-page .profile-info-col {
    margin-top: 80px;
    text-align: center;
    color: var(--text-primary);
}
.professional-public-name,
.buyer-public-page .profile-name {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 4px;
}
.professional-public-badge {
    background: var(--purple);
    color: white;
    display: inline-block;
    padding: 4px 16px;
    border-radius: 20px;
    font-size: 12px;
    margin-bottom: 8px;
}
.professional-public-bio,
.buyer-public-page .profile-bio {
    color: var(--text-secondary);
    margin: 8px 0;
    font-size: 15px;
    line-height: 1.5;
}
.professional-public-stats,
.buyer-public-page .profile-stats {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin: 16px 0;
    font-size: 15px;
    font-weight: 500;
}

/* Actions buttons */
.professional-public-actions,
.buyer-public-page .profile-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin: 20px 0;
}
.professional-public-actions .add-btn,
.buyer-public-page .profile-actions .add-btn {
    min-width: 120px;
    justify-content: center;
}

/* Edit pencils (always visible on own page) */
.banner-upload-icon, .avatar-upload-icon {
    opacity: 0.8;
}
.banner-upload-icon:hover, .avatar-upload-icon:hover {
    opacity: 1;
}

/* Posts grid – 3 columns */
.buyer-posts-grid-2col {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    padding: 0 20px 20px;
}
.buyer-posts-grid-item {
    aspect-ratio: 1;
    overflow: hidden;
    cursor: pointer;
    border-radius: 12px;
}
.buyer-posts-grid-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Add‑post tile */
.add-post-tile {
    display:flex;
    align-items:center;
    justify-content:center;
    background:var(--bg-card-alt);
    border:2px dashed var(--border);
    border-radius:16px;
    font-size:28px;
    color:var(--accent);
    cursor:pointer;
    transition:all 0.3s;
    aspect-ratio:1;
    width:100%;
    box-shadow:0 2px 8px rgba(0,0,0,0.04);
}
.add-post-tile:hover { background:var(--accent-light); border-color:var(--accent); transform:scale(1.02); }

/* ========== PROFILE PAGE ========== */
.profile-avatar { font-size:64px; width:100px; height:100px; display:flex; align-items:center; justify-content:center; margin:0 auto 12px; background:var(--bg-card-alt); border-radius:50%; }
.profile-info-card { background:var(--bg-card-alt); border-radius:16px; padding:16px; }
.profile-info-row { display:flex; justify-content:space-between; padding:10px 0; border-bottom:1px solid var(--border); }
.profile-info-label { font-weight:500; color:var(--text-secondary); }
.profile-info-value { font-weight:600; }
.profile-cards-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:12px; margin:20px 0; }
.profile-card { background:var(--bg-card-alt); border-radius:16px; padding:16px; text-align:center; cursor:pointer; transition:transform 0.2s; }
.profile-card:hover { transform:translateY(-2px); }
.profile-card-icon { font-size:28px; margin-bottom:8px; }
.profile-card-title { font-size:13px; font-weight:600; }
.dashboard-link-card { background:linear-gradient(135deg, #1e6f5f, #2c7da0); color:white; border-radius:16px; padding:20px; margin:16px 0; text-align:center; }

body.dark-mode .profile-info-card,
body.dark-mode .profile-card,
body.dark-mode .profile-section { background: #1e293b; color: #f1f5f9; }
body.dark-mode .profile-info-row { border-color: #475569; }
body.dark-mode .dashboard-link-card { background: linear-gradient(135deg, #1e3a5f, #0b1f3a) !important; }

/* ---------- Settings Sidebar ---------- */
.settings-sidebar { position:fixed; top:0; right:-320px; width:300px; height:100%; background:var(--bg-card); backdrop-filter:blur(20px); z-index:2500; transition:right 0.3s; overflow-y:auto; padding:24px; box-shadow:-4px 0 20px rgba(0,0,0,0.15); }
.settings-sidebar.open { right:0; }
.settings-nav-item { display:block; width:100%; text-align:left; margin:6px 0; background:var(--bg-card-alt); color:var(--text-primary); border-radius:40px; padding:14px 24px; }
.settings-nav-item:hover { background:var(--accent); color:white; }
.settings-divider { border-top:1px solid var(--border); margin:20px 0; }
.settings-section-title { font-weight:600; font-size:15px; margin-bottom:12px; }
.settings-checkbox-item { display:flex; justify-content:space-between; align-items:center; padding:14px 0; margin:4px 0; border-bottom:1px solid var(--border); }
.settings-checkbox-item label { font-size:14px; color:var(--text-primary); cursor: pointer; }
.settings-checkbox-item input[type="checkbox"] { width:36px; height:20px; accent-color:var(--accent); transform:scale(1); margin-left:10px; }
.overlay-backdrop { display:none; position:fixed; top:0; left:0; width:100%; height:100%; background:rgba(0,0,0,0.4); backdrop-filter:blur(4px); z-index:2400; }
.overlay-backdrop.show { display:block; }

/* ---------- Cart Sidebar ---------- */
.cart-overlay { position:fixed; top:0; right:-380px; width:360px; height:100%; background:var(--bg-card); backdrop-filter:blur(20px); z-index:2000; transition:right 0.3s; overflow-y:auto; padding:24px; box-shadow:-8px 0 30px rgba(0,0,0,0.15); }
.cart-overlay.open { right:0; }

/* ---------- Modals (class‑based visibility) ---------- */
.modal { display:none; opacity:1; pointer-events:auto; position:fixed; top:0; left:0; width:100%; height:100%; background:rgba(0,0,0,0.6); backdrop-filter:blur(8px); z-index:2000; align-items:center; justify-content:center; }
.modal.active { display:flex; }
.modal-content { background:var(--bg-card); border-radius:28px; padding:28px; max-width:480px; width:90%; max-height:85vh; overflow-y:auto; box-shadow:var(--shadow-lg); }

/* ---------- Story Viewer Modal (hide by default) ---------- */
#storyViewerModal { display: none; }
#storyViewerModal.active { display: flex; }

/* ---------- Story & Post Preview (advanced) ---------- */
.story-preview-container { margin-bottom:12px; }
.story-preview-carousel { display:flex; gap:8px; overflow-x:auto; padding:4px 0; }
.story-preview-item { position:relative; flex-shrink:0; width:100px; height:100px; border-radius:12px; overflow:hidden; }
.story-preview-item img { width:100%; height:100%; object-fit:cover; }
.remove-preview-btn { position:absolute; top:4px; right:4px; background:rgba(0,0,0,0.7); color:white; border:none; width:20px; height:20px; border-radius:50%; font-size:12px; cursor:pointer; }

/* ---------- Help Centre ---------- */
.help-grid-2col { display:grid; grid-template-columns:repeat(auto-fill, minmax(280px,1fr)); gap:16px; margin-bottom:20px; }
.help-card { background:var(--bg-card-alt); border-radius:20px; padding:24px; cursor:pointer; transition:transform 0.2s, box-shadow 0.2s; border:1px solid var(--border); }
.help-card:hover { transform:translateY(-4px); box-shadow:var(--shadow-lg); }
.help-card-icon { width:48px; height:48px; margin-bottom:12px; display:flex; align-items:center; justify-content:center; }
.help-card-icon svg { width:32px; height:32px; stroke:var(--accent); }
.help-card-title { font-weight:700; font-size:16px; margin-bottom:6px; }
.help-article-page { max-width:800px; margin:0 auto; padding:24px; background:var(--bg-card); border-radius:24px; line-height:1.8; }
.help-survey { margin-top:30px; padding:20px; background:var(--bg-card-alt); border-radius:16px; text-align:center; }
.help-survey-buttons { display:flex; gap:12px; justify-content:center; margin-top:12px; }
.help-action-buttons { display:flex; flex-direction:column; gap:12px; margin-top:20px; }

/* ---------- Address / Payment Boxes ---------- */
.address-box, .payment-box { padding:18px; background:var(--bg-card-alt); border-radius:20px; margin-bottom:10px; cursor:pointer; border:2px solid transparent; transition:all 0.2s; box-shadow:var(--shadow); }
.address-box.default, .payment-box.default { border-color:var(--accent); background:var(--accent-light); }

/* ---------- Chat ---------- */
.chat-thread-container { max-width:700px; margin:0 auto; background:var(--bg-card); border-radius:24px; overflow:hidden; box-shadow:var(--shadow); }
.chat-header { padding:16px; border-bottom:1px solid var(--border); display:flex; align-items:center; gap:12px; }
.chat-messages-area { padding:16px; height:50vh; overflow-y:auto; display:flex; flex-direction:column; gap:12px; }
.chat-message { max-width:75%; padding:12px 18px; border-radius:24px; font-size:15px; position:relative; word-wrap:break-word; line-height:1.4; }
.chat-message.sent { background:var(--accent); color:white; align-self:flex-end; border-bottom-right-radius:4px; }
.chat-message.received { background:var(--bg-card-alt); color:var(--text-primary); align-self:flex-start; border-bottom-left-radius:4px; border:1px solid var(--border); }
.chat-message-time { font-size:10px; color:inherit; opacity:0.7; margin-top:4px; text-align:right; }

/* ---------- AI Chat Support (full‑screen) ---------- */
#aiChatSupport.page.active {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 3000;
    background: var(--bg-body);
}
.ai-chat-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    max-width: 800px;
    margin: 0 auto;
    background: var(--bg-card);
    box-shadow: var(--shadow-lg);
}
.ai-chat-header {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--header-gradient);
    color: white;
}
.ai-chat-header h3 { font-weight: 700; }
.ai-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.ai-chat-message {
    max-width: 80%;
    padding: 12px 18px;
    border-radius: 24px;
    font-size: 15px;
    line-height: 1.5;
}
.ai-chat-message.agent {
    align-self: flex-start;
    background: var(--bg-card-alt);
    color: var(--text-primary);
    border-bottom-left-radius: 4px;
    border: 1px solid var(--border);
}
.ai-chat-message.user {
    align-self: flex-end;
    background: var(--accent);
    color: white;
    border-bottom-right-radius: 4px;
}
.ai-chat-typing {
    display: flex;
    gap: 4px;
    padding: 8px 16px;
}
.typing-dot {
    width: 8px; height: 8px;
    background: var(--text-muted);
    border-radius: 50%;
    animation: typingBounce 1.4s infinite ease-in-out;
}
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingBounce {
    0%, 80%, 100% { transform: scale(0.6); }
    40% { transform: scale(1); }
}
.ai-chat-input-area {
    display: flex;
    padding: 16px;
    border-top: 1px solid var(--border);
    gap: 8px;
}

/* ---------- Academy Full‑screen ---------- */
#academyPage.page.active {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: #f0f4f8;
    z-index: 2000;
    overflow-y: auto;
    padding: 0;
    max-width: 100%;
}
.academy-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 24px;
}
.academy-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 12px;
}
.academy-header h1 { font-size: 28px; font-weight: 800; color: #1e293b; }
.academy-back {
    background: none;
    border: 1px solid #cbd5e1;
    border-radius: 24px;
    padding: 8px 20px;
    font-size: 14px;
    cursor: pointer;
    color: #1e293b;
}
.academy-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.academy-card { background: white; border-radius: 20px; padding: 24px; box-shadow: 0 4px 12px rgba(0,0,0,0.06); transition: transform 0.2s; cursor: pointer; }
.academy-card:hover { transform: translateY(-4px); }
.academy-card h3 { font-size: 20px; margin-bottom: 8px; }
.academy-card p { font-size: 14px; color: #475569; margin-bottom: 16px; }
.academy-progress { height: 6px; background: #e2e8f0; border-radius: 3px; overflow: hidden; margin: 12px 0; }
.academy-progress-fill { height: 100%; background: #2563eb; border-radius: 3px; }
.academy-badge { display: inline-block; background: #f59e0b; color: #0f172a; padding: 2px 10px; border-radius: 12px; font-size: 12px; font-weight: 600; margin-left: 8px; }

/* Academy course viewer */
.academy-course-viewer {
    background: white;
    border-radius: 24px;
    padding: 30px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.08);
    display: flex;
    gap: 24px;
    min-height: 70vh;
}
.academy-sidebar {
    width: 260px;
    border-right: 1px solid #e2e8f0;
    padding-right: 20px;
    flex-shrink: 0;
}
.academy-sidebar h4 { font-size: 16px; margin-bottom: 16px; }
.academy-module-item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px; border-radius: 10px;
    cursor: pointer; font-size: 14px; margin-bottom: 4px; color: #334155;
}
.academy-module-item:hover { background: #f1f5f9; }
.academy-module-item.active { background: #dbeafe; color: #1e40af; font-weight: 600; }
.academy-module-item.completed { color: #10b981; }
.academy-module-check {
    width: 20px; height: 20px;
    border-radius: 50%; border: 2px solid #cbd5e1;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; flex-shrink: 0;
}
.academy-module-item.completed .academy-module-check {
    background: #10b981; border-color: #10b981; color: white;
}
.academy-content {
    flex: 1;
    display: flex; flex-direction: column;
    min-width: 0;
}
.academy-content-body {
    flex: 1;
    line-height: 1.8;
    font-size: 15px;
    word-wrap: break-word;
}
.academy-content-body img {
    max-width: 100%; border-radius: 12px; margin: 16px 0;
}
.academy-nav {
    display: flex; justify-content: space-between; margin-top: 20px;
}
.academy-nav button {
    background: #2563eb; color: white; border: none;
    border-radius: 24px; padding: 10px 24px; cursor: pointer; font-weight: 600;
}
.academy-nav button:disabled { opacity: 0.5; cursor: default; }

/* Academy quiz */
.academy-quiz { margin-top: 20px; padding: 20px; background: #f8fafc; border-radius: 16px; }
.academy-quiz h4 { margin-bottom: 12px; }
.academy-quiz .quiz-option {
    display: block; padding: 10px; margin: 6px 0;
    border: 1px solid #cbd5e1; border-radius: 8px; cursor: pointer;
    background: white;
}
.academy-quiz .quiz-option.selected { border-color: #2563eb; background: #eff6ff; }
.academy-quiz .quiz-option.correct { border-color: #10b981; background: #f0fdf4; }
.academy-quiz .quiz-option.wrong { border-color: #ef4444; background: #fef2f2; }

/* ---------- Black Friday Section ---------- */
.black-friday-header {
    font-size: 24px;
    font-weight: 800;
    text-align: center;
    color: #facc15;
    background: #111;
    padding: 16px;
    border-radius: 20px 20px 0 0;
}

/* ---------- About Us Logo Fix ---------- */
.about-us-footer-logo svg {
    width: 60px;
    height: 60px;
}
.about-us-footer-logo {
    text-align: center;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}
.about-us-footer-logo .logo-text {
    font-size: 20px;
    font-weight: 800;
    margin-top: 8px;
    color: var(--text-primary);
}

/* ---------- Gift Card Card Styles ---------- */
.gift-card-card {
    background: var(--bg-card);
    border-radius: 20px;
    padding: 24px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: transform 0.2s;
    cursor: pointer;
    position: relative;
}
.gift-card-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.gift-card-icon { margin-bottom: 12px; }
.gift-card-icon svg { width: 64px; height: 64px; stroke: var(--accent); }
.gift-card-denomination { font-size: 28px; font-weight: 800; color: var(--text-primary); margin-bottom: 8px; }
.gift-card-description { font-size: 14px; color: var(--text-secondary); margin-bottom: 16px; }
.gift-card-buy-btn { width: 100%; }
.gift-card-serial {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 8px;
    letter-spacing: 0.5px;
}

/* ---------- Services Marketplace ---------- */
.services-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(280px,1fr)); gap:16px; }
.service-card {
    background: var(--bg-card);
    border-radius: 20px;
    padding: 20px;
    display: flex;
    gap: 16px;
    align-items: center;
    cursor: pointer;
    box-shadow: var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
}
.service-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }
.service-card-avatar { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.service-card-info { flex: 1; }
.service-card-name { font-weight: 700; font-size: 16px; margin-bottom: 4px; }
.service-card-category { font-size: 12px; color: var(--accent); margin-bottom: 4px; }
.service-card-bio { font-size: 13px; color: var(--text-secondary); margin-bottom: 6px; }
.service-card-rating { font-size: 12px; color: var(--star-color); }
.service-card-actions { display: flex; gap: 8px; margin-top: 8px; }
.service-card-actions button { padding: 6px 14px; font-size: 13px; }

/* ---------- Notification Overhaul ---------- */
.notification-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    background: var(--bg-card);
    border-radius: 16px;
    margin-bottom: 10px;
    box-shadow: var(--shadow);
    border-left: 5px solid var(--accent);
    cursor: pointer;
    transition: all 0.2s;
}
.notification-item:hover {
    background: var(--bg-card-alt);
    transform: scale(1.01);
    box-shadow: var(--shadow-hover);
}
.notification-item.unread { border-left-color: var(--danger); background: var(--accent-light); }
.notification-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--danger); flex-shrink: 0; margin-top: 6px; }
.notification-content { flex: 1; }
.notification-title { font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.notification-message { font-size: 13px; color: var(--text-secondary); }
.notification-time { font-size: 11px; color: var(--text-muted); margin-top: 6px; }
.notification-expanded {
    display: none;
    margin-top: 8px;
    font-size: 13px;
    color: var(--text-primary);
    padding-top: 8px;
    border-top: 1px solid var(--border);
}

/* ---------- Analytics Miniature Cards ---------- */
.analytics-kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.analytics-card {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 14px;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: transform 0.2s;
}
.analytics-card:hover { transform: scale(1.02); }
.analytics-card h4 { font-size: 12px; color: var(--text-secondary); margin-bottom: 6px; }
.analytics-card .value { font-size: 22px; font-weight: 800; margin-bottom: 2px; }
.analytics-card .sub { font-size: 11px; color: var(--text-muted); }
.analytics-chart-container { background: var(--bg-card); border-radius: 16px; padding: 16px; box-shadow: var(--shadow); margin-bottom: 16px; }
.analytics-chart-container canvas { max-height: 150px; width: 100% !important; }

/* ---------- Avatar Picker – Horizontal 3‑per‑row ---------- */
.avatar-picker {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-top: 16px;
}
.avatar-picker-item {
    width: calc(33.33% - 10px);
    max-width: 100px;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card-alt);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid transparent;
}
.avatar-picker-item:hover { transform: scale(1.1); border-color: var(--accent); background: var(--accent-light); }
.avatar-picker-item.selected { border-color: var(--accent); background: var(--accent-light); }

/* ---------- Footer Visibility ---------- */
#mainFooter { display: none; }
body.home-active #mainFooter { display: block; }

/* ---------- Global Dark Mode Deep Coverage ---------- */
body.dark-mode .page,
body.dark-mode .card,
body.dark-mode .address-box,
body.dark-mode .payment-box,
body.dark-mode .help-card,
body.dark-mode .help-article-page,
body.dark-mode .academy-card,
body.dark-mode .service-card,
body.dark-mode .product-card,
body.dark-mode .feed-post-card,
body.dark-mode .notification-item,
body.dark-mode .settings-sidebar,
body.dark-mode .cart-overlay,
body.dark-mode .modal-content,
body.dark-mode .gift-card-card,
body.dark-mode .analytics-card,
body.dark-mode .analytics-chart-container,
body.dark-mode .admin-chart-card,
body.dark-mode .admin-kpi-card,
body.dark-mode .admin-module-card,
body.dark-mode .admin-help-card,
body.dark-mode .admin-orders-table,
body.dark-mode .admin-escalated-cases,
body.dark-mode .quick-action-card,
body.dark-mode .agent-search-card,
body.dark-mode .agent-verify-card,
body.dark-mode .agent-customer-header,
body.dark-mode .agent-tab-content,
body.dark-mode .agent-chat-list,
body.dark-mode .agent-chat-area,
body.dark-mode .agent-dispute-card,
body.dark-mode .agent-dispute-detail,
body.dark-mode .agent-form-card {
    background: var(--bg-card);
    color: var(--text-primary);
}
body.dark-mode .address-box,
body.dark-mode .payment-box,
body.dark-mode .help-card,
body.dark-mode .academy-card,
body.dark-mode .service-card,
body.dark-mode .product-card,
body.dark-mode .feed-post-card,
body.dark-mode .notification-item,
body.dark-mode .settings-sidebar,
body.dark-mode .cart-overlay,
body.dark-mode .modal-content,
body.dark-mode .gift-card-card,
body.dark-mode .analytics-card,
body.dark-mode .analytics-chart-container,
body.dark-mode .admin-chart-card,
body.dark-mode .admin-kpi-card,
body.dark-mode .admin-module-card,
body.dark-mode .admin-help-card,
body.dark-mode .admin-orders-table,
body.dark-mode .admin-escalated-cases,
body.dark-mode .quick-action-card,
body.dark-mode .agent-search-card,
body.dark-mode .agent-verify-card,
body.dark-mode .agent-customer-header,
body.dark-mode .agent-tab-content,
body.dark-mode .agent-chat-list,
body.dark-mode .agent-chat-area,
body.dark-mode .agent-dispute-card,
body.dark-mode .agent-dispute-detail,
body.dark-mode .agent-form-card {
    border-color: var(--border);
}
body.dark-mode .admin-help-card {
    background: linear-gradient(135deg, #1e88e5, #1565c0);
    color: white;
}
body.dark-mode .admin-help-card h3 { color: white; }
body.dark-mode .admin-help-card p { color: rgba(255,255,255,0.9); }
body.dark-mode .admin-date-btn.active { background: var(--bg-card-alt); color: var(--accent); }
body.dark-mode .chart-time-btn.active { background: var(--bg-card-alt); color: var(--accent); }

/* ---------- Password Toggle Icon ---------- */
.password-wrapper { position: relative; }
.password-wrapper .toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
}
.password-wrapper .toggle-password svg { width: 20px; height: 20px; stroke: currentColor; }

/* ---------- Responsive ---------- */
@media (max-width:768px) {
    .products { grid-template-columns:repeat(auto-fill, minmax(160px,1fr)); gap:12px; }
    .header { flex-direction:column; align-items:stretch; }
    .search-bar { max-width:100%; margin:8px 0; }
    .header-actions { justify-content:center; gap:8px; margin-top:4px; }
    .floating-post-btn { width:52px; height:52px; bottom:20px; left:20px; }
    .profile-cards-grid { grid-template-columns:repeat(2,1fr); }
    .posts-grid { grid-template-columns:repeat(2,1fr); }
    .admin-charts-row { grid-template-columns:1fr; }
    .admin-kpi-grid { grid-template-columns:repeat(2,1fr); }
    .admin-modules-grid { grid-template-columns:repeat(2,1fr); }
    .add-post-tile { font-size:20px; }
    .buyer-posts-grid-2col { grid-template-columns: repeat(2, 1fr); }
    .academy-course-viewer { flex-direction: column; }
    .academy-sidebar { width: 100%; border-right: none; border-bottom: 1px solid #e2e8f0; padding-right: 0; padding-bottom: 12px; margin-bottom: 12px; }
    .academy-header h1 { font-size: 22px; }
    .academy-content-body { font-size: 14px; }
    .professional-avatar-wrapper, .buyer-public-page .profile-avatar-col { top: 150px; }
    .professional-public-info, .buyer-public-page .profile-info-col { margin-top: 70px; }
}