/* ============================================
   TravelZona - Complete Stylesheet
   ============================================
   Contents:
   1. CSS Variables & Theme
   2. Reset & Base
   3. Layout (header, main, footer, nav)
   4. Components (cards, buttons, inputs, modals)
   5. Home Feed (posts, stories, weather)
   6. Shorts (video page)
   7. Profile Page
   8. Marketplace
   9. Animations
   10. Responsive
   ============================================ */

/* ─── 1. CSS Variables & Theme ────────────── */

:root {
    /* Brand colors (sky blue) */
    --brand-50: #f0f9ff;
    --brand-100: #e0f2fe;
    --brand-200: #bae6fd;
    --brand-300: #7dd3fc;
    --brand-400: #38bdf8;
    --brand-500: #0ea5e9;
    --brand-600: #0284c7;
    --brand-700: #0369a1;

    /* Accent (orange) */
    --accent-400: #fb923c;
    --accent-500: #f97316;

    /* Semantic — LIGHT MODE REDESIGNED */
    --background: #f0f4f8;          /* was #fafafa → now soft blue-gray for depth */
    --foreground: #1a202c;          /* was #0f172a → slightly warmer, better contrast */
    --card: #ffffff;                /* solid white cards pop against the blue-gray bg */
    --card-foreground: #1a202c;
    --muted: #e2e8f0;               /* was #f1f5f9 → slightly darker for better separation */
    --muted-foreground: #475569;    /* was #64748b → darker for WCAG AA contrast (7:1) */
    --border: #cbd5e1;              /* was #e2e8f0 → darker border, clearly visible */
    --input: #f1f5f9;               /* input fields slightly darker than cards */
    --ring: #0ea5e9;

    /* Status */
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;

    /* Radius */
    --radius: 0.75rem;

    /* Fonts */
    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
    --font-display: 'Playfair Display', serif;

    /* Shadows — STRONGER for light mode depth */
    --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.08), 0 1px 2px -1px rgb(0 0 0 / 0.08);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.08);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.12), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.15), 0 8px 10px -6px rgb(0 0 0 / 0.1);
}

html.dark {
    --background: #09090b;
    --foreground: #fafafa;
    --card: #18181b;
    --card-foreground: #fafafa;
    --muted: #27272a;
    --muted-foreground: #a1a1aa;
    --border: #27272a;
    --input: #18181b;
    --ring: #0ea5e9;
}

/* Override the light-mode body gradient in dark mode */
html.dark body {
    background-image: none;
}

/* ─── 2. Reset & Base ──────────────────────── */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    max-width: 100%; /* prevent any element from exceeding viewport width (Firefox fix) */
}

html {
    -webkit-font-smoothing: antialiased;
    scroll-behavior: smooth;
    overflow-x: hidden; /* prevent horizontal scrollbars (Firefox yellow columns fix) */
    /* Firefox scrollbar styling (prevents the yellow default scrollbar) */
    scrollbar-width: thin;
    scrollbar-color: rgba(139, 92, 246, 0.3) transparent;
}

body {
    font-family: var(--font-sans);
    background-color: var(--background);
    color: var(--foreground);
    line-height: 1.5;
    transition: background-color 0.3s, color 0.3s;
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
    /* Subtle gradient for depth — light mode only */
    background-image: linear-gradient(180deg, #e6edf5 0%, var(--background) 200px);
    background-attachment: fixed;
}

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

img {
    max-width: 100%;
    display: block;
}

/* Custom scrollbar */
.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
.custom-scrollbar::-webkit-scrollbar-track {
    background: transparent;
}
.custom-scrollbar::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}
.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: var(--muted-foreground);
}

.hide-scrollbar::-webkit-scrollbar {
    display: none;
}
.hide-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* ─── 3. Layout ────────────────────────────── */

/* Header */
.header {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 1rem;
    background: #ffffff;  /* solid white in light mode (was translucent) */
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-sm); /* add depth */
}
html.dark .header {
    background: rgba(24, 24, 27, 0.8);
}

.header-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border: none;
    background: transparent;
    color: var(--foreground);
    border-radius: 0.75rem;
    cursor: pointer;
    transition: background 0.2s;
    position: relative;
}
.header-btn:hover {
    background: var(--muted);
}

.badge {
    position: absolute;
    top: 0.25rem;
    right: 0.25rem;
    min-width: 1.125rem;
    height: 1.125rem;
    padding: 0 0.25rem;
    background: var(--danger);
    color: white;
    font-size: 0.625rem;
    font-weight: 700;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--background);
}

/* Logo */
.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.logo-icon {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--brand-400), #8b5cf6, #ec4899);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.875rem;
    box-shadow: var(--shadow-md);
}
.logo-text {
    font-size: 1.25rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--brand-500), #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
@media (max-width: 640px) {
    .logo-text { display: none; }
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}
@media (min-width: 768px) {
    .header-actions { gap: 0.5rem; }
}

/* Search bar */
.search-bar {
    display: none;
    align-items: center;
    background: var(--muted);
    border-radius: 9999px;
    padding: 0.375rem 0.75rem;
    width: 16rem;
    transition: width 0.3s;
}
.search-bar:focus-within {
    width: 20rem;
    box-shadow: var(--shadow-md);
}
.search-bar i {
    color: var(--muted-foreground);
    font-size: 0.875rem;
    margin-right: 0.5rem;
}
.search-bar input {
    background: transparent;
    border: none;
    outline: none;
    color: var(--foreground);
    font-size: 0.875rem;
    flex: 1;
}
@media (min-width: 768px) {
    .search-bar { display: flex; }
}

/* Avatar button */
.avatar-btn {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    border: 2px solid rgba(56, 189, 248, 0.3);
    overflow: hidden;
    cursor: pointer;
    background: transparent;
    margin-left: 0.25rem;
    transition: border-color 0.2s;
}
.avatar-btn:hover {
    border-color: var(--brand-400);
}
.avatar-btn img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.avatar-fallback {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--brand-400), #8b5cf6);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.75rem;
}

/* Sign In button */
.signin-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: none;
    background: linear-gradient(135deg, var(--brand-500), #8b5cf6);
    color: white;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 0.75rem;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    transition: box-shadow 0.2s;
}
.signin-btn:hover {
    box-shadow: 0 0 20px rgba(14, 165, 233, 0.4);
}

/* Dark mode icons */
.light-icon-only { display: none; }
html.dark .light-icon-only { display: inline; }
html.dark .dark-icon-only { display: none; }

/* Main content */
.main-content {
    min-height: calc(100vh - 130px);
    padding: 10px 10px;
    max-width: 672px;
    margin: 0 auto;
}

/* ─── Side Menu & Profile Menu ─────────────── */

.overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 55; /* higher than bottom-nav (50), lower than menus (60) */
    opacity: 0;
    transition: opacity 0.3s;
}
.overlay.hidden {
    display: none;
}
.overlay:not(.hidden) {
    opacity: 1;
}

.side-menu,
.profile-menu {
    position: fixed;
    top: 0;
    bottom: 0;
    z-index: 60;
    width: 20rem;
    max-width: 85vw;
    background: #ffffff;  /* solid white in light mode */
    backdrop-filter: blur(16px);
    border-right: 1px solid var(--border);
    box-shadow: var(--shadow-xl); /* strong shadow for slide-in menus */
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease-out;
    overflow: hidden;
}
html.dark .side-menu,
html.dark .profile-menu {
    background: rgba(24, 24, 27, 0.95);
}

.side-menu {
    left: 0;
    transform: translateX(-100%);
    border-right: 1px solid var(--border);
}
.side-menu.open {
    transform: translateX(0);
}

.profile-menu {
    right: 0;
    transform: translateX(100%);
    border-right: none;
    border-left: 1px solid var(--border);
}
.profile-menu.open {
    transform: translateX(0);
}

/* ─── Side menu body — scrollable area ─────────────────────────── */
/* Uses position: absolute to constrain height, making overflow-y work */
.side-menu-body {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.side-menu-header {
    flex-shrink: 0; /* never shrink the header */
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    border-bottom: 1px solid var(--border);
}

.side-menu-nav {
    flex: 1 1 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0 1rem 5rem; /* 5rem bottom padding so last items clear the bottom-nav */
    -webkit-overflow-scrolling: touch;
}

#notifList {
    flex: 1 1 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding-bottom: 5rem; /* 5rem bottom padding so last items clear the bottom-nav */
    -webkit-overflow-scrolling: touch;
}

/* ─── Custom scrollbar ─────────────────────────────────────────── */
.side-menu-nav::-webkit-scrollbar,
#notifList::-webkit-scrollbar {
    width: 6px;
}
.side-menu-nav::-webkit-scrollbar-track,
#notifList::-webkit-scrollbar-track {
    background: transparent;
}
.side-menu-nav::-webkit-scrollbar-thumb,
#notifList::-webkit-scrollbar-thumb {
    background-color: rgba(139, 92, 246, 0.3);
    border-radius: 3px;
}
.side-menu-nav::-webkit-scrollbar-thumb:hover,
#notifList::-webkit-scrollbar-thumb:hover {
    background-color: rgba(139, 92, 246, 0.5);
}
.side-menu-nav {
    scrollbar-width: thin;
    scrollbar-color: rgba(139, 92, 246, 0.3) transparent;
}
#notifList {
    scrollbar-width: thin;
    scrollbar-color: rgba(139, 92, 246, 0.3) transparent;
}
.side-menu-header h2 {
    font-size: 1.125rem;
    font-weight: 700;
}

.side-menu-search {
    padding: 1rem;
    display: flex;
    align-items: center;
    background: var(--muted);
    border-radius: 0.75rem;
    flex-shrink: 0;
    margin: 1rem;
}
.side-menu-search i {
    color: var(--muted-foreground);
    font-size: 0.875rem;
    margin-right: 0.5rem;
}
.side-menu-search input {
    background: transparent;
    border: none;
    outline: none;
    color: var(--foreground);
    font-size: 0.875rem;
    flex: 1;
}

.side-menu-nav {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0 1rem 1rem;
    min-height: 0; /* critical for flex overflow scrolling */
    -webkit-overflow-scrolling: touch; /* smooth scrolling on iOS */
}

#notifList {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0; /* critical for flex overflow scrolling */
    -webkit-overflow-scrolling: touch;
}

.side-menu-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted-foreground);
    margin: 1.25rem 0 0.5rem;
}
.side-menu-nav a,
.nav-item-full {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.75rem;
    border-radius: 0.75rem;
    color: var(--foreground);
    font-size: 0.875rem;
    font-weight: 500;
    transition: background 0.2s;
    border: none;
    background: transparent;
    cursor: pointer;
    width: 100%;
    text-align: left;
}
.side-menu-nav a:hover,
.nav-item-full:hover {
    background: var(--muted);
}
.side-menu-nav a i {
    width: 1.25rem;
    text-align: center;
    color: var(--muted-foreground);
}

.user-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    margin: 0 1rem 1rem;
    flex-shrink: 0;
    background: var(--muted);
    border-radius: 0.75rem;
    cursor: pointer;
    transition: background 0.2s;
}
.user-card:hover {
    background: var(--border);
}

.avatar-sm {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid rgba(56, 189, 248, 0.3);
    flex-shrink: 0;
}
.avatar-sm img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.toggle-switch {
    margin-left: auto;
    width: 2.25rem;
    height: 1.25rem;
    background: var(--muted-foreground);
    border-radius: 9999px;
    position: relative;
    transition: background 0.2s;
}
.toggle-switch::after {
    content: '';
    position: absolute;
    top: 0.125rem;
    left: 0.125rem;
    width: 1rem;
    height: 1rem;
    background: var(--card); /* use CSS variable instead of hardcoded white */
    border-radius: 50%;
    transition: transform 0.2s;
}
html.dark .toggle-switch {
    background: var(--brand-500);
}
html.dark .toggle-switch::after {
    transform: translateX(1rem);
}

.signin-btn-full {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem;
    margin: 1rem 0;
    border: none;
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 0.75rem;
    cursor: pointer;
    width: 100%;
    transition: background 0.2s;
}
.signin-btn-full:hover {
    background: rgba(239, 68, 68, 0.2);
}

/* ─── Bottom Navigation ────────────────────── */

.bottom-nav {
    position: sticky;
    bottom: 0;
    z-index: 50;
    background: #ffffff;  /* solid white in light mode */
    backdrop-filter: blur(16px);
    border-top: 1px solid var(--border);
    box-shadow: 0 -2px 10px rgb(0 0 0 / 0.05); /* shadow above nav */
}
html.dark .bottom-nav {
    background: rgba(24, 24, 27, 0.95);
}

.bottom-nav-inner {
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    padding: 0.375rem 0.25rem;
    max-width: 32rem;
    margin: 0 auto;
}
@media (min-width: 768px) {
    .bottom-nav-inner { padding: 0.5rem 0.25rem; }
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    border: none;
    background: transparent;
    cursor: pointer;
    color: var(--muted-foreground);
    transition: color 0.2s;
}
.nav-item.active {
    color: var(--brand-500);
}
.nav-item i {
    font-size: 1.125rem;
}
.nav-item span {
    font-size: 0.625rem;
    font-weight: 500;
    margin-top: 0.125rem;
}

.nav-item-elevated {
    margin-top: -0.5rem;
    width: 3rem;
    height: 3rem;
    border: none;
    border-radius: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    transition: transform 0.2s;
}
.nav-item-elevated:hover {
    transform: scale(1.05);
}
.nav-item-elevated i {
    font-size: 1.125rem;
}
.nav-item-elevated span {
    font-size: 0.625rem;
    font-weight: 500;
    margin-top: 0.125rem;
}

.nav-icon-wrapper {
    position: relative;
}
.nav-dot {
    position: absolute;
    top: -0.25rem;
    right: -0.375rem;
    width: 0.625rem;
    height: 0.625rem;
    border-radius: 50%;
    border: 2px solid var(--background);
}
.nav-dot-red { background: var(--danger); }
.nav-dot-green { background: var(--success); }

.nav-avatar {
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--muted-foreground);
}
.nav-avatar-active {
    border-color: var(--brand-500);
}
.nav-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ─── 4. Components ────────────────────────── */

/* Glass effect */
.glass {
    background: #ffffff;  /* solid white in light mode (was translucent 0.7) */
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm); /* add depth */
}
html.dark .glass {
    background: rgba(24, 24, 27, 0.7);
}

.glass-strong {
    background: #ffffff;  /* solid white in light mode */
    backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md); /* stronger shadow */
}
html.dark .glass-strong {
    background: rgba(24, 24, 27, 0.95);
}

/* Cards */
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 1rem;
    overflow: hidden;
}

.card-hover {
    transition: transform 0.2s, box-shadow 0.2s;
}
.card-hover:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* Buttons */
.btn-primary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.75rem;
    border: none;
    background: linear-gradient(135deg, var(--brand-500), #8b5cf6);
    color: white;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 0.75rem;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    transition: box-shadow 0.2s, transform 0.1s;
}
.btn-primary:hover {
    box-shadow: 0 0 20px rgba(14, 165, 233, 0.4);
}
.btn-primary:active {
    transform: scale(0.98);
}

.btn-secondary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 1.25rem;
    border: 1px solid var(--border);
    background: var(--card);
    color: var(--foreground);
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-secondary:hover {
    background: var(--muted);
}

/* Inputs */
.form-group {
    margin-bottom: 1rem;
}
.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.375rem;
}
.input-wrapper {
    position: relative;
}
.input-wrapper i {
    position: absolute;
    left: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted-foreground);
    font-size: 0.875rem;
}
.input-wrapper input,
.input-wrapper textarea {
    width: 100%;
    padding: 0.625rem 1rem 0.625rem 2.5rem;
    background: var(--muted);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    color: var(--foreground);
    font-size: 0.875rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.input-wrapper input:focus,
.input-wrapper textarea:focus {
    border-color: var(--brand-500);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}
.modal-overlay.hidden {
    display: none;
}
.modal-content {
    background: var(--card);
    border-radius: 1rem;
    width: 100%;
    max-width: 28rem;
    padding: 1.5rem;
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
    position: relative;
}
.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 2rem;
    height: 2rem;
    border: none;
    background: var(--muted);
    border-radius: 0.5rem;
    font-size: 1.25rem;
    cursor: pointer;
    color: var(--foreground);
}

.auth-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}
.auth-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}
.auth-subtitle {
    font-size: 0.875rem;
    color: var(--muted-foreground);
    margin-bottom: 1.5rem;
}
.auth-form {
    margin-bottom: 1rem;
}
.auth-switch {
    text-align: center;
    font-size: 0.875rem;
    color: var(--muted-foreground);
}
.auth-switch a {
    color: var(--brand-500);
    font-weight: 600;
}

/* Badge pills */
.badge-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

/* ─── 5. Home Feed ─────────────────────────── */

/* Weather widget */
.weather-card {
    border-radius: 1rem;
    overflow: hidden;
    margin: 0.5rem 0;
    background: linear-gradient(135deg, #f59e0b, #f97316);
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: white;
}
.weather-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 0.75rem;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}
.weather-info h3 {
    font-size: 1.125rem;
    font-weight: 600;
}
.weather-info p {
    font-size: 0.875rem;
    opacity: 0.8;
}
.weather-temp {
    text-align: right;
}
.weather-temp .temp {
    font-size: 1.875rem;
    font-weight: 700;
}
.weather-temp .feels {
    font-size: 0.875rem;
    opacity: 0.8;
}

/* Stories row */
.stories-row {
    display: flex;
    gap: 0.75rem;
    padding: 1rem;
    overflow-x: auto;
}
.story-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.375rem;
    flex-shrink: 0;
    cursor: pointer;
}
.story-avatar {
    width: 4rem;
    height: 4rem;
    border-radius: 50%;
    padding: 3px;
    background: linear-gradient(135deg, var(--brand-400), #8b5cf6, #ec4899);
}
.story-avatar.viewed {
    background: var(--muted-foreground);
}
.story-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--background);
}
.story-live {
    position: absolute;
    top: -0.25rem;
    right: -0.25rem;
    background: var(--danger);
    color: white;
    font-size: 0.5rem;
    font-weight: 700;
    padding: 0.125rem 0.375rem;
    border-radius: 9999px;
    animation: pulse 2s infinite;
}
.story-name {
    font-size: 0.625rem;
    color: var(--muted-foreground);
    max-width: 4rem;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Post card */
.post-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 1rem;
    overflow: hidden;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-sm); /* add depth to posts */
}
.post-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    padding-bottom: 0.5rem;
}
.post-author {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.post-author img {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    object-fit: cover;
}
.post-author-name {
    font-size: 0.875rem;
    font-weight: 600;
}
.post-meta {
    font-size: 0.75rem;
    color: var(--muted-foreground);
    display: flex;
    align-items: center;
    gap: 0.375rem;
}
.post-content {
    padding: 0 1rem 0.5rem;
    font-size: 0.875rem;
    line-height: 1.6;
}
.post-media {
    padding: 0 1rem 0.5rem;
}
.post-media img {
    width: 100%;
    max-height: 24rem;
    object-fit: cover;
    border-radius: 0.75rem;
}
.post-tags {
    padding: 0 1rem 0.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}
.post-tags a {
    font-size: 0.75rem;
    color: var(--brand-500);
}
.post-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 1rem;
}
.post-actions-left {
    display: flex;
    gap: 1.25rem;
}
.post-action {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--muted-foreground);
    font-size: 0.875rem;
    transition: color 0.2s;
}
.post-action:hover {
    color: var(--brand-500);
}
.post-action.liked {
    color: var(--danger);
}
.post-action.liked i {
    font-weight: 900;
}

/* ─── 6. Shorts ────────────────────────────── */

.shorts-container {
    height: calc(100vh - 130px);
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
}
.short-item {
    height: 100%;
    scroll-snap-align: start;
    position: relative;
    background: #000;
    border-radius: 1rem;
    overflow: hidden;
}
.short-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.short-overlay-top {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    z-index: 10;
}
.short-overlay-bottom {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 4.5rem;
    padding: 1rem;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    color: white;
}
.short-actions {
    position: absolute;
    right: 0.5rem;
    bottom: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    z-index: 10;
}
.short-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    background: transparent;
    border: none;
    cursor: pointer;
    color: white;
}
.short-action-btn .circle {
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
}
.short-action-btn span {
    font-size: 0.75rem;
    font-weight: 600;
}

/* ─── 7. Profile Page ──────────────────────── */

.profile-cover {
    position: relative;
    height: 14rem;
    overflow: hidden;
}
.profile-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.profile-cover-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.3));
}

.profile-avatar-section {
    display: flex;
    align-items: flex-end;
    gap: 1rem;
    padding: 0 1rem;
    margin-top: -3.5rem;
    position: relative;
    z-index: 10;
}
.profile-avatar {
    width: 7rem;
    height: 7rem;
    border-radius: 50%;
    border: 4px solid var(--background);
    overflow: hidden;
    background: linear-gradient(135deg, var(--brand-400), #8b5cf6);
}
.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-info {
    padding: 0.75rem 1rem 0;
}
.profile-name {
    font-size: 1.25rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.profile-username {
    font-size: 0.875rem;
    color: var(--muted-foreground);
}
.profile-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0.5rem 0;
}
.profile-bio {
    font-size: 0.875rem;
    line-height: 1.6;
    margin: 0.5rem 0;
    white-space: pre-line;
}
.profile-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.875rem;
    color: var(--muted-foreground);
    margin: 0.75rem 0;
}
.profile-meta span {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.profile-actions {
    display: flex;
    gap: 0.5rem;
    margin: 1rem 0;
}
.profile-actions .btn-primary {
    flex: 1;
}

.profile-stats {
    display: flex;
    gap: 1.5rem;
    padding: 0.75rem 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    margin: 1rem 0;
}
.profile-stat {
    text-align: center;
    background: transparent;
    border: none;
    cursor: pointer;
}
.profile-stat .num {
    font-size: 1.125rem;
    font-weight: 700;
}
.profile-stat .label {
    font-size: 0.75rem;
    color: var(--muted-foreground);
}

.profile-tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1rem;
    overflow-x: auto;
}
.profile-tab {
    flex: 1;
    padding: 0.75rem;
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--muted-foreground);
    font-size: 0.875rem;
    font-weight: 500;
    text-align: center;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    transition: color 0.2s, border-color 0.2s;
}
.profile-tab.active {
    color: var(--brand-500);
    border-bottom-color: var(--brand-500);
}

/* ─── 8. Marketplace ───────────────────────── */

.listing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
}
.listing-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 1rem;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}
.listing-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}
.listing-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}
.listing-body {
    padding: 1rem;
}
.listing-title {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}
.listing-location {
    font-size: 0.75rem;
    color: var(--muted-foreground);
    margin-bottom: 0.5rem;
}
.listing-price {
    font-size: 1rem;
    font-weight: 700;
}
.listing-rating {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
}

/* ─── 9. Animations ────────────────────────── */

@keyframes fade-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
.animate-fade-in {
    animation: fade-in 0.3s ease-out;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes heart-beat {
    0%, 100% { transform: scale(1); }
    25% { transform: scale(1.3); }
    50% { transform: scale(1); }
}
.heart-animate {
    animation: heart-beat 0.3s ease-out;
}

@keyframes spin-slow {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes marquee {
    0% { transform: translateX(0); }
    100% { transform: translateX(-100%); }
}

/* ─── Post Menu Dropdown ───────────────────── */

.post-menu-dropdown {
    position: absolute;
    right: 0;
    top: 2.75rem;
    z-index: 30;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    min-width: 200px;
    padding: 0.375rem;
    animation: fade-in 0.15s ease-out;
}

.post-menu-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.625rem 0.75rem;
    background: transparent;
    border: none;
    color: var(--foreground);
    font-size: 0.8125rem;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    border-radius: 0.5rem;
    transition: background 0.15s;
}

.post-menu-item:hover {
    background: var(--muted);
}

.post-menu-item i {
    width: 1rem;
    text-align: center;
    color: var(--muted-foreground);
    font-size: 0.875rem;
}

.post-menu-item.post-menu-danger {
    color: var(--danger);
}

.post-menu-item.post-menu-danger i {
    color: var(--danger);
}

.post-menu-item.post-menu-danger:hover {
    background: rgba(239, 68, 68, 0.1);
}

.post-menu-divider {
    height: 1px;
    background: var(--border);
    margin: 0.375rem 0;
}

/* Toast notification */
.toast {
    position: fixed;
    bottom: 6rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 200;
    padding: 0.75rem 1.5rem;
    border-radius: 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    animation: fade-in 0.3s ease-out;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: white;
    background: var(--foreground);
}

.toast-success { background: var(--success); }
.toast-error { background: var(--danger); }
.toast-info { background: var(--brand-500); }

/* ─── 10. Responsive ───────────────────────── */

/* FAB (Floating Action Button) */
.fab {
    position: fixed;
    bottom: 5.5rem;
    right: 1.5rem;
    z-index: 30;
    width: 3.5rem;
    height: 3.5rem;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--brand-500), var(--accent-500));
    color: white;
    font-size: 1.25rem;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, box-shadow 0.2s;
}
.fab:hover {
    transform: scale(1.05);
    box-shadow: 0 0 25px rgba(14, 165, 233, 0.4);
}
.fab:active {
    transform: scale(0.95);
}

/* Flash messages */
.flash-message {
    position: fixed;
    top: 5rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    padding: 0.75rem 1.5rem;
    border-radius: 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    animation: fade-in 0.3s ease-out;
}
.flash-success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    color: var(--success);
}
.flash-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: var(--danger);
}

@media (max-width: 640px) {
    .main-content {
        padding: 0;
    }
    .profile-avatar-section {
        margin-top: -2.5rem;
    }
    .profile-avatar {
        width: 5.5rem;
        height: 5.5rem;
    }
}

@media (min-width: 768px) {
    .hidden { display: none !important; }
    .md\:hidden { display: none !important; }
}
@media (max-width: 767px) {
    .md\:hidden { display: flex !important; }
    .sm\:inline { display: none !important; }
}

/* Utility classes */
.text-center { text-align: center; }
.text-muted { color: var(--muted-foreground); }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.flex { display: flex; }
.flex-1 { flex: 1; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.w-full { width: 100%; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.p-4 { padding: 1rem; }
.rounded-xl { border-radius: 0.75rem; }
.rounded-full { border-radius: 9999px; }
.overflow-hidden { overflow: hidden; }
.relative { position: relative; }
.absolute { position: absolute; }
.cursor-pointer { cursor: pointer; }
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ════════════════════════════════════════════════════════════════════
   GLOBAL RESPONSIVE DESIGN (for pages without their own @media queries)
   ════════════════════════════════════════════════════════════════════ */

/* ─── Mobile (max-width: 767px) ─────────────────────────────────── */
@media (max-width: 767px) {
    /* Make all grids responsive */
    .listing-grid,
    .stats-grid,
    .form-grid,
    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr !important;
    }

    /* Forms: full width inputs */
    .stay-grid,
    .form-row,
    .time-grid {
        grid-template-columns: 1fr !important;
    }

    /* Flex layouts: stack vertically */
    .form-actions,
    .stay-buttons,
    .action-bar,
    .flex-row {
        flex-direction: column !important;
        gap: 0.5rem !important;
    }

    /* Reduce padding on mobile */
    .main-content {
        padding: 8px 8px !important;
    }

    /* Tables: make scrollable */
    .admin-table-wrap,
    table {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Admin table: hide less important columns on mobile */
    .admin-table th:nth-child(3),
    .admin-table td:nth-child(3),
    .admin-table th:nth-child(5),
    .admin-table td:nth-child(5) {
        display: none;
    }

    /* Modals: full screen on mobile */
    .modal-content,
    .modal-overlay > div {
        width: 95% !important;
        max-width: 95% !important;
        margin: 1rem auto !important;
        padding: 1rem !important;
    }

    /* Headings: smaller on mobile */
    h1 { font-size: 1.25rem !important; }
    h2 { font-size: 1.125rem !important; }
    h3 { font-size: 1rem !important; }

    /* Inputs: full width */
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="number"],
    input[type="tel"],
    input[type="url"],
    textarea,
    select {
        width: 100% !important;
        max-width: 100% !important;
    }

    /* Buttons: full width on mobile */
    .btn-primary,
    .btn-secondary,
    .stay-btn,
    button[type="submit"] {
        width: 100% !important;
        justify-content: center !important;
    }

    /* Profile page: stack sections */
    .profile-header,
    .profile-stats {
        flex-direction: column !important;
        text-align: center !important;
    }

    /* Edit profile: stack form sections */
    .edit-profile-section {
        padding: 1rem !important;
    }

    /* AI assistant: full width chat */
    .chat-container,
    .ai-chat-window {
        width: 100% !important;
        max-width: 100% !important;
    }

    /* Wallet: stack cards */
    .wallet-card,
    .wallet-transactions {
        padding: 1rem !important;
    }

    /* Login/Register: centered card */
    .auth-form {
        max-width: 100% !important;
        padding: 1.5rem 1rem !important;
    }

    /* Shorts: full width */
    .shorts-container {
        max-width: 100% !important;
        border-radius: 0 !important;
    }

    /* Story viewer: full width */
    .story-viewer {
        width: 100% !important;
        max-width: 100% !important;
    }

    /* Edit listing: stack sections */
    .edit-listing-section,
    .glass {
        padding: 1rem !important;
    }

    /* Images: responsive */
    img {
        max-width: 100%;
        height: auto;
    }
}

/* ─── Tablet (768px - 1023px) ───────────────────────────────────── */
@media (min-width: 768px) and (max-width: 1023px) {
    .listing-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    .stats-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

/* ─── Desktop (min-width: 1024px) ───────────────────────────────── */
@media (min-width: 1024px) {
    .listing-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }
    .stats-grid {
        grid-template-columns: repeat(4, 1fr) !important;
    }
}
