/* ============================================================
   main.css - ThueTroHanoi Design System
   Premium Dark Theme with Glassmorphism & Micro-animations
   ============================================================ */

/* ==================== GOOGLE FONTS ==================== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Outfit:wght@300;400;500;600;700;800&display=swap');

/* ==================== CSS VARIABLES ==================== */
:root {
  /* Brand Colors */
  --primary: #f97316;
  --primary-dark: #ea580c;
  --primary-light: #fed7aa;
  --primary-glow: rgba(249, 115, 22, 0.25);

  /* Secondary */
  --secondary: #6366f1;
  --secondary-dark: #4f46e5;
  --secondary-light: #c7d2fe;

  /* Neutrals */
  --bg-primary: #0a0a0f;
  --bg-secondary: #111118;
  --bg-card: #16161f;
  --bg-card-hover: #1e1e2a;
  --bg-glass: rgba(22, 22, 31, 0.7);
  --bg-glass-light: rgba(255, 255, 255, 0.05);

  /* Surface */
  --surface-1: #1a1a24;
  --surface-2: #222231;
  --surface-3: #2a2a3d;

  /* Text */
  --text-primary: #f1f1f5;
  --text-secondary: #a0a0b5;
  --text-muted: #6b6b80;
  --text-disabled: #3d3d50;

  /* Status */
  --success: #22c55e;
  --success-bg: rgba(34, 197, 94, 0.1);
  --warning: #eab308;
  --warning-bg: rgba(234, 179, 8, 0.1);
  --danger: #ef4444;
  --danger-bg: rgba(239, 68, 68, 0.1);
  --info: #3b82f6;
  --info-bg: rgba(59, 130, 246, 0.1);

  /* Borders */
  --border: rgba(255, 255, 255, 0.06);
  --border-active: rgba(249, 115, 22, 0.5);
  --border-hover: rgba(255, 255, 255, 0.12);

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 30px rgba(249, 115, 22, 0.2);
  --shadow-glow-hover: 0 0 50px rgba(249, 115, 22, 0.35);

  /* Gradients */
  --gradient-primary: linear-gradient(135deg, #f97316, #ea580c);
  --gradient-hero: linear-gradient(135deg, #0a0a0f 0%, #111118 50%, #16161f 100%);
  --gradient-card: linear-gradient(135deg, rgba(249, 115, 22, 0.05), rgba(99, 102, 241, 0.05));
  --gradient-text: linear-gradient(135deg, #f97316, #f59e0b);

  /* Typography */
  --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-heading: 'Outfit', 'Inter', sans-serif;

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;

  /* Border Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);

  /* Z-index Scale */
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-overlay: 300;
  --z-modal: 400;
  --z-toast: 500;
  --z-ticker: 1000;
}

/* ==================== LINE ICON SYSTEM ==================== */
.line-icon {
  display: inline-block;
  vertical-align: -0.15em;
  stroke: currentColor;
  fill: none;
  flex-shrink: 0;
  transition: transform var(--transition-fast), stroke var(--transition-fast);
}

/* ==================== SOFT TINTED ICON BOXES (LIKE SCREENSHOT) ==================== */
.icon-box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(59, 130, 246, 0.14);
  color: #3b82f6;
  border: 1px solid rgba(59, 130, 246, 0.2);
  flex-shrink: 0;
  transition: transform var(--transition-fast), background var(--transition-fast);
}

.icon-box-sm { width: 34px; height: 34px; border-radius: 9px; }
.icon-box-lg { width: 54px; height: 54px; border-radius: 16px; }

/* Color Themes */
.icon-box-blue { background: rgba(59, 130, 246, 0.14); color: #3b82f6; border: 1px solid rgba(59, 130, 246, 0.25); }
.icon-box-purple { background: rgba(168, 85, 247, 0.14); color: #a855f7; border: 1px solid rgba(168, 85, 247, 0.25); }
.icon-box-cyan { background: rgba(6, 182, 212, 0.14); color: #06b6d4; border: 1px solid rgba(6, 182, 212, 0.25); }
.icon-box-orange { background: rgba(249, 115, 22, 0.14); color: #f97316; border: 1px solid rgba(249, 115, 22, 0.25); }
.icon-box-green { background: rgba(34, 197, 94, 0.14); color: #22c55e; border: 1px solid rgba(34, 197, 94, 0.25); }
.icon-box-rose { background: rgba(244, 63, 94, 0.14); color: #f43f5e; border: 1px solid rgba(244, 63, 94, 0.25); }
.icon-box-amber { background: rgba(245, 158, 11, 0.14); color: #f59e0b; border: 1px solid rgba(245, 158, 11, 0.25); }

/* ==================== PAGINATION SYSTEM ==================== */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: var(--space-2xl);
  flex-wrap: wrap;
}

.page-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 0.75rem;
  border-radius: var(--radius-md);
  background: var(--surface-1);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  user-select: none;
}

.page-item:hover:not(.disabled):not(.active) {
  background: var(--surface-2);
  border-color: var(--primary-glow);
  color: var(--primary);
  transform: translateY(-1px);
}

.page-item.active {
  background: var(--gradient-primary);
  border-color: transparent;
  color: white;
  box-shadow: var(--shadow-glow);
}

.page-item.disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.page-item-dots {
  border: none;
  background: none;
  cursor: default;
  color: var(--text-muted);
}

/* ==================== RESET & BASE ==================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-primary);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ==================== TYPOGRAPHY ==================== */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.25rem); }
h3 { font-size: clamp(1.25rem, 2vw, 1.75rem); }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.1rem; }
h6 { font-size: 1rem; }

p { margin-bottom: 1em; }
p:last-child { margin-bottom: 0; }

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}
a:hover { color: var(--primary-dark); }

/* ==================== SCROLLBAR ==================== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb {
  background: var(--surface-3);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* ==================== TICKER/MARQUEE ==================== */
.system-ticker {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-ticker);
  background: linear-gradient(90deg, var(--primary-dark), var(--primary), #f59e0b, var(--primary));
  background-size: 300% 100%;
  animation: tickerBg 5s linear infinite;
  height: 36px;
  display: flex;
  align-items: center;
  overflow: hidden;
}

@keyframes tickerBg {
  0% { background-position: 0% 50%; }
  100% { background-position: 100% 50%; }
}

.ticker-content {
  display: flex;
  align-items: center;
  white-space: nowrap;
  animation: tickerScroll 30s linear infinite;
  gap: 4rem;
}

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

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

.ticker-item {
  font-size: 0.8rem;
  font-weight: 600;
  color: #fff;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.ticker-icon { font-size: 0.9rem; }
.ticker-separator {
  color: rgba(255,255,255,0.5);
  font-size: 1.2rem;
}

/* ==================== NAVBAR ==================== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-sticky);
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  transition: all var(--transition-base);
}

body.has-ticker .navbar {
  top: 36px;
}

.navbar.scrolled {
  background: rgba(10, 10, 15, 0.95);
  box-shadow: var(--shadow-lg);
}

.navbar-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-lg);
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  flex-shrink: 0;
}

.navbar-logo {
  width: 36px;
  height: 36px;
  background: var(--gradient-primary);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  box-shadow: var(--shadow-glow);
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.navbar-brand:hover .navbar-logo {
  transform: rotate(-5deg) scale(1.1);
  box-shadow: var(--shadow-glow-hover);
}

.navbar-brand-text {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 800;
  background: var(--gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.03em;
}

.navbar-search {
  flex: 1;
  max-width: 360px;
  position: relative;
}

.navbar-search input {
  width: 100%;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 0.5rem 1rem 0.5rem 2.5rem;
  color: var(--text-primary);
  font-size: 0.875rem;
  transition: all var(--transition-base);
  outline: none;
}

.navbar-search input:focus {
  border-color: var(--border-active);
  background: var(--surface-2);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.navbar-search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 1rem;
  pointer-events: none;
}

.navbar-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
}

.navbar-nav a {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
  text-decoration: none;
}

.navbar-nav a:hover {
  color: var(--text-primary);
  background: var(--bg-glass-light);
}

.navbar-nav a.active {
  color: var(--primary);
  background: var(--primary-glow);
}

.navbar-actions {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-shrink: 0;
}

/* User Avatar in Navbar */
.navbar-avatar {
  position: relative;
  cursor: pointer;
}

.navbar-avatar img,
.navbar-avatar .avatar-placeholder {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  object-fit: cover;
  border: 2px solid var(--border);
  transition: border-color var(--transition-fast);
}

.navbar-avatar:hover img,
.navbar-avatar:hover .avatar-placeholder {
  border-color: var(--primary);
}

.avatar-placeholder {
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.875rem;
  color: white;
}

/* Dropdown Menu */
.dropdown {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  min-width: 200px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: var(--space-sm);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all var(--transition-base);
  z-index: var(--z-dropdown);
}

.navbar-avatar:hover .dropdown,
.dropdown.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
}

.dropdown-item:hover {
  background: var(--bg-glass-light);
  color: var(--text-primary);
}

.dropdown-item.danger:hover {
  background: var(--danger-bg);
  color: var(--danger);
}

.dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: var(--space-xs) 0;
}

/* Mobile Menu Toggle */
.menu-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.4rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.menu-toggle:hover {
  border-color: var(--border-hover);
  color: var(--text-primary);
}

/* ==================== BUTTONS ==================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius-md);
  font-family: var(--font-primary);
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: all var(--transition-base);
  border: none;
  outline: none;
  text-decoration: none;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.1);
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.btn:hover::after { opacity: 1; }
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--gradient-primary);
  color: white;
  box-shadow: 0 4px 15px var(--primary-glow);
}

.btn-primary:hover {
  box-shadow: var(--shadow-glow-hover);
  transform: translateY(-1px);
  color: white;
}

.btn-secondary {
  background: var(--surface-2);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--surface-3);
  color: var(--text-primary);
  border-color: var(--border-hover);
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--primary);
}

.btn-outline:hover {
  background: var(--primary-glow);
  color: var(--primary);
}

.btn-danger {
  background: var(--danger);
  color: white;
}

.btn-danger:hover {
  background: #dc2626;
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}
.btn-ghost:hover {
  background: var(--bg-glass-light);
  color: var(--text-primary);
}

.btn-sm { padding: 0.4rem 0.875rem; font-size: 0.8rem; }
.btn-lg { padding: 0.875rem 1.75rem; font-size: 1rem; }
.btn-xl { padding: 1rem 2rem; font-size: 1.1rem; }
.btn-full { width: 100%; }
.btn-icon { padding: 0.6rem; border-radius: var(--radius-md); }
.btn-icon.btn-sm { padding: 0.4rem; }

.btn-google {
  background: #fff;
  color: #333;
  border: 1px solid #e0e0e0;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

.btn-google:hover {
  background: #f8f8f8;
  box-shadow: var(--shadow-md);
  color: #111;
}

.btn-google img {
  width: 18px;
  height: 18px;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

/* Loading spinner in button */
.btn .spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* ==================== FORM ELEMENTS ==================== */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: var(--space-md);
}

.form-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.form-label .required { color: var(--danger); }

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.7rem 1rem;
  color: var(--text-primary);
  font-family: var(--font-primary);
  font-size: 0.9rem;
  transition: all var(--transition-base);
  outline: none;
  appearance: none;
}

.form-input:hover,
.form-select:hover,
.form-textarea:hover {
  border-color: var(--border-hover);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--primary);
  background: var(--surface-2);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--text-muted);
}

.form-textarea {
  resize: vertical;
  min-height: 120px;
}

.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23a0a0b5' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
  cursor: pointer;
}

.form-input-group {
  position: relative;
}

.form-input-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 1rem;
  pointer-events: none;
  z-index: 1;
}

.form-input-group .form-input { padding-left: 2.75rem; }

.form-input-addon {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.85rem;
  cursor: pointer;
  transition: color var(--transition-fast);
}

.form-input-addon:hover { color: var(--text-primary); }

.form-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.form-error {
  font-size: 0.78rem;
  color: var(--danger);
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.form-input.error,
.form-textarea.error {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* Checkbox & Radio */
.form-check {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  cursor: pointer;
}

.form-check input[type="checkbox"],
.form-check input[type="radio"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--primary);
}

/* ==================== CARDS ==================== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition-base);
}

.card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.card-body {
  padding: var(--space-lg);
}

.card-header {
  padding: var(--space-lg);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
}

.card-footer {
  padding: var(--space-md) var(--space-lg);
  border-top: 1px solid var(--border);
  background: var(--surface-1);
}

/* Post Card */
.post-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  transition: all var(--transition-slow);
  cursor: pointer;
  position: relative;
}

.post-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--gradient-card);
  opacity: 0;
  transition: opacity var(--transition-base);
  z-index: 0;
  pointer-events: none;
}

.post-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-glow);
  border-color: var(--border-active);
}

.post-card:hover::before { opacity: 1; }

.post-card-image {
  position: relative;
  aspect-ratio: 4/3;
  overflow: hidden;
}

.post-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.post-card:hover .post-card-image img { transform: scale(1.08); }

.post-card-badge {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  backdrop-filter: blur(8px);
}

.badge-ccmn { background: rgba(99, 102, 241, 0.85); color: white; }
.badge-phongtro { background: rgba(249, 115, 22, 0.85); color: white; }
.badge-canho { background: rgba(34, 197, 94, 0.85); color: white; }

.post-card-favorite {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 32px;
  height: 32px;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(8px);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  border: none;
  z-index: 2;
}

.post-card-favorite:hover { background: var(--danger); transform: scale(1.1); }

.post-card-body {
  padding: var(--space-md) var(--space-lg);
  position: relative;
  z-index: 1;
}

.post-card-price {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 800;
  background: var(--gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.3rem;
}

.post-card-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.4rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
}

.post-card-address {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.3rem;
  margin-bottom: var(--space-md);
}

.post-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-sm) var(--space-lg) var(--space-md);
  border-top: 1px solid var(--border);
  position: relative;
  z-index: 1;
}

.post-card-author {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.post-card-author img,
.post-card-author .author-avatar {
  width: 26px;
  height: 26px;
  border-radius: var(--radius-full);
  object-fit: cover;
}

.post-card-author .author-avatar {
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: white;
}

.post-card-author-name {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.post-card-time {
  font-size: 0.75rem;
  color: var(--text-disabled);
}

/* ==================== GRID & LAYOUT ==================== */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.container-sm {
  max-width: 640px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.container-md {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.grid {
  display: grid;
  gap: var(--space-lg);
}

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

.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--space-xl);
}

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }
.wrap { flex-wrap: wrap; }

/* Page Layout */
.page-wrapper {
  padding-top: calc(36px + 64px); /* ticker + navbar */
  min-height: 100vh;
}

.section {
  padding: var(--space-3xl) 0;
}

.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: var(--space-2xl);
  gap: var(--space-lg);
}

.section-title {
  font-family: var(--font-heading);
  font-size: clamp(1.4rem, 3vw, 1.875rem);
  font-weight: 800;
  color: var(--text-primary);
  position: relative;
}

.section-title span {
  background: var(--gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.section-subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
}

/* ==================== BADGE / TAG ==================== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-primary { background: var(--primary-glow); color: var(--primary); }
.badge-neutral { background: var(--surface-2); color: var(--text-secondary); }

/* Role badges */
.role-admin { background: linear-gradient(135deg, rgba(239,68,68,0.15), rgba(239,68,68,0.05)); color: #ef4444; border: 1px solid rgba(239,68,68,0.3); }
.role-seller { background: linear-gradient(135deg, rgba(99,102,241,0.15), rgba(99,102,241,0.05)); color: #818cf8; border: 1px solid rgba(99,102,241,0.3); }
.role-landlord { background: linear-gradient(135deg, rgba(34,197,94,0.15), rgba(34,197,94,0.05)); color: #22c55e; border: 1px solid rgba(34,197,94,0.3); }
.role-user { background: var(--surface-2); color: var(--text-muted); border: 1px solid var(--border); }

/* ==================== MODAL ==================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-base);
}

.modal-overlay.show {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  transform: scale(0.95) translateY(16px);
  transition: transform var(--transition-base);
}

.modal-overlay.show .modal {
  transform: scale(1) translateY(0);
}

.modal-header {
  padding: var(--space-lg) var(--space-xl);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 700;
}

.modal-close {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.35rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  font-size: 1rem;
}

.modal-close:hover {
  border-color: var(--border-hover);
  color: var(--text-primary);
  background: var(--surface-1);
}

.modal-body {
  padding: var(--space-xl);
}

.modal-footer {
  padding: var(--space-md) var(--space-xl);
  border-top: 1px solid var(--border);
  display: flex;
  gap: var(--space-sm);
  justify-content: flex-end;
}

/* ==================== TABS ==================== */
.tabs {
  display: flex;
  gap: 0.25rem;
  background: var(--surface-1);
  border-radius: var(--radius-lg);
  padding: 0.3rem;
  overflow-x: auto;
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar { display: none; }

.tab-btn {
  flex-shrink: 0;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
}

.tab-btn:hover { color: var(--text-primary); background: var(--bg-glass-light); }
.tab-btn.active {
  background: var(--bg-card);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.tab-count {
  background: var(--surface-3);
  color: var(--text-muted);
  font-size: 0.7rem;
  padding: 0.1rem 0.4rem;
  border-radius: var(--radius-full);
  min-width: 20px;
  text-align: center;
}

.tab-btn.active .tab-count {
  background: var(--primary-glow);
  color: var(--primary);
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ==================== TABLE ==================== */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

thead {
  background: var(--surface-1);
}

th {
  padding: 0.875rem 1rem;
  text-align: left;
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
}

td {
  padding: 0.875rem 1rem;
  color: var(--text-secondary);
  border-top: 1px solid var(--border);
}

tr:hover td { background: var(--bg-glass-light); color: var(--text-primary); }

/* ==================== TOAST NOTIFICATIONS ==================== */
#toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 360px;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  animation: slideInRight 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  border-left: 3px solid var(--primary);
}

.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--warning); }

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.toast-icon { font-size: 1.2rem; flex-shrink: 0; }
.toast-content { flex: 1; }
.toast-title { font-weight: 600; font-size: 0.875rem; color: var(--text-primary); }
.toast-message { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.15rem; }

/* ==================== LOADING / SKELETON ==================== */
.skeleton {
  background: linear-gradient(90deg, var(--surface-1), var(--surface-2), var(--surface-1));
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-md);
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.skeleton-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
}

.skeleton-image { height: 220px; }
.skeleton-text { height: 14px; margin: 6px 0; }
.skeleton-text.w-60 { width: 60%; }
.skeleton-text.w-40 { width: 40%; }
.skeleton-text.w-80 { width: 80%; }

/* Page Loader */
.page-loader {
  position: fixed;
  inset: 0;
  background: var(--bg-primary);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.loader-logo {
  width: 64px;
  height: 64px;
  background: var(--gradient-primary);
  border-radius: var(--radius-xl);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  animation: logoPulse 1.5s ease-in-out infinite;
  box-shadow: var(--shadow-glow);
}

@keyframes logoPulse {
  0%, 100% { transform: scale(1); box-shadow: var(--shadow-glow); }
  50% { transform: scale(1.05); box-shadow: var(--shadow-glow-hover); }
}

.loader-bar {
  width: 200px;
  height: 3px;
  background: var(--surface-2);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.loader-bar-fill {
  height: 100%;
  background: var(--gradient-primary);
  border-radius: var(--radius-full);
  animation: loaderFill 1.5s ease-in-out infinite;
}

@keyframes loaderFill {
  0% { width: 0%; transform: translateX(0); }
  50% { width: 100%; transform: translateX(0); }
  100% { width: 100%; transform: translateX(100%); }
}

/* Spinner */
.spinner {
  display: inline-block;
  width: 24px;
  height: 24px;
  border: 3px solid rgba(249, 115, 22, 0.2);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ==================== EMPTY STATE ==================== */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: var(--space-3xl);
  text-align: center;
}

.empty-icon {
  font-size: 3.5rem;
  opacity: 0.4;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.empty-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.empty-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  max-width: 320px;
  line-height: 1.6;
}

/* ==================== AVATAR ==================== */
.avatar {
  border-radius: var(--radius-full);
  object-fit: cover;
  flex-shrink: 0;
}

.avatar-sm { width: 32px; height: 32px; }
.avatar-md { width: 48px; height: 48px; }
.avatar-lg { width: 80px; height: 80px; }
.avatar-xl { width: 120px; height: 120px; }

.avatar-placeholder {
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  border-radius: var(--radius-full);
  flex-shrink: 0;
}

/* ==================== IMAGE UPLOAD ==================== */
.upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-2xl) var(--space-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  transition: all var(--transition-base);
  background: var(--surface-1);
  text-align: center;
}

.upload-area:hover,
.upload-area.dragover {
  border-color: var(--primary);
  background: var(--primary-glow);
}

.upload-icon { font-size: 2.5rem; opacity: 0.6; }
.upload-title { font-weight: 600; color: var(--text-secondary); }
.upload-subtitle { font-size: 0.8rem; color: var(--text-muted); }

.image-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.image-preview-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border);
}

.image-preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-preview-remove {
  position: absolute;
  top: 0.25rem;
  right: 0.25rem;
  background: rgba(0,0,0,0.7);
  color: white;
  border: none;
  border-radius: var(--radius-full);
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.image-preview-remove:hover { background: var(--danger); }

/* ==================== SEARCH FILTER ==================== */
.search-bar {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 0.5rem;
  box-shadow: var(--shadow-md);
}

.search-filter-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.75rem;
  border-right: 1px solid var(--border);
  min-width: 160px;
}

.search-filter-group:last-of-type { border-right: none; }

.search-filter-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}

.search-filter-group select,
.search-filter-group input {
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 0.875rem;
  font-family: var(--font-primary);
  width: 100%;
  cursor: pointer;
}

.search-filter-group input::placeholder { color: var(--text-muted); }

/* ==================== PRICE RANGE ==================== */
.price-range {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.price-range input {
  width: 100px;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.35rem 0.6rem;
  color: var(--text-primary);
  font-size: 0.8rem;
  outline: none;
  transition: border-color var(--transition-fast);
}

.price-range input:focus { border-color: var(--primary); }
.price-range-sep { color: var(--text-muted); font-size: 0.8rem; }

/* ==================== DETAIL PAGE ==================== */
.image-gallery {
  border-radius: var(--radius-xl);
  overflow: hidden;
  display: grid;
  gap: 4px;
}

.gallery-main {
  aspect-ratio: 16/9;
  position: relative;
  overflow: hidden;
}

.gallery-main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
  cursor: pointer;
}

.gallery-main:hover img { transform: scale(1.02); }

.gallery-thumbnails {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
}

.gallery-thumb {
  aspect-ratio: 16/9;
  overflow: hidden;
  cursor: pointer;
  position: relative;
}

.gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: all var(--transition-base);
}

.gallery-thumb:hover img { transform: scale(1.05); opacity: 0.85; }

.gallery-thumb.more-overlay::after {
  content: attr(data-count);
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
  color: white;
}

/* Info Grid */
.info-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.info-item {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.info-item-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.info-item-value {
  font-weight: 700;
  color: var(--text-primary);
  font-size: 1rem;
}

.info-item-value.highlight {
  background: var(--gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-size: 1.2rem;
}

/* ==================== CHAT WIDGET ==================== */
.chat-fab {
  position: fixed;
  bottom: 1.5rem;
  left: 1.5rem;
  z-index: var(--z-overlay);
  width: 52px;
  height: 52px;
  background: var(--gradient-primary);
  border-radius: var(--radius-full);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  box-shadow: var(--shadow-glow);
  transition: all var(--transition-base);
}

.chat-fab:hover {
  transform: scale(1.1);
  box-shadow: var(--shadow-glow-hover);
}

.chat-fab .badge-dot {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 12px;
  height: 12px;
  background: var(--success);
  border-radius: var(--radius-full);
  border: 2px solid var(--bg-primary);
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.3); }
}

.chat-panel {
  position: fixed;
  bottom: calc(1.5rem + 64px);
  left: 1.5rem;
  width: 320px;
  height: 480px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  z-index: var(--z-overlay);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.9) translateY(20px);
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-base);
  transform-origin: bottom left;
}

.chat-panel.open {
  transform: scale(1) translateY(0);
  opacity: 1;
  visibility: visible;
}

.chat-header {
  padding: 1rem 1.25rem;
  background: var(--surface-1);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chat-title {
  font-weight: 700;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.online-dot {
  width: 8px;
  height: 8px;
  background: var(--success);
  border-radius: 50%;
  animation: pulse-dot 2s infinite;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  scroll-behavior: smooth;
}

.message-bubble {
  max-width: 80%;
  padding: 0.6rem 0.875rem;
  border-radius: var(--radius-lg);
  font-size: 0.85rem;
  line-height: 1.5;
  word-break: break-word;
}

.message-bubble.sent {
  align-self: flex-end;
  background: var(--gradient-primary);
  color: white;
  border-bottom-right-radius: var(--radius-sm);
}

.message-bubble.received {
  align-self: flex-start;
  background: var(--surface-2);
  color: var(--text-primary);
  border-bottom-left-radius: var(--radius-sm);
}

.message-meta {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.7rem;
  color: var(--text-disabled);
  margin-top: 0.2rem;
}

.message-meta.right { justify-content: flex-end; }

.chat-input-area {
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 0.5rem;
  align-items: flex-end;
}

.chat-input {
  flex: 1;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 0.6rem 0.875rem;
  color: var(--text-primary);
  font-size: 0.875rem;
  outline: none;
  resize: none;
  max-height: 80px;
  font-family: var(--font-primary);
  transition: border-color var(--transition-fast);
}

.chat-input:focus { border-color: var(--primary); }
.chat-input::placeholder { color: var(--text-muted); }

.chat-send-btn {
  width: 36px;
  height: 36px;
  background: var(--gradient-primary);
  border: none;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: white;
  font-size: 1rem;
  flex-shrink: 0;
  transition: all var(--transition-fast);
  align-self: flex-end;
}

.chat-send-btn:hover {
  transform: scale(1.1);
  box-shadow: var(--shadow-glow);
}

.chat-tabs {
  display: flex;
  background: var(--surface-1);
  border-bottom: 1px solid var(--border);
}

.chat-tab {
  flex: 1;
  padding: 0.5rem;
  text-align: center;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border: none;
  background: none;
  border-bottom: 2px solid transparent;
  transition: all var(--transition-fast);
}

.chat-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* ==================== FOOTER ==================== */
footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  padding: var(--space-2xl) 0 var(--space-lg);
  margin-top: auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--space-2xl);
  margin-bottom: var(--space-2xl);
}

.footer-brand-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin-top: 0.75rem;
}

.footer-heading {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text-secondary);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: var(--space-md);
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-links a {
  font-size: 0.875rem;
  color: var(--text-muted);
  transition: color var(--transition-fast);
}

.footer-links a:hover { color: var(--primary); }

.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: var(--space-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ==================== UTILITY CLASSES ==================== */
.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.text-accent { color: var(--primary); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }

.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }

.fw-normal { font-weight: 400; }
.fw-medium { font-weight: 500; }
.fw-semibold { font-weight: 600; }
.fw-bold { font-weight: 700; }
.fw-extrabold { font-weight: 800; }

.text-center { text-align: center; }
.text-right { text-align: right; }

.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }

.w-full { width: 100%; }
.h-full { height: 100%; }
.hidden { display: none !important; }
.visible { display: block !important; }
.flex-visible { display: flex !important; }

.divider {
  height: 1px;
  background: var(--border);
  margin: var(--space-lg) 0;
}

.glass {
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
}

/* ==================== PAGINATION ==================== */
.pagination {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  justify-content: center;
  margin-top: var(--space-2xl);
}

.pagination-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--surface-1);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
}

.pagination-btn:hover {
  background: var(--surface-2);
  color: var(--text-primary);
  border-color: var(--border-hover);
}

.pagination-btn.active {
  background: var(--gradient-primary);
  color: white;
  border-color: var(--primary);
  box-shadow: 0 2px 10px var(--primary-glow);
}

.pagination-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ==================== MOBILE RESPONSIVE ==================== */
@media (max-width: 1024px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .info-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  :root {
    --space-3xl: 2.5rem;
    --space-2xl: 2rem;
  }

  .container { padding: 0 1rem; }

  /* Navbar Mobile */
  .navbar-nav { display: none; }
  .menu-toggle { display: flex; }

  .navbar-container { height: 56px; }
  .page-wrapper { padding-top: calc(36px + 56px); }

  .navbar-search { display: none; }

  /* Mobile nav drawer */
  .nav-drawer {
    position: fixed;
    top: calc(36px + 56px);
    left: 0;
    right: 0;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: var(--space-md);
    z-index: var(--z-sticky);
    display: none;
  }

  .nav-drawer.open { display: block; }

  .nav-drawer .navbar-nav {
    display: flex;
    flex-direction: column;
    align-items: stretch;
  }

  .nav-drawer .navbar-nav a {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    font-size: 1rem;
  }

  .nav-drawer-search {
    margin-bottom: var(--space-md);
    position: relative;
  }

  .nav-drawer-search input {
    width: 100%;
    background: var(--surface-1);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    padding: 0.6rem 1rem 0.6rem 2.5rem;
    color: var(--text-primary);
    font-size: 0.9rem;
    outline: none;
  }

  .nav-drawer-search-icon {
    position: absolute;
    left: 0.8rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
  }

  /* Grid mobile */
  .posts-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: var(--space-md); }
  .footer-grid { grid-template-columns: 1fr; }
  .grid-3, .grid-4 { grid-template-columns: 1fr; }

  /* Modal full screen on mobile */
  .modal-overlay { padding: 0; align-items: flex-end; }
  .modal {
    max-width: 100%;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    max-height: 90vh;
  }

  /* Chat panel mobile */
  .chat-panel {
    left: 0.75rem;
    right: 0.75rem;
    width: auto;
    bottom: calc(1.5rem + 60px);
  }

  /* Section header */
  .section-header { flex-direction: column; align-items: flex-start; }

  /* Search bar */
  .search-bar { flex-direction: column; border-radius: var(--radius-lg); }
  .search-filter-group { border-right: none; border-bottom: 1px solid var(--border); min-width: auto; width: 100%; }
  .search-filter-group:last-of-type { border-bottom: none; }

  /* Footer */
  .footer-bottom { flex-direction: column; text-align: center; }

  /* Gallery */
  .gallery-thumbnails { grid-template-columns: repeat(3, 1fr); }

  /* Info grid */
  .info-grid { grid-template-columns: repeat(2, 1fr); }

  /* Toast */
  #toast-container { left: 1rem; right: 1rem; max-width: none; }
}

@media (max-width: 480px) {
  .posts-grid { grid-template-columns: 1fr; }
  .info-grid { grid-template-columns: 1fr; }
  .btn-xl { padding: 0.875rem 1.5rem; font-size: 0.95rem; }
  .tabs { border-radius: var(--radius-md); }
}

/* ==================== DARK MODE ANIMATIONS ==================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ==================== PRINT ==================== */
@media print {
  .navbar, .system-ticker, .chat-fab, .chat-panel, footer { display: none; }
  .page-wrapper { padding-top: 0; }
}

/* ==================== EXTRA COMPONENTS ==================== */

/* Sort Select */
.sort-select {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.45rem 0.875rem;
  color: var(--text-secondary);
  font-size: 0.875rem;
  outline: none;
  cursor: pointer;
  transition: border-color var(--transition-fast);
  font-family: var(--font-primary);
}
.sort-select:focus { border-color: var(--primary); }

/* Form Select */
.form-select {
  width: 100%;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.65rem 0.875rem;
  color: var(--text-primary);
  font-size: 0.9rem;
  outline: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  font-family: var(--font-primary);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23a0a0b5' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2.5rem;
}
.form-select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-glow); }

/* Table */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
thead { background: var(--surface-1); }
thead th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  white-space: nowrap;
}
tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background var(--transition-fast);
}
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--bg-glass-light); }
td { padding: 0.875rem 1rem; color: var(--text-secondary); vertical-align: middle; }

/* Tab count badge */
.tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  background: var(--danger);
  color: white;
  border-radius: var(--radius-full);
  font-size: 0.65rem;
  font-weight: 800;
  padding: 0 4px;
  margin-left: 0.25rem;
}

/* Image preview grid (create-post) */
.image-preview-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.5rem;
  margin-top: 1rem;
}
.image-preview-item {
  position: relative;
  aspect-ratio: 4/3;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border);
}
.image-preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.image-preview-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  background: rgba(239, 68, 68, 0.9);
  border: none;
  border-radius: 50%;
  color: white;
  font-size: 0.7rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition-fast);
}
.image-preview-remove:hover { background: var(--danger); }

@media (max-width: 640px) {
  .image-preview-grid { grid-template-columns: repeat(3, 1fr); }
}

/* Upload area */
.upload-area {
  border: 2px dashed var(--border-hover);
  border-radius: var(--radius-xl);
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-base);
  background: var(--surface-1);
}
.upload-area:hover, .upload-area.dragover {
  border-color: var(--primary);
  background: var(--primary-glow);
}
.upload-icon { font-size: 2.5rem; margin-bottom: 0.75rem; }
.upload-title { font-weight: 600; margin-bottom: 0.4rem; color: var(--text-primary); }
.upload-subtitle { font-size: 0.82rem; color: var(--text-muted); margin-bottom: 1rem; }

/* Google Login Button */
.btn-google {
  background: #fff;
  color: #333;
  border: 1px solid #ddd;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  border-radius: var(--radius-md);
  padding: 0.75rem 1.5rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  font-family: var(--font-primary);
  font-size: 0.9rem;
  width: 100%;
}
.btn-google:hover { background: #f8f8f8; box-shadow: var(--shadow-md); }
.btn-google img { width: 20px; height: 20px; object-fit: contain; }

/* Avatar placeholder */
.avatar-placeholder {
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: white;
  border-radius: 50%;
  flex-shrink: 0;
}
.avatar-placeholder.avatar-sm { width: 36px; height: 36px; font-size: 0.875rem; }
.avatar-placeholder.avatar-md { width: 48px; height: 48px; font-size: 1rem; }
.avatar-placeholder.avatar-lg { width: 64px; height: 64px; font-size: 1.25rem; }

/* Skeleton */
.skeleton-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
}
.skeleton-image {
  width: 100%;
  aspect-ratio: 4/3;
}
.w-40 { width: 40%; }
.w-60 { width: 60%; }
.w-80 { width: 80%; }

/* Gallery */
.image-gallery {
  display: grid;
  gap: 0.5rem;
}
.gallery-main {
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: var(--surface-2);
  aspect-ratio: 16/9;
  cursor: pointer;
}
.gallery-main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-base);
}
.gallery-main:hover img { transform: scale(1.02); }
.gallery-thumbnails {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
}
.gallery-thumb {
  aspect-ratio: 4/3;
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  position: relative;
  background: var(--surface-2);
}
.gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity var(--transition-fast);
}
.gallery-thumb:hover img { opacity: 0.8; }
.gallery-thumb.more-overlay::after {
  content: '+' attr(data-count);
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: 800;
  color: white;
}

/* Info grid (post detail) */
.info-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}
.info-item {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 0.875rem;
}
.info-item-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: block;
  margin-bottom: 0.3rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}
.info-item-value {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
}
.info-item-value.highlight {
  background: var(--gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-size: 1.05rem;
}

/* Form textarea */
.form-textarea {
  width: 100%;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.75rem 0.875rem;
  color: var(--text-primary);
  font-size: 0.9rem;
  outline: none;
  transition: all var(--transition-fast);
  font-family: var(--font-primary);
  resize: vertical;
  min-height: 120px;
  line-height: 1.6;
}
.form-textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-glow); }
.form-textarea::placeholder { color: var(--text-disabled); }

/* Form check (checkbox) */
.form-check {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  cursor: pointer;
}
.form-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
  flex-shrink: 0;
  margin-top: 2px;
  cursor: pointer;
}

/* Form hint */
.form-hint {
  font-size: 0.78rem;
  color: var(--text-disabled);
  margin-top: 0.3rem;
  display: block;
  line-height: 1.5;
}

/* Required star */
.required { color: var(--danger); margin-left: 0.1rem; }

/* Page loader (extra style) */
.loader-logo { font-size: 3rem; margin-bottom: 1rem; animation: logoPulse 1.5s ease-in-out infinite; }
.loader-bar { width: 200px; height: 3px; background: var(--border); border-radius: 2px; overflow: hidden; margin: 1rem auto; }
.loader-bar-fill { height: 100%; background: var(--gradient-primary); animation: loadBar 1.5s ease-in-out infinite; border-radius: 2px; }

@keyframes logoPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}
@keyframes loadBar {
  0% { width: 0%; }
  50% { width: 70%; }
  100% { width: 100%; }
}

/* Flex helpers */
.flex-1 { flex: 1; }
.fw-semibold { font-weight: 600; }
.text-accent { color: var(--primary); }
.text-xs { font-size: 0.75rem; }
.text-danger { color: var(--danger); }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 0.875rem; }
.text-center { text-align: center; }
.w-full { width: 100%; }
.mt-lg { margin-top: var(--space-lg); }
.mt-md { margin-top: var(--space-md); }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.justify-center { justify-content: center; }
.hidden { display: none !important; }

/* Danger item */
.dropdown-item.danger, .danger { color: var(--danger); }

/* Online dot */
.online-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  display: inline-block;
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.4); opacity: 0.7; }
}

/* Badge dot (on chat fab) */
.badge-dot {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 10px;
  height: 10px;
  background: var(--danger);
  border-radius: 50%;
  border: 2px solid var(--bg-primary);
}

/* Badge variants for posts */
.badge-ccmn { background: rgba(99, 102, 241, 0.2); color: #818cf8; border-color: rgba(99, 102, 241, 0.3); }
.badge-phongtro { background: rgba(249, 115, 22, 0.2); color: #fb923c; border-color: rgba(249, 115, 22, 0.3); }
.badge-canho { background: rgba(59, 130, 246, 0.2); color: #60a5fa; border-color: rgba(59, 130, 246, 0.3); }

/* Role badges */
.role-admin { background: rgba(239, 68, 68, 0.2); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.3); border-radius: var(--radius-full); padding: 0.25rem 0.75rem; font-size: 0.78rem; font-weight: 700; display: inline-flex; align-items: center; gap: 0.3rem; }
.role-seller { background: rgba(99, 102, 241, 0.2); color: #818cf8; border: 1px solid rgba(99, 102, 241, 0.3); border-radius: var(--radius-full); padding: 0.25rem 0.75rem; font-size: 0.78rem; font-weight: 700; display: inline-flex; align-items: center; gap: 0.3rem; }
.role-landlord { background: rgba(249, 115, 22, 0.2); color: #fb923c; border: 1px solid rgba(249, 115, 22, 0.3); border-radius: var(--radius-full); padding: 0.25rem 0.75rem; font-size: 0.78rem; font-weight: 700; display: inline-flex; align-items: center; gap: 0.3rem; }
.role-user { background: var(--surface-2); color: var(--text-secondary); border: 1px solid var(--border); border-radius: var(--radius-full); padding: 0.25rem 0.75rem; font-size: 0.78rem; font-weight: 700; display: inline-flex; align-items: center; gap: 0.3rem; }

/* Badge variants */
.badge-success { background: var(--success-bg); color: var(--success); border-color: rgba(34, 197, 94, 0.3); }
.badge-warning { background: var(--warning-bg); color: var(--warning); border-color: rgba(234, 179, 8, 0.3); }
.badge-danger { background: var(--danger-bg); color: var(--danger); border-color: rgba(239, 68, 68, 0.3); }
.badge-info { background: var(--info-bg); color: var(--info); border-color: rgba(59, 130, 246, 0.3); }

/* Btn-icon (small icon-only button) */
.btn-icon {
  width: 32px;
  height: 32px;
  padding: 0 !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
}

/* Btn full */
.btn-full { width: 100%; }

/* Btn size large */
.btn-lg { padding: 0.875rem 2rem; font-size: 1rem; }

/* Post card specific */
.post-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  cursor: pointer;
  transition: all var(--transition-base);
  display: flex;
  flex-direction: column;
}
.post-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md), var(--shadow-glow); border-color: var(--border-hover); }
.post-card-image {
  position: relative;
  aspect-ratio: 4/3;
  overflow: hidden;
  background: var(--surface-2);
}
.post-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-base);
}
.post-card:hover .post-card-image img { transform: scale(1.05); }
.post-card-badge {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  border-radius: var(--radius-full);
  padding: 0.3rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: white;
}
.post-card-body { padding: 1rem; flex: 1; }
.post-card-price {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 800;
  background: var(--gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.4rem;
}
.post-card-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  margin-bottom: 0.4rem;
  line-height: 1.4;
}
.post-card-address { font-size: 0.8rem; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.post-card-footer {
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.post-card-author { display: flex; align-items: center; gap: 0.5rem; min-width: 0; }
.post-card-author-name { font-size: 0.78rem; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.post-card-time { font-size: 0.75rem; color: var(--text-disabled); flex-shrink: 0; }
.author-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--gradient-primary);
  color: white;
  font-size: 0.6rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

