/*
 * ChMBets - Ultra Modern Dark Theme (Notion-Inspired)
 * Clean, minimal, sophisticated design
 * Mobile-first responsive
 */

/* ============================================
   CSS VARIABLES - Notion-Style Dark Theme
   ============================================ */
:root {
  /* Background Colors - More subtle, less gradient */
  --bg-primary: #191919;
  --bg-secondary: #1f1f1f;
  --bg-tertiary: #252525;
  --bg-surface: #2a2a2a;
  --bg-elevated: #2f2f2f;
  --bg-hover: #353535;
  
  /* Text Colors - Higher contrast */
  --text-primary: #ffffff;
  --text-secondary: #9ca3af;
  --text-tertiary: #6b7280;
  --text-inverse: #0a0a0a;
  
  /* Accent Colors - More vibrant, Notion-style */
  --accent-primary: #3b82f6;
  --accent-primary-hover: #2563eb;
  --accent-secondary: #8b5cf6;
  --accent-cyan: #06b6d4;
  --accent-pink: #ec4899;
  --accent-gold: #f59e0b;
  --accent-gold-hover: #d97706;
  
  /* Semantic Colors */
  --success: #10b981;
  --success-hover: #059669;
  --warning: #f59e0b;
  --error: #ef4444;
  --info: #06b6d4;
  
  /* Border Colors - More subtle */
  --border-primary: #333333;
  --border-secondary: #3f3f3f;
  --border-hover: #525252;
  
  /* Shadows - Softer, more natural */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.6);
  
  /* Spacing - Consistent 4px grid */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-12: 3rem;
  --space-16: 4rem;
  
  /* Border Radius - More subtle */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  
  /* Transitions - Snappier */
  --transition-fast: 120ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 180ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   BASE STYLES
   ============================================ */
* {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
  line-height: 1.6;
  min-height: 100vh;
  padding-top: 72px;
  overflow-x: hidden;
  font-weight: 400;
  width: 100%;
  max-width: 100vw;
}

html {
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
}

/* ============================================
   TYPOGRAPHY - Notion-style
   ============================================ */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-primary);
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: var(--space-4);
  letter-spacing: -0.01em;
}

h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(1.75rem, 4vw, 2rem);
  font-weight: 600;
  letter-spacing: -0.01em;
}

h3 {
  font-size: clamp(1.5rem, 3vw, 1.5rem);
  font-weight: 600;
  letter-spacing: -0.01em;
}

h4 {
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.005em;
}

h5, h6 {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.005em;
}

p {
  margin-bottom: var(--space-4);
  color: var(--text-secondary);
  line-height: 1.65;
}

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

a:hover {
  color: var(--accent-primary-hover);
}

.lead {
  font-size: clamp(1.125rem, 2.5vw, 1.25rem);
  font-weight: 400;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Gradient text */
.gradient-text {
  background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ============================================
   NAVBAR - Ultra Clean
   ============================================ */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1030;
  background: rgba(25, 25, 25, 0.8) !important;
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border-primary);
  padding: var(--space-3) 0 !important;
  height: 72px;
  /* Prevent navbar from collapsing/hiding on scroll - always stay at top */
  transform: translateY(0) !important;
}

.navbar-brand {
  color: var(--text-primary) !important;
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  transition: opacity var(--transition-fast);
}

.navbar-brand:hover {
  opacity: 0.8;
}

.navbar-toggler {
  border: 1px solid var(--border-secondary);
  background: var(--bg-elevated);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.navbar-toggler:hover {
  background: var(--bg-hover);
  border-color: var(--border-hover);
}

.navbar-toggler:focus {
  box-shadow: 0 0 0 2px var(--accent-primary);
  outline: none;
}

.navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(255, 255, 255, 0.9)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
  width: 20px;
  height: 20px;
}

.nav-link {
  color: var(--text-secondary) !important;
  font-weight: 500;
  font-size: 0.9375rem;
  padding: var(--space-2) var(--space-4) !important;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  position: relative;
}

.nav-link:hover {
  color: var(--text-primary) !important;
  background: var(--bg-elevated);
}

.nav-link.active {
  color: var(--text-primary) !important;
  background: var(--bg-surface);
}

.dropdown-menu {
  background: var(--bg-secondary) !important;
  border: 1px solid var(--border-primary) !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: var(--shadow-lg) !important;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.dropdown-item {
  color: var(--text-secondary) !important;
  padding: var(--space-3) var(--space-4) !important;
  transition: all var(--transition-fast);
  white-space: normal !important;
  word-wrap: break-word !important;
  overflow-wrap: break-word !important;
  max-width: 100% !important;
}

.dropdown-item:hover {
  background: var(--bg-tertiary) !important;
  color: var(--text-primary) !important;
}

.dropdown-divider {
  border-color: var(--border-primary) !important;
  margin: var(--space-2) 0 !important;
}

/* Notifications dropdown button when open */
.notifications-open {
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.4), 0 2px 8px rgba(59, 130, 246, 0.2) !important;
  background: var(--bg-elevated) !important;
}

/* Notifications dropdown menu - only scroll when content exceeds max-height */
.notifications-dropdown-menu {
  max-height: 400px;
  overflow-x: hidden;
  overflow-y: auto;
}

/* Mobile notifications dropdown - full width with small gap, centered */
@media (max-width: 991.98px) {
  .notifications-dropdown-mobile {
    width: calc(100vw - 1rem) !important;
    max-width: calc(100vw - 1rem) !important;
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%) !important;
    margin: 0 !important;
    position: fixed !important;
  }
  
  /* Override Bootstrap's positioning completely */
  .dropdown-menu-end.notifications-dropdown-mobile {
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%) !important;
  }
}

/* Mobile navbar */
@media (max-width: 991.98px) {
  .navbar-collapse {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    margin-top: var(--space-4);
    padding: var(--space-4);
    border: 1px solid var(--border-primary);
    box-shadow: var(--shadow-lg);
  }
  
  .nav-link {
    padding: var(--space-3) var(--space-4) !important;
    margin-bottom: var(--space-1);
  }
  
  .navbar .navbar-collapse .d-flex {
    flex-direction: column;
    width: 100%;
    gap: var(--space-2) !important;
    margin-top: var(--space-4);
  }
  
  .navbar .navbar-collapse .d-flex .btn,
  .navbar .navbar-collapse .d-flex form {
    width: 100%;
  }
}

/* ============================================
   BOTTOM NAVBAR - Mobile Only
   ============================================ */
.bottom-navbar {
  position: fixed;
  bottom: 0 !important;
  left: 0;
  right: 0;
  z-index: 1020;
  background: rgba(25, 25, 25, 0.95);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-top: 1px solid var(--border-primary);
  padding: var(--space-2) 0;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.3);
  transform: translateZ(0); /* Force hardware acceleration */
  will-change: transform; /* Optimize for animations */
  /* Ensure it stays at viewport bottom regardless of layout changes */
  margin: 0;
  width: 100%;
  max-width: 100%;
}

.bottom-navbar-container {
  display: flex;
  justify-content: space-around;
  align-items: center;
  max-width: 100%;
  padding: 0 var(--space-2);
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-2) var(--space-3);
  text-decoration: none;
  color: var(--text-tertiary);
  transition: all var(--transition-fast);
  border-radius: var(--radius-md);
  min-width: 60px;
  flex: 1;
  position: relative;
}

.bottom-nav-item:hover {
  color: var(--text-secondary);
  background: var(--bg-elevated);
}

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

.bottom-nav-item.active .bottom-nav-icon {
  transform: scale(1.1);
}

.bottom-nav-icon {
  font-size: 1.5rem;
  line-height: 1;
  margin-bottom: var(--space-1);
  transition: transform var(--transition-fast);
  filter: grayscale(0.6);
  opacity: 0.7;
}

.bottom-nav-item.active .bottom-nav-icon {
  filter: grayscale(0);
  opacity: 1;
}

.bottom-nav-item:hover .bottom-nav-icon {
  filter: grayscale(0.3);
  opacity: 0.9;
}

.bottom-nav-label {
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1;
  text-align: center;
}

/* Add padding to main content when bottom navbar is visible */
@media (max-width: 991.98px) {
  main {
    padding-bottom: calc(var(--space-12) + 70px);
  }
}

/* Safe area insets for PWA */
@supports (padding: max(0px)) {
  .bottom-navbar {
    bottom: 0 !important; /* Always stay at viewport bottom */
    padding-bottom: max(var(--space-2), env(safe-area-inset-bottom) + var(--space-2));
  }
  
  .bottom-navbar-container {
    padding-left: max(var(--space-2), env(safe-area-inset-left) + var(--space-2));
    padding-right: max(var(--space-2), env(safe-area-inset-right) + var(--space-2));
  }
  
  @media (max-width: 991.98px) {
    main {
      padding-bottom: calc(var(--space-12) + 70px + env(safe-area-inset-bottom));
    }
  }
}

/* ============================================
   BUTTONS - Notion-style
   ============================================ */
.btn {
  padding: var(--space-2) var(--space-6);
  border-radius: var(--radius-md);
  font-weight: 500;
  font-size: 0.9375rem;
  border: none;
  transition: all var(--transition-fast);
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  cursor: pointer;
  white-space: nowrap;
}

.btn:active {
  transform: scale(0.98);
}

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

.btn-primary:hover {
  background: var(--accent-primary-hover);
  color: white;
}

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

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

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

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

.btn-warning {
  background: var(--warning);
  color: var(--text-inverse);
}

.btn-warning:hover {
  opacity: 0.9;
  color: var(--text-inverse);
}

.btn-danger,
.btn-outline-danger {
  background: transparent;
  border: 1.5px solid var(--error);
  color: var(--error);
}

.btn-danger:hover,
.btn-outline-danger:hover {
  background: var(--error);
  color: white;
}

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

.btn-outline-warning:hover {
  background: var(--warning);
  color: var(--text-inverse);
}

.btn-sm {
  padding: var(--space-1) var(--space-4);
  font-size: 0.875rem;
  min-height: 32px;
}

.btn-lg {
  padding: var(--space-3) var(--space-8);
  font-size: 1rem;
  min-height: 48px;
}

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

/* Mobile buttons */
@media (max-width: 768px) {
  .btn {
    width: 100%;
  }
  
  .btn-sm {
    width: auto;
  }
}

/* ============================================
   CARDS - Clean & Minimal
   ============================================ */
.card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-base);
  overflow: hidden;
  margin-bottom: var(--space-6);
}

.card:hover {
  border-color: var(--border-secondary);
  box-shadow: var(--shadow-md);
}

.card-header {
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border-primary);
  padding: var(--space-4) var(--space-6);
  font-weight: 600;
  color: var(--text-primary);
  font-size: 1rem;
}

.card-body {
  padding: var(--space-6);
  color: var(--text-secondary);
}

.card-footer {
  background: var(--bg-tertiary);
  border-top: 1px solid var(--border-primary);
  padding: var(--space-4) var(--space-6);
}

.card-title {
  color: var(--text-primary);
  font-weight: 600;
  margin-bottom: var(--space-2);
  font-size: 1.125rem;
}

.card-text {
  color: var(--text-secondary);
  line-height: 1.65;
}

/* Clickable cards */
.clickable-card {
  cursor: pointer;
  transition: all var(--transition-base);
}

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

/* Mobile cards */
@media (max-width: 768px) {
  .card {
    margin-bottom: var(--space-4);
  }
  
  .card-header,
  .card-body {
    padding: var(--space-4);
  }
  
  .card-footer {
    padding: var(--space-3) var(--space-4);
  }
}

/* ============================================
   BADGES - Clean Design
   ============================================ */
.badge {
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: 0.8125rem;
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
}

.badge.bg-primary {
  background: var(--accent-primary) !important;
  color: white;
}

.badge.bg-success {
  background: var(--success) !important;
  color: white;
}

.badge.bg-warning {
  background: var(--warning) !important;
  color: var(--text-inverse);
}

.badge.bg-danger {
  background: var(--error) !important;
  color: white;
}

.badge.bg-info {
  background: var(--info) !important;
  color: white;
}

.badge.bg-secondary {
  background: var(--bg-elevated) !important;
  color: var(--text-secondary);
  border: 1px solid var(--border-secondary);
}

/* Coin indicator */
.coin-indicator {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
  color: white !important;
  font-weight: 600;
  transition: all var(--transition-fast);
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

.coin-indicator:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
}

.coin-shop-badge {
  min-width: 140px;
  text-align: center;
}

@media (max-width: 576px) {
  .coin-shop-badge {
    min-width: 120px;
    font-size: 0.875rem !important;
  }
}

/* ============================================
   FORMS - Modern & Clean
   ============================================ */
.form-label {
  color: var(--text-primary);
  font-weight: 500;
  margin-bottom: var(--space-2);
  font-size: 0.9375rem;
}

.form-control,
.form-select {
  background: var(--bg-elevated);
  border: 1.5px solid var(--border-secondary);
  color: var(--text-primary);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  font-size: 0.9375rem;
  transition: all var(--transition-fast);
  min-height: 44px;
}

.form-control:focus,
.form-select:focus {
  background: var(--bg-surface);
  border-color: var(--accent-primary);
  color: var(--text-primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
  outline: none;
}

.form-control::placeholder {
  color: var(--text-tertiary);
}

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

.form-text {
  color: var(--text-tertiary);
  font-size: 0.875rem;
  margin-top: var(--space-2);
}

.input-group-text {
  background: var(--bg-surface);
  border: 1.5px solid var(--border-secondary);
  border-right: none;
  color: var(--text-secondary);
}

.input-group .form-control {
  border-left: none;
}

/* Mobile forms */
@media (max-width: 768px) {
  .form-control,
  .form-select {
    font-size: 16px; /* Prevents iOS zoom */
  }
}

/* ============================================
   ALERTS - Subtle & Clean
   ============================================ */
.alert {
  padding: var(--space-4) var(--space-6);
  border-radius: var(--radius-lg);
  border: 1px solid;
  margin-bottom: var(--space-6);
  font-size: 0.9375rem;
}

.alert-success {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.3);
  color: #6ee7b7;
}

.alert-danger {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}

.alert-warning {
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.3);
  color: #fcd34d;
}

.alert-info {
  background: rgba(6, 182, 212, 0.1);
  border-color: rgba(6, 182, 212, 0.3);
  color: #67e8f9;
}

.alert-heading {
  color: var(--text-primary);
  font-weight: 600;
  margin-bottom: var(--space-2);
}

.alert-dismissible .btn-close {
  filter: invert(1) grayscale(100%) brightness(200%);
  opacity: 0.6;
}

.alert-dismissible .btn-close:hover {
  opacity: 1;
}

/* Mobile alerts */
@media (max-width: 768px) {
  .alert {
    padding: var(--space-3) var(--space-4);
  }
}

/* ============================================
   TABLES
   ============================================ */
.table {
  color: var(--text-secondary);
  border-color: var(--border-primary);
}

.table thead th {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  font-weight: 600;
  border-bottom: 1px solid var(--border-secondary);
  padding: var(--space-3) var(--space-4);
  font-size: 0.875rem;
}

.table tbody td {
  padding: var(--space-3) var(--space-4);
  border-color: var(--border-primary);
}

.table tbody tr {
  transition: background var(--transition-fast);
}

.table tbody tr:hover {
  background: var(--bg-tertiary);
}

.table-responsive {
  border-radius: var(--radius-lg);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Mobile tables */
@media (max-width: 768px) {
  .table {
    font-size: 0.875rem;
  }
  
  .table thead th,
  .table tbody td {
    padding: var(--space-2) var(--space-3);
  }
}

/* ============================================
   LIST GROUPS
   ============================================ */
.list-group-item {
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border-primary);
  color: var(--text-secondary);
  padding: var(--space-4) 0;
  transition: all var(--transition-fast);
}

.list-group-item:hover {
  background: var(--bg-tertiary);
  padding-left: var(--space-4);
  padding-right: var(--space-4);
  border-radius: var(--radius-md);
}

.list-group-item:last-child {
  border-bottom: none;
}

.list-group-flush .list-group-item {
  border-left: none;
  border-right: none;
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-primary);
  padding: var(--space-8) 0;
  margin-top: var(--space-12);
  color: var(--text-secondary);
}

.footer a {
  color: var(--text-secondary);
  transition: color var(--transition-fast);
  padding: var(--space-2);
  border-radius: var(--radius-sm);
}

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

/* Mobile footer */
@media (max-width: 768px) {
  .footer {
    padding: var(--space-6) 0;
    font-size: 0.875rem;
  }
}

/* Footer spacing when bottom navbar is visible */
@media (max-width: 991.98px) {
  .footer {
    margin-bottom: 70px; /* Space for bottom navbar */
  }
}

/* Safe area insets for footer with bottom navbar */
@supports (padding: max(0px)) {
  @media (max-width: 991.98px) {
    .footer {
      margin-bottom: calc(70px + env(safe-area-inset-bottom));
    }
  }
}

/* ============================================
   CONTAINER & LAYOUT
   ============================================ */
.container {
  padding-left: var(--space-6);
  padding-right: var(--space-6);
}

main {
  min-height: calc(100vh - 200px);
  padding-bottom: var(--space-12);
}

/* Mobile container */
@media (max-width: 768px) {
  .container {
    padding-left: var(--space-4);
    padding-right: var(--space-4);
  }
}

/* ============================================
   UTILITIES
   ============================================ */
.text-muted {
  color: var(--text-tertiary) !important;
}

.text-primary {
  color: var(--accent-primary) !important;
}

.text-success {
  color: var(--success) !important;
}

.text-warning {
  color: var(--warning) !important;
}

.text-danger {
  color: var(--error) !important;
}

.bg-light {
  background: var(--bg-tertiary) !important;
}

.bg-white {
  background: var(--bg-surface) !important;
}

.border {
  border-color: var(--border-primary) !important;
}

/* Property List Component */
.property-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.property-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border-primary);
}

.property-item:last-child {
  border-bottom: none;
}

.property-label {
  color: var(--text-tertiary);
  font-size: 0.875rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.property-value {
  color: var(--text-primary);
  font-weight: 600;
}

/* Empty states */
.empty-state {
  text-align: center;
  padding: var(--space-12) var(--space-6);
}

.empty-state h4 {
  color: var(--text-secondary);
  margin-bottom: var(--space-4);
  font-weight: 500;
}

.empty-state p {
  color: var(--text-tertiary);
}

/* ============================================
   ANIMATIONS - Subtle
   ============================================ */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-in {
  animation: fadeIn 0.4s ease-out;
}

/* Page load animation */
main {
  animation: pageLoad 0.3s ease-out;
}

@keyframes pageLoad {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* List item stagger animation */
.list-group-item {
  animation: itemFadeIn 0.3s ease-out backwards;
}

@keyframes itemFadeIn {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.list-group-item:nth-child(1) { animation-delay: 0.05s; }
.list-group-item:nth-child(2) { animation-delay: 0.1s; }
.list-group-item:nth-child(3) { animation-delay: 0.15s; }
.list-group-item:nth-child(n+4) { animation-delay: 0.2s; }

/* ============================================
   FOCUS STYLES
   ============================================ */
:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

/* ============================================
   LOADING STATES
   ============================================ */
.btn.loading {
  position: relative;
  color: transparent;
  pointer-events: none;
}

.btn.loading::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  top: 50%;
  left: 50%;
  margin-left: -8px;
  margin-top: -8px;
  border: 2px solid currentColor;
  border-radius: 50%;
  border-top-color: transparent;
  animation: spinner 0.6s linear infinite;
}

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

/* ============================================
   SAFE AREA INSETS
   ============================================ */
@supports (padding: max(0px)) {
  body {
    padding-top: calc(env(safe-area-inset-top) + 72px);
    padding-left: max(0px, env(safe-area-inset-left));
    padding-right: max(0px, env(safe-area-inset-right));
  }
  
  .navbar {
    top: 0 !important;
    padding-top: calc(env(safe-area-inset-top) + var(--space-3)) !important;
    padding-left: max(var(--space-4), env(safe-area-inset-left) + var(--space-4));
    padding-right: max(var(--space-4), env(safe-area-inset-right) + var(--space-4));
    height: calc(72px + env(safe-area-inset-top)) !important;
  }
  
  .footer {
    padding-bottom: max(var(--space-8), env(safe-area-inset-bottom) + var(--space-8));
  }
}

/* ============================================
   ACCESSIBILITY
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
  body {
    background: white;
    color: black;
  }
  
  .navbar,
  .footer,
  .btn {
    display: none;
  }
}

/* ============================================
   SCROLLBAR STYLING (Webkit)
   ============================================ */
::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--bg-elevated);
  border-radius: var(--radius-lg);
  border: 2px solid var(--bg-primary);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--bg-hover);
}

/* Firefox scrollbar */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--bg-elevated) var(--bg-primary);
}

/* ============================================
   CLICKABLE STAT CARDS
   ============================================ */
.clickable-stat-card {
  text-decoration: none !important;
}

.clickable-stat-card .card {
  transition: all 0.2s ease;
}

.clickable-stat-card:hover .card {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.clickable-stat-card:hover .card[style*="rgba(99, 102, 241"] {
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

.clickable-stat-card:hover .card[style*="rgba(0, 212, 255"] {
  box-shadow: 0 4px 12px rgba(0, 212, 255, 0.2);
}

/* Achievement cards grid - flexible layout that prevents skinny cards */
.achievements-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.achievement-card-wrapper {
  flex: 0 1 calc(50% - 0.375rem);
  min-width: 150px;
  max-width: calc(50% - 0.375rem);
}

/* On mobile, 2 columns with fixed width */
@media (max-width: 767px) {
  .achievement-card-wrapper {
    flex: 0 1 calc(50% - 0.375rem);
    min-width: 140px;
    max-width: calc(50% - 0.375rem);
  }
}

/* On medium screens, allow 2 columns if there's enough space */
@media (min-width: 768px) {
  .achievement-card-wrapper {
    flex: 0 1 calc(50% - 0.375rem);
    min-width: 200px;
    max-width: calc(50% - 0.375rem);
  }
  
  /* If container is too narrow for 2 columns, force single column */
  .col-lg-4 .achievements-grid .achievement-card-wrapper {
    flex: 0 1 100%;
    max-width: 100%;
  }
}

/* On extra large screens, allow 3 columns if there's enough space */
@media (min-width: 1200px) {
  .achievement-card-wrapper {
    flex: 0 1 calc(33.333% - 0.5rem);
    min-width: 180px;
    max-width: calc(33.333% - 0.5rem);
  }
  
  /* But in narrow containers (like col-lg-4), still use 1-2 columns max */
  .col-lg-4 .achievements-grid .achievement-card-wrapper {
    flex: 0 1 calc(50% - 0.375rem);
    min-width: 200px;
    max-width: calc(50% - 0.375rem);
  }
}

/* ============================================
   SIDEBAR - Mobile Navigation
   ============================================ */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  z-index: 1040;
  pointer-events: none;
  visibility: hidden;
  transition: visibility var(--transition-base);
}

.sidebar.show {
  visibility: visible;
  pointer-events: auto;
}

.sidebar-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity var(--transition-base);
}

.sidebar.show .sidebar-backdrop {
  opacity: 1;
}

.sidebar-content {
  position: absolute;
  top: 0;
  left: 0;
  width: 280px;
  max-width: 85vw;
  height: 100%;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-primary);
  box-shadow: var(--shadow-xl);
  transform: translateX(-100%);
  transition: transform var(--transition-base);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar.show .sidebar-content {
  transform: translateX(0);
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-6);
  padding-top: max(var(--space-4), env(safe-area-inset-top) + var(--space-4));
  border-bottom: 1px solid var(--border-primary);
  background: var(--bg-tertiary);
  min-height: 72px;
}

.sidebar-title {
  margin: 0;
  color: var(--text-primary);
  font-weight: 600;
  font-size: 1.125rem;
}

.sidebar-close {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 1.5rem;
  line-height: 1;
  padding: var(--space-2);
  cursor: pointer;
  transition: color var(--transition-fast);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
}

.sidebar-close:hover {
  color: var(--text-primary);
  background: var(--bg-elevated);
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-4) 0;
  display: flex;
  flex-direction: column;
}

.sidebar-section {
  padding: 0 var(--space-4);
}

.sidebar-section-bottom {
  margin-top: auto;
  padding-bottom: var(--space-4);
}

.sidebar-divider {
  margin: var(--space-4) var(--space-4);
  border-color: var(--border-primary);
  border-top: none;
  border-bottom: 1px solid var(--border-primary);
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  margin-bottom: var(--space-1);
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
}

.sidebar-link:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.sidebar-link.active {
  background: var(--bg-surface);
  color: var(--text-primary);
}

.sidebar-link-profile {
  font-weight: 600;
}

.sidebar-coin-count {
  padding: var(--space-2) var(--space-4);
  margin-top: var(--space-2);
  margin-bottom: var(--space-2);
  display: flex;
  justify-content: flex-start;
}

.sidebar-link-icon {
  font-size: 1.25rem;
  width: 24px;
  text-align: center;
  flex-shrink: 0;
}

.sidebar-link-text {
  flex: 1;
}

.sidebar-link-admin {
  color: var(--accent-primary);
}

.sidebar-link-admin:hover {
  background: rgba(59, 130, 246, 0.1);
  color: var(--accent-primary);
}

.sidebar-link-signout {
  color: var(--error);
}

.sidebar-link-signout:hover {
  background: rgba(239, 68, 68, 0.1);
  color: var(--error);
}

.sidebar-signout-form {
  width: 100%;
  margin: 0;
  padding: 0;
}

.sidebar-signout-form .sidebar-link {
  margin-bottom: 0;
}

/* Desktop: hide sidebar */
@media (min-width: 992px) {
  .sidebar {
    display: none;
  }
}

/* ============================================
   PULL TO REFRESH - PWA Only
   ============================================ */
.pull-to-refresh-indicator {
  position: fixed;
  top: 72px;
  left: 50%;
  transform: translateX(-50%) translateY(-100%);
  z-index: 1050;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-4);
  opacity: 0;
  transition: opacity var(--transition-base), transform var(--transition-base);
  pointer-events: none;
}

.pull-to-refresh-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border-primary);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  transition: transform var(--transition-base);
}

.pull-to-refresh-text {
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
}

/* Only show pull-to-refresh in standalone PWA mode */
html.pwa-mode .pull-to-refresh-indicator {
  display: flex;
}

/* Hide pull-to-refresh in browser mode */
html:not(.pwa-mode) .pull-to-refresh-indicator {
  display: none !important;
}
