:root {
    --bg-color: #0d0e15;
    --text-main: #f8f9fa;
    --text-muted: #8b8d98;
    
    /* Primary brand colors */
    --accent-primary: #6366f1;
    --accent-secondary: #ec4899;
    --accent-gradient: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
    
    /* UI components */
    --glass-bg: rgba(20, 21, 31, 0.7);
    --glass-border: rgba(255, 255, 255, 0.08);
    --nav-height: 72px;
    --topbar-height: 64px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
}

/* -----------------------------
   Topbar Styles
   ----------------------------- */
.topbar {
    position: sticky;
    top: 0;
    width: 100%;
    flex-shrink: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: var(--topbar-height);
    padding: 0 1.5rem;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
    z-index: 5000;
}

.topbar > div {
    flex: 1;
    display: flex;
}

.topbar-left {
    justify-content: flex-start;
}

.topbar-center {
    justify-content: center;
}

.topbar-center .logo {
    height: 32px;
    object-fit: contain;
    border-radius: 8px; /* Optional depending on logo content */
    filter: drop-shadow(0 4px 12px rgba(99, 102, 241, 0.3));
}

.topbar-right {
    justify-content: flex-end;
    z-index: 6001;
}

.icon-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    font-size: 1.25rem;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
    pointer-events: auto !important;
    z-index: 10;
}

.icon-btn i {
    pointer-events: none;
}

.icon-btn:active {
    transform: scale(0.95);
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.icon-btn .badge {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 8px;
    height: 8px;
    background: var(--accent-secondary);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--accent-secondary);
}

/* -----------------------------
   Main Content Area
   ----------------------------- */
.main-content {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    position: relative;
}

.empty-state {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    animation: fadeIn 1.2s ease-out;
}

.empty-state p {
    font-size: 1.125rem;
    font-weight: 500;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    z-index: 10;
}

.glow-bg {
    position: absolute;
    width: 300px;
    height: 300px;
    background: var(--accent-gradient);
    filter: blur(100px);
    opacity: 0.15;
    border-radius: 50%;
    z-index: 0;
    animation: pulseGlow 4s infinite alternate ease-in-out;
}

/* -----------------------------
   Bottom Floating Dock Navigation
   ----------------------------- */
.bottom-nav {
    position: fixed;
    bottom: 20px; /* Floating margin */
    left: 50%;
    transform: translateX(-50%);
    width: 92%; /* Pill width */
    max-width: 420px;
    height: 64px;
    background: rgba(20, 21, 31, 0.85); /* Premium GlassBg */
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 0 1rem;
    z-index: 2000;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5), 
                0 5px 15px rgba(0, 0, 0, 0.3);
    display: flex;
    justify-content: center;
    align-items: center;
}

.bottom-nav ul {
    width: 100%;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: space-around;
    align-items: center;
    list-style: none;
}

.nav-item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.nav-item a, .nav-item button {
    background: none;
    border: none;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    width: auto;
    padding: 8px;
}

.nav-item i {
    font-size: 1.5rem;
    color: var(--text-muted);
    transition: all 0.3s ease;
}

.nav-item span {
    font-size: 0.625rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    transition: all 0.3s ease;
    opacity: 0.6;
}

/* Active indicator via parent page classes */
.page-home .nav-home i,
.page-search .nav-search i,
.page-chat .nav-chat i,
.page-shops .nav-shops i,
.page-profile .nav-profile i {
    color: var(--text-main);
    transform: translateY(-2px);
    filter: drop-shadow(0 0 12px var(--accent-primary));
}

.page-home .nav-home span,
.page-search .nav-search span,
.page-chat .nav-chat span,
.page-shops .nav-shops span,
.page-profile .nav-profile span {
    color: var(--accent-primary);
    opacity: 1;
}

/* Floating Active Glow Dot */
.page-home .nav-home::after,
.page-search .nav-search::after,
.page-chat .nav-chat::after,
.page-shops .nav-shops::after,
.page-profile .nav-profile::after {
    content: '';
    position: absolute;
    bottom: -6px;
    width: 4px;
    height: 4px;
    background: var(--accent-primary);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--accent-primary);
    animation: fadeInGlow 0.3s ease forwards;
}

@keyframes fadeInGlow {
    from { opacity: 0; transform: scale(0); }
    to { opacity: 1; transform: scale(1); }
}

/* Ensure main content doesn't get hidden under floating dock */
.profile-main, .main-content {
    padding-bottom: 100px !important;
}

/* -----------------------------
   Animations
   ----------------------------- */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulseGlow {
    0% {
        transform: scale(0.9);
        opacity: 0.1;
    }
    100% {
        transform: scale(1.1);
        opacity: 0.25;
    }
}

/* -----------------------------
   Feed Layout (Home Page)
   ----------------------------- */
.feed-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    width: 100%;
    max-width: 500px;
    margin: 0 auto 2rem auto;
}

.feed-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.feed-card:hover {
    border-color: rgba(255,255,255,0.15);
    transform: translateY(-2px);
}

.feed-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.feed-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--glass-border);
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    padding: 1.5px;
}

.feed-username {
    font-size: 0.95rem;
    font-weight: 600;
}

.feed-image {
    width: 100%;
    aspect-ratio: 4 / 3;
    background-size: cover;
    background-position: center;
    background-color: #1a1b26;
}

.feed-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    gap: 1rem;
}

.feed-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.feed-product-name {
    font-size: 1.05rem;
    font-weight: 600;
    margin: 0;
    color: var(--text-main);
}

.feed-product-price {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--accent-primary);
    margin: 0;
}

.feed-order-btn {
    padding: 0.6rem 1.25rem;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 12px;
    white-space: nowrap;
    background: var(--accent-gradient);
    color: white;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
    transition: all 0.3s ease;
}

.feed-order-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.5);
}

/* Toggle Switch Component */
.toggle-switch-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0;
}

.toggle-switch-label {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-main);
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(255, 255, 255, 0.1);
    transition: .4s;
    border-radius: 34px;
    border: 1px solid rgba(255,255,255,0.2);
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 4px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

input:checked + .slider {
    background: var(--accent-gradient);
    border-color: transparent;
}

input:checked + .slider:before {
    transform: translateX(20px);
}

/* Original Price display with strikethrough */
.price-strikethrough {
    text-decoration: line-through;
    color: var(--text-muted);
    -webkit-text-fill-color: var(--text-muted);
    font-size: 0.85em;
    margin-right: 0.5rem;
    opacity: 0.7;
}

.badge-discount {
    background: #ef4444;
    color: white;
    -webkit-text-fill-color: white;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 6px;
    margin-left: 0.5rem;
    vertical-align: middle;
}

/* ───────────────── Sidebar & Menu (Global) ───────────────── */
.sidebar {
    position: fixed;
    top: 0;
    right: -100%; /* Hidden off-screen right */
    width: 280px;
    height: 100vh;
    height: 100dvh;
    background: rgba(18, 18, 18, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
}

.sidebar.active {
    right: 0; /* Slide in */
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.sidebar-menu {
    list-style: none;
    padding: 0;
    margin-top: 2rem;
    flex: 1;
    overflow-y: auto;
}

.sidebar-menu li {
    margin-bottom: 0.5rem;
}

.sidebar-menu li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0.75rem 1rem;
    color: #fff;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    border-radius: 10px;
    transition: background 0.2s;
}

.sidebar-menu li a:hover {
    background: rgba(255, 255, 255, 0.05);
}

.sidebar-menu li a i {
    font-size: 1.25rem;
    color: #fff;
    opacity: 0.8;
}

.logout-btn {
    margin-top: auto;
    width: 100%;
    padding: 0.85rem;
    border-radius: 12px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #ef4444;
    font-weight: 600;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.logout-btn:hover {
    background: #ef4444;
    color: #fff;
}
