﻿/* ===================================
   TRAVELFUND PLATFORM - CSS STYLES
   Multi-Fund Architecture with SPA
   =================================== */

/* === ROOT VARIABLES === */
:root {
  /* Primary Colors */
  --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --primary-dark: #5568d3;
  --primary-light: #a8b3ff;
  
  /* Secondary Colors */
  --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  --accent-blue: #4facfe;
  --accent-green: #43e97b;
  --accent-orange: #fa709a;
  --accent-purple: #667eea;
  
  /* Status Colors */
  --success: #10b981;
  --warning: #f59e0b;
  --error: #ef4444;
  --info: #3b82f6;
  
  /* Neutral Colors - Dark Theme (default) */
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-tertiary: #334155;
  --text-primary: #f1f5f9;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  
  /* Glass Effect */
  --glass-bg: rgba(255, 255, 255, 0.05);
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  
  /* Spacing */
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 1.5rem;
  --spacing-lg: 2rem;
  --spacing-xl: 3rem;
  
  /* Border Radius */
  --radius-sm: 0.5rem;
  --radius-md: 1rem;
  --radius-lg: 1.5rem;
  --radius-full: 9999px;
  
  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-base: 0.3s ease;
  --transition-slow: 0.5s ease;
}

/* === LIGHT THEME VARIABLES === */
[data-theme="light"] {
  /* Neutral Colors - Light Theme */
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-tertiary: #e2e8f0;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  
  /* Glass Effect - Light Theme */
  --glass-bg: rgba(0, 0, 0, 0.02);
  --glass-border: rgba(0, 0, 0, 0.1);
  --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.1);
}

/* === DARK THEME (explicit for clarity) === */
[data-theme="dark"] {
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-tertiary: #334155;
  --text-primary: #f1f5f9;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --glass-bg: rgba(255, 255, 255, 0.05);
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  
  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 300ms ease;
  --transition-slow: 500ms ease;
}

/* === GLOBAL RESET === */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
}

/* Animated Background */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    radial-gradient(circle at 20% 50%, rgba(102, 126, 234, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(118, 75, 162, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 40% 20%, rgba(79, 172, 254, 0.1) 0%, transparent 50%);
  z-index: -1;
  animation: gradientShift 15s ease infinite;
}

@keyframes gradientShift {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.8; }
}

/* === LOADING OVERLAY === */
#loadingOverlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-primary);
  backdrop-filter: blur(10px);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  transition: opacity var(--transition-base);
  opacity: 0.98;
}

#loadingOverlay.active {
  display: flex;
}

.loading-content {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 1rem;
  padding: 2.5rem 3rem;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.spinner {
  width: 60px;
  height: 60px;
  border: 5px solid rgba(99, 102, 241, 0.15);
  border-top-color: #6366f1;
  border-right-color: #8b5cf6;
  border-radius: 50%;
  animation: spin 0.8s cubic-bezier(0.4, 0, 0.2, 1) infinite;
  position: relative;
}

.spinner::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  border: 5px solid transparent;
  border-top-color: #a78bfa;
  border-radius: 50%;
  animation: spin-reverse 1.2s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes spin-reverse {
  to { transform: translate(-50%, -50%) rotate(-360deg); }
}

.loading-text {
  color: #e2e8f0;
  font-size: 1rem;
  font-weight: 500;
  margin: 0;
  letter-spacing: 0.5px;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* === TOAST NOTIFICATIONS === */
#toastContainer {
  position: fixed;
  top: var(--spacing-lg);
  right: var(--spacing-lg);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.toast {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: var(--spacing-md);
  min-width: 300px;
  box-shadow: var(--glass-shadow);
  animation: slideInRight 0.3s ease;
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.toast.success { border-left: 4px solid var(--success); }
.toast.error { border-left: 4px solid var(--error); }
.toast.info { border-left: 4px solid var(--info); }
.toast.warning { border-left: 4px solid var(--warning); }

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* === HEADER === */
header,
.app-header {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--glass-border);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.header-container,
.header-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 var(--spacing-lg);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--spacing-lg);
}

.logo {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  flex-shrink: 0;
  transition: all 0.3s ease;
}

.logo:hover {
  transform: translateY(-1px);
  opacity: 0.9;
}

.logo h1 {
  font-size: 1.5rem;
  font-weight: 700;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
  margin: 0;
  display: flex;
  align-items: center;
}

.version-badge {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  opacity: 0.8;
}

.logo-icon {
  font-size: 2rem;
  filter: drop-shadow(0 0 10px rgba(102, 126, 234, 0.5));
}

.header-right,
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

/* Better visual grouping for header actions */
.header-actions > div:last-child {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-lg);
  background: rgba(102, 126, 234, 0.05);
  border: 1px solid rgba(102, 126, 234, 0.1);
  transition: all 0.3s ease;
}

[data-theme="dark"] .header-actions > div:last-child {
  background: rgba(102, 126, 234, 0.08);
  border-color: rgba(102, 126, 234, 0.15);
}

[data-theme="light"] .header-actions > div:last-child {
  background: rgba(102, 126, 234, 0.03);
  border-color: #e2e8f0;
}

.unified-session-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(102, 126, 234, 0.08);
  border: 1px solid rgba(102, 126, 234, 0.15);
  border-radius: var(--radius-full);
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  font-weight: 500;
  white-space: nowrap;
  transition: all 0.3s ease;
}

.unified-session-badge:hover {
  background: rgba(102, 126, 234, 0.12);
  border-color: rgba(102, 126, 234, 0.25);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

#profileBtnMobile {
  display: none !important;
}

.session-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.session-auth,
.session-wallet {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
}

.session-icon {
  font-size: 1rem;
  opacity: 0.8;
}

.notifications-btn {
  position: relative;
  background: transparent;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-full);
  padding: 0.6rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
}

.notifications-btn:hover {
  background: rgba(102, 126, 234, 0.1);
  border-color: rgba(102, 126, 234, 0.3);
  transform: scale(1.05);
}

.bell-icon {
  font-size: 1.25rem;
}

.notification-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--error);
  color: white;
  border-radius: 10px;
  padding: 0.15rem 0.4rem;
  font-size: 0.65rem;
  font-weight: 700;
  min-width: 18px;
  text-align: center;
}

.settings-btn-app {
  background: transparent;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-full);
  padding: 0.6rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  font-size: 1.25rem;
}

.settings-btn-app:hover {
  background: rgba(102, 126, 234, 0.1);
  border-color: rgba(102, 126, 234, 0.3);
  transform: rotate(45deg);
}

.nickname-badge {
  display: none;
  align-items: center;
  gap: var(--spacing-xs);
  background: rgba(102, 126, 234, 0.1);
  border: 1px solid rgba(102, 126, 234, 0.3);
  border-radius: var(--radius-full);
  padding: 0.375rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  color: var(--primary-light);
}

.nickname-badge .nickname-icon {
  font-size: 0.875rem;
}

.nickname-badge.active {
  display: flex;
}

/* Unified Session Badge */
.unified-session-badge {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  background: rgba(102, 126, 234, 0.1);
  border: 1px solid rgba(102, 126, 234, 0.3);
  border-radius: var(--radius-md);
  padding: 0.5rem 0.875rem;
  font-size: 0.8rem;
  max-width: 280px;
}

.unified-session-badge .session-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.unified-session-badge .session-auth,
.unified-session-badge .session-wallet {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-weight: 600;
  color: var(--text-primary);
}

.unified-session-badge .session-icon {
  font-size: 0.875rem;
}

.unified-session-badge .session-status {
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 0.25rem;
  margin-top: 0.25rem;
  border-top: 1px solid rgba(102, 126, 234, 0.2);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.unified-session-badge .status-full {
  color: #10b981;
}

.unified-session-badge .status-limited {
  color: #f59e0b;
}

.unified-session-badge .status-wallet-only {
  color: #667eea;
}

/* Wallet Button in Header */
#connectWallet {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  border-radius: var(--radius-full);
  min-width: auto;
  white-space: nowrap;
}

#connectWallet .btn-icon {
  font-size: 1rem;
}

#connectWallet:disabled {
  cursor: default;
  opacity: 1;
}

/* Responsive header adjustments */
@media (max-width: 768px) {
  header,
  .app-header {
    padding: 0.75rem 0;
  }
  
  .header-content {
    padding: 0 1rem;
    gap: 0.75rem;
  }
  
  .logo {
    min-width: 0;
    flex: 1;
  }
  
  .logo h1 {
    font-size: 1.15rem;
    display: flex;
    align-items: center;
  }
  
  .logo h1 img {
    height: 26px !important;
    margin-right: 8px !important;
  }
  
  .version-badge {
    font-size: 0.55rem;
    display: none;
  }
  
  .header-actions {
    gap: 0.5rem;
    flex-shrink: 0;
  }
  
  .header-actions > div {
    background: transparent;
    border: none;
    padding: 0;
  }
  
  .unified-session-badge {
    display: none !important;
  }
  
  #profileBtnMobile {
    display: flex !important;
  }
  
  .notifications-btn {
    width: 38px;
    height: 38px;
    padding: 0.5rem;
  }
  
  .bell-icon {
    font-size: 1.1rem;
  }
  
  .settings-btn-app {
    width: 38px;
    height: 38px;
    padding: 0.5rem;
    font-size: 1.1rem;
  }
  
  .btn {
    padding: 0.5rem;
    font-size: 0.85rem;
    white-space: nowrap;
    min-width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .btn .btn-icon {
    font-size: 1.1rem;
  }
  
  .btn span:not(.btn-icon) {
    display: none;
  }
  
  #connectWallet,
  #disconnectWallet,
  #signInSimpleMode,
  #signOutFirebase {
    min-width: 38px;
  }
}

/* === BUTTONS === */
.btn {
  padding: var(--spacing-sm) var(--spacing-md);
  border: none;
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-base);
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-xs);
  text-decoration: none;
}

.btn-primary {
  background: var(--primary-gradient);
  color: white;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.btn-secondary {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  backdrop-filter: blur(10px);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-success {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
}

.btn-danger {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
}

.btn-small {
  padding: var(--spacing-xs) var(--spacing-sm);
  font-size: 0.875rem;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

/* Descriptive multi-line buttons */
.btn-create-group,
.btn-add-expense {
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding: 0.85rem 1.25rem;
  min-width: 140px;
}

.btn-create-group .btn-text,
.btn-add-expense .btn-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  line-height: 1.2;
  color: white;
}

.btn-create-group strong,
.btn-add-expense strong {
  font-size: 1rem;
  font-weight: 700;
  color: white;
}

.btn-create-group small,
.btn-add-expense small {
  font-size: 0.75rem;
  opacity: 0.95;
  font-weight: 500;
  color: white;
}

.btn-create-group .btn-icon,
.btn-add-expense .btn-icon {
  font-size: 1.5rem;
  background: rgba(255, 255, 255, 0.2);
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

@media (max-width: 768px) {
  .btn-create-group,
  .btn-add-expense {
    min-width: 120px;
    padding: 0.75rem 1rem;
  }
  
  .btn-create-group strong,
  .btn-add-expense strong {
    font-size: 0.9rem;
  }
  
  .btn-create-group small,
  .btn-add-expense small {
    font-size: 0.7rem;
  }
}

@media (max-width: 480px) {
  .btn-create-group,
  .btn-add-expense {
    min-width: 100%;
    padding: 1rem 1.25rem;
    gap: 0.5rem;
  }
  
  .btn-create-group .btn-icon,
  .btn-add-expense .btn-icon {
    font-size: 1.8rem;
    width: 3rem;
    height: 3rem;
    background: rgba(255, 255, 255, 0.25);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
  }
  
  .btn-create-group strong,
  .btn-add-expense strong {
    font-size: 1rem;
    font-weight: 800;
  }
  
  .btn-create-group small,
  .btn-add-expense small {
    font-size: 0.75rem;
    opacity: 1;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }
  
  /* Make it extra visible on mobile */
  .btn-create-group {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.4);
    position: relative;
    overflow: visible;
  }
  
  .btn-create-group::after {
    content: '👆 TAP HERE';
    position: absolute;
    bottom: -1.5rem;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.7rem;
    color: var(--primary-light);
    font-weight: 700;
    white-space: nowrap;
    animation: pulse 2s infinite;
  }
  
  @keyframes pulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
  }
}

/* === CONTAINER === */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: var(--spacing-lg);
}

/* === DASHBOARD SECTION === */
.dashboard-section {
  display: none;
}

.dashboard-section.active {
  display: block;
}

/* Stats Cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-xl);
}

.stat-card {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: var(--spacing-md);
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: var(--primary-gradient);
  opacity: 0;
  transition: opacity var(--transition-base);
}

.stat-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--glass-shadow);
}

.stat-card:hover::before {
  opacity: 1;
}

.stat-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--spacing-sm);
}

.stat-label {
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-icon {
  font-size: 1.5rem;
  opacity: 0.7;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Action Bar */
.action-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-lg);
  flex-wrap: wrap;
  gap: var(--spacing-md);
}

.action-bar h2 {
  margin: 0;
  flex-shrink: 0;
}

.action-bar h2 {
  font-size: 1.75rem;
  font-weight: 700;
}

/* Fund Filters */
.fund-filters {
  display: flex;
  gap: var(--spacing-sm);
  flex-wrap: wrap;
  margin-bottom: var(--spacing-lg);
}

.filter-btn {
  padding: var(--spacing-sm) var(--spacing-md);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-base);
  backdrop-filter: blur(10px);
}

.filter-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

.filter-btn.active {
  background: var(--primary-gradient);
  color: white;
  border-color: transparent;
}

/* Search and Sort Bar */
.search-sort-bar {
  display: flex;
  gap: var(--spacing-md);
  align-items: center;
  margin-bottom: var(--spacing-lg);
  flex-wrap: wrap;
}

.search-box-container {
  flex: 1;
  min-width: 250px;
}

.search-input {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  color: var(--text-primary);
  font-size: 0.95rem;
  transition: all var(--transition-base);
  backdrop-filter: blur(10px);
}

.search-input::placeholder {
  color: var(--text-secondary);
}

.search-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
  background: rgba(255, 255, 255, 0.08);
}

.sort-controls {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.sort-label {
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 500;
  white-space: nowrap;
}

.sort-select {
  padding: 0.75rem 1rem;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  color: var(--text-primary);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-base);
  backdrop-filter: blur(10px);
  min-width: 160px;
}

.sort-select:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.3);
}

.sort-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.sort-select option {
  padding: 0.5rem;
}

/* CRITICAL: Force proper contrast for select dropdowns in both themes */
[data-theme="dark"] .sort-select {
  background: rgba(255, 255, 255, 0.05) !important;
  border-color: rgba(255, 255, 255, 0.2) !important;
  color: #f1f5f9 !important;
}

[data-theme="dark"] .sort-select option {
  background: #1e293b !important;
  color: #f1f5f9 !important;
}

[data-theme="light"] .sort-select {
  background: rgba(0, 0, 0, 0.03) !important;
  border-color: rgba(0, 0, 0, 0.15) !important;
  color: #0f172a !important;
}

[data-theme="light"] .sort-select option {
  background: #ffffff !important;
  color: #0f172a !important;
}

/* Apply same fix to ALL select elements */
[data-theme="dark"] select {
  background: rgba(255, 255, 255, 0.05) !important;
  border-color: rgba(255, 255, 255, 0.2) !important;
  color: #f1f5f9 !important;
}

[data-theme="dark"] select option {
  background: #1e293b !important;
  color: #f1f5f9 !important;
}

[data-theme="light"] select {
  background: rgba(0, 0, 0, 0.03) !important;
  border-color: rgba(0, 0, 0, 0.15) !important;
  color: #0f172a !important;
}

[data-theme="light"] select option {
  background: #ffffff !important;
  color: #0f172a !important;
}

/* Input fields contrast fix */
[data-theme="dark"] input:not([type="checkbox"]):not([type="radio"]),
[data-theme="dark"] textarea {
  background: rgba(255, 255, 255, 0.05) !important;
  border-color: rgba(255, 255, 255, 0.2) !important;
  color: #f1f5f9 !important;
}

[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder {
  color: rgba(241, 245, 249, 0.5) !important;
}

[data-theme="light"] input:not([type="checkbox"]):not([type="radio"]),
[data-theme="light"] textarea {
  background: rgba(0, 0, 0, 0.03) !important;
  border-color: rgba(0, 0, 0, 0.15) !important;
  color: #0f172a !important;
}

[data-theme="light"] input::placeholder,
[data-theme="light"] textarea::placeholder {
  color: rgba(15, 23, 42, 0.5) !important;
}

/* Groups Grid */
.groups-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: var(--spacing-lg);
  margin-bottom: var(--spacing-xl);
}

/* Fund Card */
.fund-card {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: var(--spacing-lg);
  transition: all var(--transition-base);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.fund-card-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.fund-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--primary-gradient);
  opacity: 0;
  transition: opacity var(--transition-base);
}

.fund-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.fund-card:hover::before {
  opacity: 0.05;
}

.fund-card.fund-inactive {
  opacity: 0.6;
  filter: grayscale(50%);
}

.fund-card.fund-inactive:hover {
  transform: translateY(-2px);
  opacity: 0.7;
}

.fund-card-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* Fund Action Buttons */
.fund-actions {
  position: absolute;
  top: 1rem;
  right: 1rem;
  display: flex;
  gap: 0.75rem;
  z-index: 10;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(10px);
  padding: 0.4rem 0.5rem;
  border-radius: 1.5rem;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
}

[data-theme="light"] .fund-actions {
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
}

.fund-action-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  line-height: 1;
  padding: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.fund-pause-btn {
  background: rgba(251, 146, 60, 0.15);
  border-color: rgba(251, 146, 60, 0.5);
  color: #f97316;
}

.fund-pause-btn:hover {
  background: #f97316;
  border-color: #f97316;
  color: white;
  transform: scale(1.15);
  box-shadow: 0 4px 16px rgba(251, 146, 60, 0.5);
}

.fund-pause-btn:active {
  transform: scale(1.05);
}

.fund-hide-btn {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.5);
  color: var(--error);
}

.fund-hide-btn:hover {
  background: var(--error);
  border-color: var(--error);
  color: white;
  transform: scale(1.15);
  box-shadow: 0 4px 16px rgba(239, 68, 68, 0.5);
}

.fund-hide-btn:active {
  transform: scale(1.05);
}

.fund-card-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-sm);
  margin-bottom: var(--spacing-lg);
  text-align: center;
}

.fund-icon {
  font-size: 3rem;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.15));
}

.fund-card-title {
  flex: 1;
  width: 100%;
  text-align: center;
}

.fund-card-title h3 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: var(--spacing-sm);
  color: var(--text-primary);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

.fund-card-title p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.fund-badges {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-xs);
  margin-top: var(--spacing-xs);
  justify-content: center;
  min-height: auto;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-xs);
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge.type-travel { background: rgba(79, 172, 254, 0.2); color: #4facfe; }
.badge.type-savings { background: rgba(16, 185, 129, 0.2); color: #10b981; }
.badge.type-shared { background: rgba(245, 158, 11, 0.2); color: #f59e0b; }
.badge.type-other { background: rgba(147, 51, 234, 0.2); color: #9333ea; }

.badge.status-active { background: rgba(16, 185, 129, 0.2); color: #10b981; }
.badge.status-inactive { background: rgba(148, 163, 184, 0.2); color: #94a3b8; }

.badge.privacy-private { background: rgba(239, 68, 68, 0.2); color: #ef4444; }
.badge.privacy-public { background: rgba(34, 197, 94, 0.2); color: #22c55e; }

.badge.badge-creator { background: rgba(251, 191, 36, 0.2); color: #fbbf24; }

.fund-meta {
  display: flex;
  justify-content: center;
  gap: var(--spacing-lg);
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-top: auto;
  padding-top: var(--spacing-md);
  border-top: 1px solid var(--glass-border);
}

.fund-stats {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-lg);
  padding: var(--spacing-md);
  background: rgba(102, 126, 234, 0.05);
  border-radius: var(--radius-md);
}

.fund-stat {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.fund-stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  display: block;
}

.fund-stat-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.fund-stat-hint {
  font-size: 0.65rem;
  color: var(--text-secondary);
  opacity: 0.8;
  font-weight: 500;
  font-style: italic;
}

.fund-progress {
  margin-bottom: var(--spacing-sm);
}

.fund-progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: var(--spacing-xs);
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-full);
  overflow: hidden;
  position: relative;
}

.progress-fill {
  height: 100%;
  background: var(--primary-gradient);
  border-radius: var(--radius-full);
  transition: width var(--transition-slow);
  position: relative;
  overflow: hidden;
}

.progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  display: none;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.05), rgba(168, 85, 247, 0.05));
  border-radius: 24px;
  border: 2px dashed rgba(99, 102, 241, 0.2);
  margin-top: 2rem;
  min-height: 400px;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

.empty-state.active {
  display: flex;
}

.empty-icon {
  font-size: 6rem;
  opacity: 0.6;
  margin-bottom: 2rem;
  animation: float 3s ease-in-out infinite;
  background: linear-gradient(135deg, #6366f1, #a855f7);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

@keyframes float {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-10px);
  }
}

.empty-state h3 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.empty-state p {
  color: var(--text-secondary);
  margin-bottom: 2.5rem;
  font-size: 1.1rem;
  max-width: 500px;
  line-height: 1.6;
}

.empty-state .btn {
  padding: 1rem 2.5rem;
  font-size: 1.1rem;
  font-weight: 600;
  box-shadow: 0 8px 20px rgba(99, 102, 241, 0.3);
  transition: all 0.3s ease;
}

.empty-state .btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(99, 102, 241, 0.4);
}

/* === FUND DETAIL SECTION === */
.fund-detail-section {
  display: none;
}

.fund-detail-section.active {
  display: block;
}

.back-button {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-xs);
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: var(--spacing-lg);
  transition: color var(--transition-fast);
}

.back-button:hover {
  color: var(--text-primary);
}

/* Fund Header */
.fund-header {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: var(--spacing-lg);
  margin-bottom: var(--spacing-lg);
  position: relative;
  overflow: hidden;
}

.fund-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--primary-gradient);
  opacity: 0.03;
}

.fund-header-content {
  position: relative;
  z-index: 1;
}

.fund-detail-header {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin-bottom: var(--spacing-lg);
  position: relative;
  overflow: hidden;
}

.fund-detail-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--primary-gradient);
  opacity: 0.03;
}

/* Back Button Integrated */
.back-button-integrated {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1rem;
  background: transparent;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-base);
  margin-bottom: 2rem;
}

.back-button-integrated:hover {
  background: rgba(102, 126, 234, 0.1);
  border-color: var(--primary);
  color: var(--primary);
  transform: translateX(-4px);
}

.back-icon {
  font-size: 1.125rem;
  transition: transform var(--transition-base);
}

.back-button-integrated:hover .back-icon {
  transform: translateX(-2px);
}

.fund-header-content {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 800px;
  margin: 0 auto 2.5rem auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.fund-header-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.1));
  animation: floatIcon 3s ease-in-out infinite;
}

@keyframes floatIcon {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.fund-header-title {
  font-size: 2.25rem;
  font-weight: 800;
  margin-bottom: 0.75rem;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
}

.fund-header-description {
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 1rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* Edit Group Button */
#editGroupInfoBtn {
  background: rgba(102, 126, 234, 0.1);
  border: 1px solid rgba(102, 126, 234, 0.3);
  border-radius: 8px;
  padding: 0.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 1.1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  min-height: 36px;
}

#editGroupInfoBtn:hover {
  background: rgba(102, 126, 234, 0.2);
  border-color: rgba(102, 126, 234, 0.5);
  transform: translateY(-2px);
}

#editGroupInfoBtn:active {
  transform: translateY(0);
}

.fund-badges {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* Integrated Stats */
.fund-stats-integrated {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--glass-border);
}

.fund-stat-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-md);
  transition: all var(--transition-base);
}

.fund-stat-card:hover {
  background: rgba(102, 126, 234, 0.08);
  transform: translateY(-2px);
}

.fund-stat-card .stat-icon {
  font-size: 2rem;
  flex-shrink: 0;
  opacity: 0.9;
}

.fund-stat-card .stat-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.fund-stat-card .stat-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.fund-stat-card .stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
}

.fund-stat-card .stat-breakdown {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.fund-header-top {
  display: flex;
  align-items: flex-start;
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-md);
}

.fund-header-info {
  flex: 1;
}

.fund-header-info h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: var(--spacing-xs);
}

.fund-header-info p {
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Fund Stats Bar - Legacy (hidden, using integrated stats now) */
.fund-stats-bar {
  display: none;
}

.fund-stats-bar:empty {
  display: none;
  margin-bottom: 0;
}

.fund-stat-item {
  text-align: center;
  padding: 1.25rem;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.fund-stat-item.stat-balance {
  grid-column: 1 / -1;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(168, 85, 247, 0.1) 100%);
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.stat-label {
  font-size: 0.875rem;
  color: var(--text-secondary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
  word-break: break-word;
}

.stat-breakdown {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.stat-breakdown .currency-code {
  font-size: 0.75rem;
  opacity: 0.7;
  font-weight: 600;
}

/* Progress Section */
.progress-section {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: var(--spacing-md);
  margin-bottom: var(--spacing-lg);
}

.progress-section h3 {
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: var(--spacing-md);
}

.progress-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: var(--spacing-xs);
}

.progress-bar-large {
  width: 100%;
  height: 12px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-full);
  overflow: hidden;
  position: relative;
}

.progress-bar-large .progress-fill {
  height: 100%;
}

/* Pending Invitations Section */
.pending-invitations-section {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: var(--spacing-lg);
  margin-bottom: var(--spacing-lg);
}

.invitations-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-md);
}

.invitations-header h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0;
}

.invitations-count {
  background: linear-gradient(135deg, #f59e0b 0%, #f97316 100%);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  font-weight: 700;
}

.invitations-list {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.invitation-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: var(--spacing-md);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--spacing-md);
  transition: all var(--transition-base);
}

.invitation-item:hover {
  background: rgba(255, 255, 255, 0.05);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.invitation-item-info {
  flex: 1;
}

.invitation-item-info h4 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
}

.invitation-item-info p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin: 0;
}

.invitation-item-actions {
  display: flex;
  gap: var(--spacing-xs);
}

.btn-sm {
  padding: 0.375rem 0.875rem;
  font-size: 0.875rem;
  border-radius: var(--radius-md);
}

/* Info Box in Invite Tab */
.invite-info-box {
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: var(--radius-md);
  padding: var(--spacing-md);
  margin-bottom: var(--spacing-lg);
}

.invite-info-box p {
  margin: 0 0 var(--spacing-xs) 0;
  color: var(--primary-light);
  font-size: 0.875rem;
}

.invite-info-box ul {
  margin: 0;
  padding-left: 1.5rem;
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.invite-info-box ul li {
  margin-bottom: 0.25rem;
}

/* Invitation Banner (in fund detail) */
.invitation-banner {
  background: linear-gradient(135deg, #f59e0b 0%, #f97316 100%);
  border-radius: var(--radius-lg);
  padding: var(--spacing-md);
  margin-bottom: var(--spacing-lg);
  display: none;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
}

.invitation-banner.active {
  display: flex;
}

.invitation-content {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
}

.invitation-icon {
  font-size: 2rem;
}

.invitation-content p {
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
}

/* Closed Fund Banner */
.closed-fund-banner {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  border-radius: var(--radius-lg);
  padding: var(--spacing-lg);
  margin-bottom: var(--spacing-lg);
  display: none;
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
  border: 2px solid rgba(255, 255, 255, 0.1);
}

.closed-fund-banner.active {
  display: flex;
}

.closed-fund-content {
  display: flex;
  align-items: flex-start;
  gap: var(--spacing-lg);
  width: 100%;
}

.closed-fund-icon {
  font-size: 3rem;
  flex-shrink: 0;
}

.closed-fund-content h4 {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0 0 var(--spacing-sm) 0;
  color: var(--text-primary);
}

.closed-fund-content p {
  font-size: 0.95rem;
  margin: 0;
  opacity: 0.9;
  line-height: 1.5;
}

/* Member cards styling */
.member-card {
  background: var(--glass-bg);
  border: 2px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 1rem;
  margin-bottom: 0.75rem;
  transition: all 0.3s ease;
}

.member-card:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
  transform: translateY(-2px);
}

[data-theme="dark"] .member-card {
  background: rgba(30, 41, 59, 0.6);
  border: 2px solid rgba(102, 126, 234, 0.3);
}

[data-theme="dark"] .member-card:hover {
  background: rgba(30, 41, 59, 0.8);
  border-color: rgba(102, 126, 234, 0.5);
}

/* Tabs */
.fund-tabs {
  display: flex;
  gap: var(--spacing-xs);
  margin-bottom: var(--spacing-lg);
  border-bottom: 2px solid rgba(255, 255, 255, 0.1);
  overflow-x: auto;
  scrollbar-width: none;
}

.fund-tabs::-webkit-scrollbar {
  display: none;
}

/* Improve tab button visibility in light mode */
[data-theme="light"] .fund-tabs {
  border-bottom: 2px solid #cbd5e1;
}

[data-theme="light"] .fund-tab-btn,
[data-theme="light"] .tab-btn {
  color: #64748b;
  background: transparent;
}

[data-theme="light"] .fund-tab-btn:hover,
[data-theme="light"] .tab-btn:hover {
  color: #0f172a;
  background: rgba(102, 126, 234, 0.05);
}

[data-theme="light"] .fund-tab-btn.active,
[data-theme="light"] .tab-btn.active {
  color: #667eea;
  border-bottom-color: #667eea;
  background: rgba(102, 126, 234, 0.08);
}

/* Fund Tab Buttons */
.fund-tab-btn,
.tab-btn {
  padding: var(--spacing-sm) var(--spacing-md);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  margin-bottom: -2px;
}

.fund-tab-btn:hover,
.tab-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.fund-tab-btn.active,
.tab-btn.active {
  color: var(--primary-light);
  border-bottom-color: var(--primary-light);
}

/* Tab Content */
.tab-pane,
.tab-content {
  display: none;
}

.tab-pane.active,
.tab-content.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.tab-panel,
.tab-card {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: var(--spacing-lg);
}

[data-theme="light"] .tab-panel,
[data-theme="light"] .tab-card {
  background: white;
  border: 2px solid #94a3b8;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.tab-panel h3,
.tab-card h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: var(--spacing-md);
}

.tab-card p {
  color: var(--text-secondary);
  margin-bottom: var(--spacing-lg);
  line-height: 1.6;
}

/* Form Groups */
.form-group {
  margin-bottom: var(--spacing-md);
}

.form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: var(--spacing-xs);
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: var(--spacing-sm) var(--spacing-md);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 1rem;
  font-family: inherit;
  transition: all var(--transition-fast);
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group textarea {
  resize: vertical;
  min-height: 100px;
}

.form-group small {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: var(--spacing-xs);
}

.info-box {
  background: rgba(59, 130, 246, 0.1);
  border-left: 4px solid var(--info);
  border-radius: var(--radius-md);
  padding: var(--spacing-md);
  margin-bottom: var(--spacing-md);
}

.info-box p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin: 0;
}

/* Members List */
.members-list {
  display: grid;
  gap: var(--spacing-sm);
}

.member-item {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  padding: var(--spacing-md);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.member-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

.member-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--primary-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}

.member-info {
  flex: 1;
}

.member-name {
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.member-address {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: 'Courier New', monospace;
}

.member-contribution {
  text-align: right;
}

.contribution-amount {
  font-weight: 700;
  color: var(--accent-green);
  display: block;
}

.contribution-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Proposals List */
.proposals-list {
  display: grid;
  gap: var(--spacing-md);
}

.proposal-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: var(--spacing-md);
  transition: all var(--transition-fast);
}

.proposal-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

.proposal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--spacing-md);
}

.proposal-id {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.proposal-amount {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent-green);
}

.proposal-description {
  color: var(--text-secondary);
  margin-bottom: var(--spacing-md);
  line-height: 1.6;
}

.proposal-meta {
  display: flex;
  gap: var(--spacing-md);
  flex-wrap: wrap;
  margin-bottom: var(--spacing-md);
  font-size: 0.9rem;
}

.proposal-meta span {
  color: var(--text-secondary);
  font-family: system-ui, -apple-system, sans-serif;
}

.proposal-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: var(--spacing-sm);
  margin-bottom: var(--spacing-md);
  padding: var(--spacing-sm);
  background: rgba(255, 255, 255, 0.02);
  border-radius: var(--radius-md);
}

.proposal-detail {
  font-size: 0.75rem;
}

.proposal-detail-label {
  color: var(--text-muted);
  display: block;
  margin-bottom: 0.25rem;
}

.proposal-detail-value {
  color: var(--text-primary);
  font-weight: 600;
}

.proposal-votes {
  display: flex;
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-md);
}

.vote-count {
  flex: 1;
  text-align: center;
  padding: var(--spacing-sm);
  border-radius: var(--radius-md);
}

.vote-count.for {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.vote-count.against {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.vote-count-number {
  font-size: 1.5rem;
  font-weight: 700;
  display: block;
}

.vote-count.for .vote-count-number {
  color: var(--success);
}

.vote-count.against .vote-count-number {
  color: var(--error);
}

.vote-count-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.proposal-actions {
  display: flex;
  gap: var(--spacing-sm);
}

.proposal-actions .btn {
  flex: 1;
}

/* === MODALS === */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(10px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-lg);
  animation: fadeIn 0.3s ease;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: var(--bg-secondary);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
  animation: slideUp 0.3s ease;
  display: flex;
  flex-direction: column;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-header {
  padding: var(--spacing-lg);
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.modal-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.5rem;
  cursor: pointer;
  transition: color var(--transition-fast);
  padding: var(--spacing-xs);
  line-height: 1;
}

.modal-close:hover {
  color: var(--text-primary);
}

.modal-body {
  padding: var(--spacing-lg);
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}

.modal-footer {
  padding: var(--spacing-lg);
  border-top: 1px solid var(--glass-border);
  display: flex;
  gap: var(--spacing-sm);
  justify-content: flex-end;
  flex-shrink: 0;
}

/* Fund Type Cards */
.fund-types {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-lg);
}

.fund-type-card {
  background: var(--glass-bg);
  border: 2px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: var(--spacing-md);
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-base);
}

.fund-type-card:hover {
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-3px);
}

.fund-type-card.selected {
  border-color: var(--primary-light);
  background: rgba(102, 126, 234, 0.1);
}

.fund-type-icon {
  font-size: 2rem;
  margin-bottom: var(--spacing-xs);
}

.fund-type-name {
  font-size: 0.875rem;
  font-weight: 600;
}

/* Toggle Switch */
.toggle-group {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--spacing-md);
}

.toggle-switch {
  position: relative;
  width: 50px;
  height: 26px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 26px;
  transition: var(--transition-base);
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 4px;
  bottom: 4px;
  background: white;
  border-radius: 50%;
  transition: var(--transition-base);
}

.toggle-switch input:checked + .toggle-slider {
  background: var(--primary-gradient);
}

/* ============================================
   MANAGE TAB - FUND MANAGEMENT
   ============================================ */

.manage-section {
  padding: 1rem 0;
}

.member-management-section {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 2rem;
  margin-bottom: 2rem;
}

.member-management-section h4 {
  color: var(--text-primary);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.kick-members-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1.5rem;
}

.kick-member-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.2s ease;
}

.kick-member-card:hover {
  background: rgba(255, 255, 255, 0.05);
  transform: translateX(4px);
}

.member-info {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex: 1;
}

.member-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--primary-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}

.member-details {
  flex: 1;
}

.member-name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.member-stats {
  display: flex;
  gap: 1rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.member-stats span {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.danger-zone {
  background: rgba(255, 67, 54, 0.05);
  border: 2px solid rgba(255, 67, 54, 0.2);
  border-radius: 12px;
  padding: 2rem;
}

.danger-zone h4 {
  color: #ff4336;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.danger-zone .help-text {
  color: var(--text-secondary);
  margin: 0.5rem 0 1rem 0;
  line-height: 1.6;
}

.warning-box {
  background: rgba(255, 152, 0, 0.1);
  border: 1px solid rgba(255, 152, 0, 0.3);
  border-radius: 8px;
  padding: 1rem;
  margin: 1rem 0;
}

.warning-box p {
  color: #ff9800;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.warning-box ul {
  margin: 0.5rem 0 0 1.5rem;
  color: var(--text-secondary);
}

.warning-box li {
  margin: 0.25rem 0;
}

.distribution-preview {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 1.5rem;
  margin: 1rem 0;
}

.distribution-preview h5 {
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.distribution-table {
  overflow-x: auto;
  margin-bottom: 1rem;
}

.distribution-table table {
  width: 100%;
  border-collapse: collapse;
}

.distribution-table th,
.distribution-table td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.distribution-table th {
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.875rem;
  text-transform: uppercase;
}

.distribution-table td {
  color: var(--text-primary);
}

.distribution-table td.highlight {
  color: var(--primary-color);
  font-weight: 600;
}

.total-distribution {
  background: var(--primary-gradient);
  color: white;
  padding: 1rem;
  border-radius: 8px;
  text-align: center;
  font-size: 1.1rem;
  margin-top: 1rem;
}

.button-group {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
}

.button-group .btn {
  flex: 1;
}

@media (max-width: 768px) {
  .button-group {
    flex-direction: column;
  }
  
  .distribution-table {
    font-size: 0.875rem;
  }
  
  .distribution-table th,
  .distribution-table td {
    padding: 0.5rem;
  }
}

.toggle-switch input:checked + .toggle-slider:before {
  transform: translateX(24px);
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
  .header-container {
    padding: 0 var(--spacing-md);
  }
  
  .container {
    padding: 0.75rem;
    max-width: 100%;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
    gap: 0.5rem;
    margin-bottom: var(--spacing-md);
  }
  
  .stat-card {
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
  }
  
  .stat-card:hover {
    transform: none;
  }
  
  .stat-icon {
    font-size: 1.75rem;
    flex-shrink: 0;
  }
  
  .stat-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
  
  .stat-content h3 {
    font-size: 1.5rem;
    margin: 0;
    font-weight: 700;
  }
  
  .stat-content p {
    margin: 0;
    font-size: 0.8rem;
    color: var(--text-secondary);
  }
  
  .groups-grid {
    grid-template-columns: 1fr;
  }
  
  .fund-detail-header {
    padding: 1.5rem;
  }

  .fund-header-icon {
    font-size: 3.5rem;
  }

  .fund-header-title {
    font-size: 1.875rem;
  }

  .fund-header-description {
    font-size: 0.9375rem;
  }

  .fund-stats-integrated {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .fund-stat-card {
    padding: 0.875rem;
  }
  
  .action-bar {
    flex-direction: column;
    align-items: stretch;
  }
  
  .fund-tabs {
    gap: 0;
  }
  
  .tab-btn {
    flex: 1;
    justify-content: center;
  }
  
  #toastContainer {
    top: var(--spacing-sm);
    right: var(--spacing-sm);
    left: var(--spacing-sm);
  }
  
  .toast {
    min-width: auto;
    max-width: calc(100vw - 2rem);
    margin: 0 1rem;
    padding: 0.75rem;
    font-size: 0.875rem;
    word-wrap: break-word;
  }
  
  .modal-content {
    margin: var(--spacing-sm);
  }
  
  .fund-types {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .proposal-actions {
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .logo {
    font-size: 1.25rem;
  }
  
  /* Stats Grid - Extra Compact */
  .stats-grid {
    gap: 0.4rem;
    margin-bottom: 1rem;
  }
  
  .stat-card {
    padding: 0.6rem 0.85rem;
  }
  
  .stat-icon {
    font-size: 1.5rem;
  }
  
  .stat-content h3 {
    font-size: 1.3rem;
  }
  
  .stat-content p {
    font-size: 0.75rem;
  }

  .fund-detail-header {
    padding: 1.25rem;
  }

  .back-button-integrated {
    font-size: 0.8125rem;
    padding: 0.5rem 0.75rem;
    margin-bottom: 1.5rem;
  }

  .fund-header-content {
    margin-bottom: 1.5rem;
  }

  .fund-header-icon {
    font-size: 3rem;
  }

  .fund-header-title {
    font-size: 1.5rem;
  }

  .fund-header-description {
    font-size: 0.875rem;
  }

  .fund-stat-card .stat-icon {
    font-size: 1.5rem;
  }

  .fund-stat-card .stat-value {
    font-size: 1.25rem;
  }
  
  /* Search and Sort Bar - Mobile */
  .search-sort-bar {
    flex-direction: column;
    gap: 0.75rem;
  }
  
  .search-box-container {
    width: 100%;
    min-width: unset;
  }
  
  .sort-controls {
    width: 100%;
    justify-content: space-between;
  }
  
  .sort-select {
    flex: 1;
    min-width: unset;
  }
  
  /* Make fund cards more compact */
  .groups-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
  
  .fund-card {
    padding: 1rem;
  }
  
  .fund-card-header {
    gap: 0.5rem;
    margin-bottom: 1rem;
  }
  
  .fund-icon {
    font-size: 2.5rem;
  }
  
  .fund-card-title h3 {
    font-size: 1.1rem;
    line-height: 1.3;
  }
  
  .fund-badges {
    gap: 0.35rem;
    margin-top: 0.5rem;
  }
  
  .badge {
    font-size: 0.65rem;
    padding: 0.2rem 0.5rem;
  }
  
  .fund-stats {
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding: 0.75rem;
  }
  
  .fund-stat-value {
    font-size: 1.25rem;
  }
  
  .fund-stat-label {
    font-size: 0.7rem;
  }
  
  .fund-stat-hint {
    font-size: 0.6rem;
  }
  
  .fund-meta {
    font-size: 0.8rem;
    gap: 1rem;
    padding-top: 0.75rem;
  }
  
  /* Action bar optimizations */
  .action-bar {
    margin-bottom: 1.5rem;
    gap: 1rem;
    flex-direction: column;
    align-items: stretch;
  }
  
  .action-bar h2 {
    font-size: 1.5rem;
    text-align: center;
    margin-bottom: 0.5rem;
  }
  
  .action-bar .btn {
    width: 100%;
  }
  
  /* Fund filters */
  .fund-filters {
    gap: 0.5rem;
    margin-bottom: 0.85rem;
  }
  
  .filter-btn {
    padding: 0.5rem 0.85rem;
    font-size: 0.8rem;
  }
  
  .fund-header-top {
    gap: 0.75rem;
  }
  
  .fund-header-icon {
    font-size: 2rem;
  }
  
  .fund-header-info h1 {
    font-size: 1.3rem;
    line-height: 1.3;
  }
  
  .fund-header-info p {
    font-size: 0.85rem;
    line-height: 1.4;
  }
  
  /* Fund stats responsive handled by fund-stats-integrated */
  
  .stat-value {
    font-size: 1.1rem;
  }
  
  .stat-label {
    font-size: 0.75rem;
  }
  
  .stat-breakdown {
    font-size: 0.75rem;
  }
  
  .fund-stat-item {
    padding: 0.6rem;
  }
  
  /* Adjust action buttons for mobile */
  .fund-actions {
    padding: 0.3rem 0.4rem;
    gap: 0.5rem;
  }
  
  .fund-action-btn {
    width: 32px;
    height: 32px;
    font-size: 1rem;
  }
  
  /* Mobile modal optimizations */
  .modal {
    padding: var(--spacing-xs);
  }
  
  .modal-content {
    max-width: 100%;
    max-height: 95vh;
    margin: 0;
    border-radius: var(--radius-md);
  }
  
  .modal-header {
    padding: var(--spacing-md);
  }
  
  .modal-header h2 {
    font-size: 1.1rem;
    line-height: 1.3;
    padding-right: 2rem;
  }
  
  .modal-body {
    padding: var(--spacing-sm) var(--spacing-md);
  }
  
  .modal-footer {
    padding: var(--spacing-md);
    flex-direction: column;
  }
  
  .modal-footer .btn {
    width: 100%;
  }
  
  /* Form elements for mobile */
  .form-group {
    margin-bottom: var(--spacing-sm);
  }
  
  .form-group label {
    font-size: 0.8rem;
    margin-bottom: 0.35rem;
  }
  
  .form-group input,
  .form-group textarea,
  .form-group select {
    font-size: 0.9rem;
    padding: 0.6rem 0.75rem;
  }
  
  .form-group textarea {
    min-height: 70px;
  }
  
  .form-group small {
    font-size: 0.7rem;
    line-height: 1.3;
  }
  
  /* Member selection compact */
  .member-item {
    padding: 0.6rem 0.75rem;
    gap: 0.6rem;
  }
  
  .member-avatar {
    width: 32px;
    height: 32px;
    font-size: 0.9rem;
  }
  
  .member-info h4 {
    font-size: 0.85rem;
  }
  
  .member-info p {
    font-size: 0.7rem;
  }
  
  /* Category selection */
  .category-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
  }
  
  .category-option {
    padding: 0.6rem 0.5rem;
    font-size: 0.8rem;
  }
  
  .category-option .category-icon {
    font-size: 1.2rem;
  }
  
  /* Expense split items */
  .split-item {
    padding: 0.6rem 0.75rem;
    gap: 0.6rem;
  }
  
  .split-item input {
    font-size: 0.85rem;
    padding: 0.4rem 0.6rem;
    max-width: 80px;
  }
  
  /* Info boxes */
  .info-box {
    padding: 0.65rem 0.75rem;
    font-size: 0.8rem;
    line-height: 1.4;
  }
  
  /* Buttons */
  .btn {
    font-size: 0.85rem;
    padding: 0.65rem 1rem;
  }
  
  .btn-sm {
    font-size: 0.75rem;
    padding: 0.45rem 0.75rem;
  }
  
  /* Checkbox and radio inputs */
  input[type="checkbox"],
  input[type="radio"] {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
  }
  
  /* Fund type cards in create fund modal */
  .fund-types {
    grid-template-columns: 1fr;
    gap: 0.65rem;
  }
  
  .fund-type-card {
    padding: 0.85rem;
  }
  
  .fund-type-card h3 {
    font-size: 0.95rem;
  }
  
  .fund-type-card p {
    font-size: 0.75rem;
    line-height: 1.4;
  }
  
  /* Settlement cards in simplify modal */
  .settlement-card {
    padding: 0.75rem;
    gap: 0.6rem;
  }
  
  .settlement-amount {
    font-size: 1rem;
  }
  
  /* Improve scrolling on modals */
  .modal-body {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Date inputs */
  input[type="date"] {
    font-size: 0.85rem;
    padding: 0.55rem 0.65rem;
  }
  
  /* Select dropdowns */
  select {
    font-size: 0.85rem;
    padding: 0.6rem 0.75rem;
    background-position: right 0.5rem center;
    background-size: 12px;
  }
}

/* === UTILITY CLASSES === */
.hidden {
  display: none !important;
}

.text-center {
  text-align: center;
}

.text-right {
  text-align: right;
}

.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: var(--spacing-xs) !important; }
.mb-2 { margin-bottom: var(--spacing-sm) !important; }
.mb-3 { margin-bottom: var(--spacing-md) !important; }
.mb-4 { margin-bottom: var(--spacing-lg) !important; }

.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: var(--spacing-xs) !important; }

/* === HISTORY TAB === */
.status-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.status-executed {
  background: rgba(34, 197, 94, 0.2);
  color: #22c55e;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.status-cancelled {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.status-expired {
  background: rgba(156, 163, 175, 0.2);
  color: #9ca3af;
  border: 1px solid rgba(156, 163, 175, 0.3);
}

.status-approved {
  background: rgba(59, 130, 246, 0.2);
  color: #3b82f6;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.status-active {
  background: rgba(234, 179, 8, 0.2);
  color: #eab308;
  border: 1px solid rgba(234, 179, 8, 0.3);
}

.proposal-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: var(--spacing-md);
  margin-bottom: var(--spacing-md);
  transition: all var(--transition-fast);
}

.proposal-card:hover {
  background: rgba(255, 255, 255, 0.05);
  transform: translateY(-2px);
}

.proposal-executed {
  border-left: 3px solid #22c55e;
}

.proposal-cancelled {
  border-left: 3px solid #ef4444;
  opacity: 0.7;
}

.proposal-expired {
  border-left: 3px solid #9ca3af;
  opacity: 0.6;
}

.proposal-approved {
  border-left: 3px solid #3b82f6;
}

.proposal-active {
  border-left: 3px solid #eab308;
}

.tab-description {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: var(--spacing-md);
}

/* === BALANCES TAB === */
.balances-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-lg);
}

.balance-stat-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: var(--spacing-md);
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  transition: all var(--transition-fast);
}

.balance-stat-card:hover {
  background: rgba(255, 255, 255, 0.05);
  transform: translateY(-2px);
}

.balance-stat-card.positive {
  border-left: 3px solid #22c55e;
}

.balance-stat-card.negative {
  border-left: 3px solid #ef4444;
}

.balance-stat-card.neutral {
  border-left: 3px solid #3b82f6;
}

.balance-stat-icon {
  font-size: 2rem;
  flex-shrink: 0;
}

.balance-stat-content {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.balance-stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.balance-stat-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
}

.balance-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: var(--spacing-md);
  margin-bottom: var(--spacing-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all var(--transition-fast);
}

.balance-item:hover {
  background: rgba(255, 255, 255, 0.05);
  transform: translateX(4px);
}

.balance-item.positive {
  border-left: 4px solid #22c55e;
}

.balance-item.negative {
  border-left: 4px solid #ef4444;
}

.balance-item.neutral {
  border-left: 4px solid #64748b;
  opacity: 0.7;
}

.balance-item-info {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  flex: 1;
}

.balance-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--primary-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}

.balance-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.balance-name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.balance-details .btn-sm {
  align-self: flex-start;
  margin-top: 0.5rem;
  font-size: 0.875rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  color: white;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.balance-details .btn-sm:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

.balance-details .btn-sm:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.balance-breakdown {
  font-size: 0.85rem;
  color: var(--text-muted);
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.balance-breakdown span {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.balance-amount {
  font-size: 1.25rem;
  font-weight: 700;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  white-space: nowrap;
}

.balance-amount.positive {
  color: #22c55e;
  background: rgba(34, 197, 94, 0.1);
}

.balance-amount.negative {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
}

.balance-amount.neutral {
  color: var(--text-muted);
  background: rgba(100, 116, 139, 0.1);
}

.mt-2 { margin-top: var(--spacing-sm) !important; }
.mt-3 { margin-top: var(--spacing-md) !important; }
.mt-4 { margin-top: var(--spacing-lg) !important; }

/* ============================================
   CREATE FUND MODAL - IMPROVED DESIGN
   ============================================ */

/* Form Sections */
.form-section {
  margin-bottom: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.form-section:last-of-type {
  border-bottom: none;
  margin-bottom: 1.5rem;
}

.section-header {
  margin-bottom: 1.5rem;
}

.section-header h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.section-header p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin: 0;
}

/* Modern Inputs */
.input-modern {
  background: rgba(255, 255, 255, 0.03) !important;
  border: 2px solid rgba(255, 255, 255, 0.1) !important;
  transition: all 0.3s ease !important;
}

.input-modern:focus {
  background: rgba(255, 255, 255, 0.05) !important;
  border-color: var(--primary-light) !important;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1) !important;
}

/* Label Improvements */
.label-text {
  font-weight: 600;
  color: var(--text-primary);
}

.label-required {
  color: #ef4444;
  margin-left: 4px;
}

.label-badge {
  display: inline-block;
  padding: 2px 8px;
  background: rgba(99, 102, 241, 0.15);
  color: var(--primary-light);
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-left: 8px;
}

.form-hint {
  display: block;
  margin-top: 0.5rem;
  color: var(--text-secondary) !important;
  font-size: 0.8rem;
}

/* Input with Prefix/Suffix */
.input-with-prefix,
.input-with-suffix {
  position: relative;
  display: flex;
  align-items: center;
}

.input-prefix,
.input-suffix {
  position: absolute;
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.9rem;
  pointer-events: none;
  z-index: 1;
}

.input-prefix {
  left: 16px;
}

.input-suffix {
  right: 16px;
}

.input-with-prefix input {
  padding-left: 4rem !important;
}

.input-with-suffix input {
  padding-right: 3.5rem !important;
}

/* Fund Type Grid */
.fund-type-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
}

.fund-type-card {
  position: relative;
  background: rgba(255, 255, 255, 0.02);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 1.5rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  overflow: hidden;
}

.fund-type-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(168, 85, 247, 0.1));
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 0;
}

.fund-type-card:hover {
  border-color: rgba(99, 102, 241, 0.4);
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(99, 102, 241, 0.2);
}

.fund-type-card:hover::before {
  opacity: 1;
}

.fund-type-card input[type=\"radio\"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.fund-type-card:has(input:checked) {
  border-color: var(--primary-light);
  background: rgba(99, 102, 241, 0.1);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.fund-type-card:has(input:checked)::before {
  opacity: 1;
}

.fund-type-card:has(input:checked) .card-checkmark {
  opacity: 1;
  transform: scale(1);
}

.fund-type-content {
  position: relative;
  z-index: 1;
  transition: transform 0.2s ease;
}

.fund-type-icon {
  font-size: 3rem;
  margin-bottom: 0.75rem;
  display: block;
}

.fund-type-content h4 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.fund-type-content p {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin: 0;
}

.card-checkmark {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 24px;
  height: 24px;
  background: var(--primary-gradient);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 14px;
  opacity: 0;
  transform: scale(0);
  transition: all 0.3s ease;
  z-index: 2;
}

/* Toggle Option */
.toggle-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem;
  background: rgba(255, 255, 255, 0.02);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.toggle-option:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(99, 102, 241, 0.3);
}

.toggle-option-info {
  flex: 1;
}

.toggle-option-title {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
  font-size: 0.95rem;
}

.toggle-option-desc {
  font-size: 0.825rem;
  color: var(--text-secondary);
}

/* Governance Grid */
.governance-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
}

/* Disconnect Button */
#disconnectWallet {
  margin-left: 0.75rem;
}

#disconnectWallet:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.3);
  color: #ef4444;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* ============================================
   SETTINGS BUTTON & MODAL
   ============================================ */

/* Settings Button in App Header */
.settings-btn-app {
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: var(--accent-purple);
  font-size: 1.25rem;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  transition: all var(--transition-base);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.settings-btn-app:hover {
  background: var(--accent-purple);
  color: white;
  transform: rotate(90deg) scale(1.1);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* Modal Overlay */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-base);
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

/* Settings Modal */
.settings-modal {
  background: var(--bg-secondary);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--glass-shadow);
  transform: scale(0.9);
  transition: transform var(--transition-base);
}

.modal-overlay.active .settings-modal {
  transform: scale(1);
}

/* Settings Header */
.settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--spacing-lg);
  border-bottom: 1px solid var(--glass-border);
}

.settings-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.close-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 2rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.close-btn:hover {
  background: rgba(239, 68, 68, 0.1);
  color: var(--error);
  transform: rotate(90deg);
}

/* Settings Content */
.settings-content {
  padding: var(--spacing-lg);
}

.setting-group {
  margin-bottom: var(--spacing-lg);
}

.setting-group:last-child {
  margin-bottom: 0;
}

.setting-group label {
  display: block;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--spacing-sm);
}

.setting-options {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.setting-option {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-sm) 1.25rem;
  background: rgba(99, 102, 241, 0.05);
  border: 2px solid var(--glass-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-base);
  font-size: 1rem;
  font-family: inherit;
  text-align: left;
  font-weight: 500;
}

.setting-option:hover {
  background: rgba(99, 102, 241, 0.1);
  border-color: rgba(99, 102, 241, 0.3);
  transform: translateX(4px);
}

.setting-option.active {
  background: rgba(99, 102, 241, 0.25);
  border-color: var(--accent-purple);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.option-flag,
.option-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.setting-option span:nth-child(2) {
  flex: 1;
}

.option-check {
  color: var(--accent-purple);
  font-size: 1.25rem;
  font-weight: bold;
  opacity: 0;
  transition: opacity var(--transition-base);
}

.setting-option.active .option-check {
  opacity: 1;
}

/* CRITICAL: Force proper text contrast in both themes */
/* Dark Mode: ALL buttons MUST have light text */
[data-theme="dark"] .setting-option,
[data-theme="dark"] .setting-option span,
[data-theme="dark"] .setting-option.active,
[data-theme="dark"] .setting-option.active span {
  color: #f1f5f9 !important;
}

/* Light Mode: ALL buttons MUST have dark text */
[data-theme="light"] .setting-option,
[data-theme="light"] .setting-option span,
[data-theme="light"] .setting-option.active,
[data-theme="light"] .setting-option.active span {
  color: #0f172a !important;
}

/* Active button backgrounds for better visibility */
[data-theme="dark"] .setting-option.active {
  background: rgba(99, 102, 241, 0.3);
}

[data-theme="light"] .setting-option.active {
  background: rgba(99, 102, 241, 0.2);
}

/* Responsive Settings Modal */
@media (max-width: 640px) {
  .settings-modal {
    width: 95%;
    max-height: 85vh;
  }

  .settings-header,
  .settings-content {
    padding: 1.5rem;
  }

  .settings-header h2 {
    font-size: 1.25rem;
  }

  .setting-option {
    padding: 0.875rem 1rem;
  }
}

/* QR Scanner Styles */
.input-with-button {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
}

.input-with-button input {
  flex: 1;
}

.btn-qr-scan {
  padding: 0.75rem 1rem;
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-blue));
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: 1.5rem;
  cursor: pointer;
  transition: all var(--transition-base);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
  flex-shrink: 0;
  min-width: 50px;
}

.btn-qr-scan:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.btn-qr-scan:active {
  transform: translateY(0);
}

.qr-scanner-modal {
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
}

.qr-reader {
  width: 100%;
  min-height: 300px;
  background: var(--glass-bg);
  border: 2px dashed var(--glass-border);
  border-radius: var(--radius-md);
  margin: 1.5rem 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.qr-warning {
  background: rgba(255, 193, 7, 0.1);
  border: 2px solid rgba(255, 193, 7, 0.3);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-bottom: 1rem;
}

.qr-warning p strong {
  color: #ffa000;
  font-size: 1.1rem;
}

.qr-warning ul {
  margin: 0.75rem 0 0 1.5rem;
  padding: 0;
}

.qr-warning li {
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.qr-warning li strong {
  color: #ffa000;
}

.scan-result-box {
  background: rgba(76, 175, 80, 0.1);
  border: 2px solid rgba(76, 175, 80, 0.3);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-bottom: 1rem;
}

.scan-result-box p strong {
  color: #4caf50;
}

.address-display {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  margin-top: 0.5rem;
  word-break: break-all;
  font-family: 'Courier New', monospace;
}

.address-display code {
  color: var(--accent-purple);
  font-size: 0.9rem;
}

.critical-warning {
  background: rgba(244, 67, 54, 0.1);
  border: 2px solid rgba(244, 67, 54, 0.3);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-bottom: 1rem;
}

.critical-warning p strong {
  color: #f44336;
  font-size: 1.1rem;
}

.critical-warning ul {
  margin: 0.75rem 0 0 1.5rem;
  padding: 0;
}

.critical-warning li {
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.critical-warning li strong {
  color: #f44336;
}

.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-top: 1rem;
  padding: 0.75rem;
  background: var(--glass-bg);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition-base);
}

.checkbox-label:hover {
  background: rgba(99, 102, 241, 0.05);
}

.checkbox-label input[type="checkbox"] {
  margin-top: 0.25rem;
  width: 20px;
  height: 20px;
  cursor: pointer;
  flex-shrink: 0;
}

.checkbox-label span {
  flex: 1;
  color: var(--text-primary);
  font-weight: 500;
}

.modal-actions {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
}

.modal-actions .btn {
  flex: 1;
}

#cancelScanBtn {
  margin-top: 1rem;
}

#qrScanResult {
  animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* QR Scanner responsive */
@media (max-width: 640px) {
  .qr-scanner-modal {
    width: 95%;
  }
  
  .modal-actions {
    flex-direction: column;
  }
  
  .input-with-button {
    flex-direction: row;
  }
  
  .btn-qr-scan {
    min-width: 60px;
    font-size: 1.8rem;
  }
}

/* Members Selection Styles */
.members-selection-actions {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.btn-select-action {
  flex: 1;
  padding: 0.5rem 1rem;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.875rem;
  cursor: pointer;
  transition: all var(--transition-base);
  font-family: inherit;
}

.btn-select-action:hover {
  background: rgba(99, 102, 241, 0.1);
  border-color: rgba(99, 102, 241, 0.3);
}

.members-checkbox-list {
  max-height: 300px;
  overflow-y: auto;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 1rem;
}

.member-checkbox-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  margin-bottom: 0.5rem;
  background: rgba(99, 102, 241, 0.05);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-base);
}

.member-checkbox-item:last-child {
  margin-bottom: 0;
}

.member-checkbox-item:hover {
  background: rgba(99, 102, 241, 0.1);
  border-color: rgba(99, 102, 241, 0.3);
}

.member-checkbox-item input[type="checkbox"] {
  width: 20px;
  height: 20px;
  cursor: pointer;
  flex-shrink: 0;
}

.member-checkbox-label {
  flex: 1;
  cursor: pointer;
  color: var(--text-primary);
  font-weight: 500;
}

.member-checkbox-address {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-family: 'Courier New', monospace;
  word-break: break-all;
}

.member-checkbox-item.selected {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
  border-color: #667eea !important;
  border-width: 2px !important;
  box-shadow: 0 4px 16px rgba(102, 126, 234, 0.4), 0 0 0 3px rgba(102, 126, 234, 0.2) !important;
  transform: scale(1.02);
}

.member-checkbox-item.selected .member-checkbox-label {
  color: #ffffff !important;
  font-weight: 700 !important;
}

.member-checkbox-item.selected .member-checkbox-address {
  color: rgba(255, 255, 255, 0.8) !important;
}

@media (max-width: 640px) {
  .members-selection-actions {
    flex-direction: column;
  }
  
  .members-checkbox-list {
    max-height: 200px;
  }
  
  .member-checkbox-item {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .member-checkbox-label {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
  }
}

/* ============================================
   MEMBER SHARE SYSTEM (Multiple shares per member)
   ============================================ */

.member-share-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  margin-bottom: 0.5rem;
  background: rgba(99, 102, 241, 0.05);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  transition: all var(--transition-base);
}

.member-share-item:last-child {
  margin-bottom: 0;
}

.member-share-item:hover {
  background: rgba(99, 102, 241, 0.1);
  border-color: rgba(99, 102, 241, 0.3);
}

.member-share-item.selected {
  background: rgba(99, 102, 241, 0.15);
  border-color: var(--accent-purple);
}

.member-share-checkbox {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
  cursor: pointer;
}

.member-share-checkbox input[type="checkbox"] {
  width: 20px;
  height: 20px;
  cursor: pointer;
  flex-shrink: 0;
}

.member-share-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
}

.member-share-info .member-avatar {
  width: 32px;
  height: 32px;
  min-width: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-pink));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.member-share-name {
  color: var(--text-primary);
  font-weight: 500;
  font-size: 0.95rem;
  flex: 1;
}

.member-share-address {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-family: 'Courier New', monospace;
}

.member-share-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.share-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(99, 102, 241, 0.2);
  border: 1px solid rgba(99, 102, 241, 0.4);
  border-radius: 6px;
  color: #fff;
  font-size: 1.2rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0;
  line-height: 1;
}

.share-btn:hover {
  background: rgba(99, 102, 241, 0.3);
  border-color: var(--accent-purple);
  transform: scale(1.05);
}

.share-btn:active {
  transform: scale(0.95);
}

.share-btn-plus {
  background: rgba(34, 197, 94, 0.2);
  border-color: rgba(34, 197, 94, 0.4);
}

.share-btn-plus:hover {
  background: rgba(34, 197, 94, 0.3);
  border-color: rgb(34, 197, 94);
}

.share-btn-minus {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.4);
}

.share-btn-minus:hover {
  background: rgba(239, 68, 68, 0.3);
  border-color: rgb(239, 68, 68);
}

.share-counter {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 60px;
  padding: 0.25rem 0.5rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  transition: transform 0.15s ease;
}

.share-number {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent-purple);
  line-height: 1.2;
}

.share-label {
  font-size: 0.65rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  line-height: 1;
}

@media (max-width: 640px) {
  .member-share-item {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }
  
  .member-share-controls {
    justify-content: center;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
  }
  
  .share-btn {
    width: 40px;
    height: 40px;
  }
  
  .share-counter {
    min-width: 70px;
  }
}

/* ============================================
   BORROWED FUNDS ALERT (Full Consent Warning)
   ============================================ */

.borrowed-funds-alert {
  background: linear-gradient(135deg, rgba(255, 152, 0, 0.1) 0%, rgba(255, 87, 34, 0.1) 100%);
  border: 2px solid rgba(255, 152, 0, 0.5);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  animation: pulse-warning 2s ease-in-out infinite;
}

@keyframes pulse-warning {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(255, 152, 0, 0.4);
  }
  50% {
    box-shadow: 0 0 0 10px rgba(255, 152, 0, 0);
  }
}

.borrowed-funds-alert .alert-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  color: var(--warning-color, #ff9800);
}

.borrowed-funds-alert .alert-icon {
  font-size: 1.5rem;
  animation: shake 1s ease-in-out infinite;
}

@keyframes shake {
  0%, 100% { transform: rotate(0deg); }
  10%, 30%, 50%, 70%, 90% { transform: rotate(-5deg); }
  20%, 40%, 60%, 80% { transform: rotate(5deg); }
}

.borrowed-funds-alert .alert-header strong {
  font-size: 1.1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.borrowed-funds-alert .alert-text {
  color: var(--text-secondary);
  margin-bottom: 1rem;
  line-height: 1.6;
  font-size: 0.95rem;
}

.borrowed-details {
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-bottom: 1rem;
}

.borrowed-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0;
}

.borrowed-item:not(:last-child) {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.borrowed-item span {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.borrowed-item strong {
  color: var(--warning-color, #ff9800);
  font-size: 1.1rem;
  font-weight: 700;
}

.borrowed-funds-alert .alert-footer {
  text-align: center;
  font-weight: 600;
  color: var(--text-primary);
  margin-top: 1rem;
  font-size: 0.95rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 152, 0, 0.3);
}

.proposal-card.requires-full-consent {
  border: 2px solid rgba(255, 152, 0, 0.5);
  box-shadow: 0 0 20px rgba(255, 152, 0, 0.2);
}

@media (max-width: 640px) {
  .borrowed-funds-alert {
    padding: 1rem;
  }
  
  .borrowed-funds-alert .alert-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  
  .borrowed-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }
}

/* ===================================
   MODE SELECTOR STYLES
   =================================== */

.mode-selection-section {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
  border-radius: var(--radius-lg);
  padding: var(--spacing-lg);
  margin-bottom: var(--spacing-md);
  border: 2px solid var(--glass-border);
}

.mode-selection-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-md);
}

.mode-card {
  position: relative;
  display: block;
  background: var(--bg-secondary);
  border: 2px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: var(--spacing-lg);
  cursor: pointer;
  transition: all var(--transition-base);
  overflow: hidden;
}

.mode-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--accent-purple) 100%);
  opacity: 0;
  transition: opacity var(--transition-base);
  z-index: 0;
}

.mode-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.3);
}

.mode-card input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.mode-card input[type="radio"]:checked + .mode-card-content {
  position: relative;
  z-index: 1;
}

.mode-card input[type="radio"]:checked ~ .card-checkmark {
  opacity: 1;
  transform: scale(1);
}

.mode-card input[type="radio"]:checked ~ * {
  position: relative;
  z-index: 1;
}

.mode-card.active,
.mode-card input[type="radio"]:checked ~ * {
  border-color: var(--accent-green);
}

.mode-card.active::before,
.mode-card input[type="radio"]:checked ~ .mode-card::before {
  opacity: 0.15;
}

.mode-card-content {
  position: relative;
  z-index: 1;
}

.mode-icon {
  font-size: 3rem;
  margin-bottom: var(--spacing-sm);
  text-align: center;
}

.mode-card h4 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--spacing-xs);
  text-align: center;
}

.mode-description {
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: var(--spacing-md);
  font-size: 0.95rem;
}

.mode-features {
  list-style: none;
  margin-bottom: var(--spacing-md);
  padding: 0;
}

.mode-features li {
  color: var(--text-secondary);
  padding: var(--spacing-xs) 0;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
}

.mode-features li::before {
  flex-shrink: 0;
}

.mode-badge {
  display: inline-block;
  padding: 0.4rem 1rem;
  background: var(--accent-green);
  color: white;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-align: center;
  width: 100%;
  margin-top: var(--spacing-sm);
}

.mode-badge-premium {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.mode-info-box {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: var(--spacing-md);
  display: flex;
  gap: var(--spacing-md);
  align-items: flex-start;
}

.info-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.info-content {
  color: var(--text-secondary);
  line-height: 1.6;
  font-size: 0.9rem;
}

.info-content strong {
  color: var(--text-primary);
  font-weight: 600;
}

/* Blockchain mode warning when selected */
.mode-card input[type="radio"][value="blockchain"]:checked ~ .mode-card-content .mode-badge-premium {
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

/* Responsive mode selector */
@media (max-width: 640px) {
  .mode-selection-grid {
    grid-template-columns: 1fr;
  }
  
  .mode-card {
    padding: var(--spacing-md);
  }
  
  .mode-icon {
    font-size: 2.5rem;
  }
  
  .mode-card h4 {
    font-size: 1.25rem;
  }
}

/* ===================================
   MODE BADGES IN FUND CARDS
   =================================== */

.badge-mode {
  font-size: 0.75rem;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.mode-simple {
  background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
  color: white;
}

.mode-blockchain {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

/* ===================================
   SIGN IN MODAL STYLES
   =================================== */

.modal-medium {
  max-width: 480px;
}

.sign-in-content {
  padding: var(--spacing-md);
}

.sign-in-message {
  text-align: center;
  color: var(--text-secondary);
  margin-bottom: var(--spacing-lg);
  line-height: 1.6;
}

.sign-in-buttons {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-sm);
  padding: 1rem 1.5rem;
  background: white;
  color: #3c4043;
  border: 1px solid #dadce0;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-base);
}

.btn-google:hover {
  background: #f8f9fa;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.google-icon {
  flex-shrink: 0;
}

.divider-text {
  text-align: center;
  position: relative;
  margin: var(--spacing-md) 0;
}

.divider-text::before,
.divider-text::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 40%;
  height: 1px;
  background: var(--glass-border);
}

.divider-text::before {
  left: 0;
}

.divider-text::after {
  right: 0;
}

.divider-text span {
  background: var(--bg-secondary);
  padding: 0 var(--spacing-sm);
  color: var(--text-muted);
  font-size: 0.875rem;
}

.btn-link {
  background: transparent;
  border: none;
  color: var(--accent-blue);
  padding: var(--spacing-sm);
  cursor: pointer;
  font-size: 0.9rem;
  transition: color var(--transition-base);
}

.btn-link:hover {
  color: var(--accent-purple);
  text-decoration: underline;
}

.btn-wallet {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-sm);
  padding: 1rem 1.5rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-base);
}

.btn-wallet:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.sign-in-hint {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  margin-top: -0.5rem;
  margin-bottom: var(--spacing-md);
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-align: center;
}

.sign-in-hint strong {
  color: var(--text-primary);
  display: block;
  margin-bottom: 0.25rem;
}

.sign-in-warning {
  border-color: rgba(245, 158, 11, 0.3);
  background: rgba(245, 158, 11, 0.1);
}

.sign-in-warning strong {
  color: var(--warning);
}

#emailSignInForm,
#createAccountForm {
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
/* ===================================
   LOADING GROUPS STATE
   =================================== */

.loading-groups-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  text-align: center;
  gap: 1.5rem;
}

.loading-spinner {
  width: 60px;
  height: 60px;
  border: 4px solid var(--glass-border);
  border-top-color: var(--accent-purple);
  border-right-color: var(--accent-blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-groups-state h3 {
  color: var(--text-primary);
  font-size: 1.25rem;
  margin: 0;
}

.loading-groups-state p {
  color: var(--text-secondary);
  margin: 0;
  font-size: 0.95rem;
}

/* ===================================
   IMPROVED FAB BUTTON (Expandable)
   =================================== */

.fab-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 1000;
}

.fab-main {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: 2px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 16px rgba(102, 126, 234, 0.4);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.fab-main:hover {
  transform: scale(1.1) rotate(90deg);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
  border-color: rgba(255, 255, 255, 0.4);
}

.fab-main:active {
  transform: scale(0.95) rotate(90deg);
}

.fab-main .fab-icon {
  font-size: 1.5rem;
  transition: transform 0.3s ease;
  color: white;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

.fab-container.active .fab-main {
  transform: rotate(45deg);
}

.fab-container.active .fab-main .fab-icon {
  transform: rotate(0deg);
}

.fab-menu {
  position: absolute;
  bottom: 70px;
  right: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  animation: fabMenuSlide 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes fabMenuSlide {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fab-option {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.25rem;
  background: var(--bg-secondary);
  border: 2px solid var(--glass-border);
  border-radius: 28px;
  color: var(--text-primary);
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  transition: all 0.2s ease;
  font-size: 0.95rem;
  font-weight: 600;
}

[data-theme="dark"] .fab-option {
  background: rgba(30, 41, 59, 0.95);
  border-color: rgba(102, 126, 234, 0.4);
  color: white;
}

[data-theme="dark"] .fab-option:hover {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-color: transparent;
}

.fab-option:hover {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-color: transparent;
  transform: translateX(-8px);
  box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

.fab-option-icon {
  font-size: 1.25rem;
}

.fab-option-text {
  font-weight: 600;
}

/* Light theme adjustments for FAB */
[data-theme="light"] .fab-option {
  background: white;
  border-color: #e2e8f0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .fab-option:hover {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-color: transparent;
}

@media (max-width: 768px) {
  .fab-container {
    bottom: 1.5rem;
    right: 1.5rem;
  }
  
  .fab-main {
    width: 56px;
    height: 56px;
  }
  
  .fab-option {
    padding: 0.65rem 1rem;
    font-size: 0.875rem;
  }
  
  .fab-option-icon {
    font-size: 1.1rem;
  }
}

/* ===================================
   LIGHT MODE IMPROVEMENTS
   =================================== */

/* Ensure proper contrast in light mode */
[data-theme="light"] {
  /* Card backgrounds */
  --card-bg: #ffffff;
  --card-border: #e2e8f0;
  
  /* Better borders and outlines */
  --border-color: #cbd5e1;
  --border-light: #e2e8f0;
}

[data-theme="light"] .stat-card,
[data-theme="light"] .fund-card,
[data-theme="light"] .member-card,
[data-theme="light"] .expense-card-compact {
  background: white;
  border: 2px solid #94a3b8;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .stat-card:hover,
[data-theme="light"] .fund-card:hover {
  border-color: #667eea;
  box-shadow: 0 6px 16px rgba(102, 126, 234, 0.2);
}

[data-theme="light"] .stat-icon {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

[data-theme="light"] .btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
}

[data-theme="light"] .btn-secondary {
  background: white;
  color: #667eea;
  border: 2px solid #667eea;
}

[data-theme="light"] .btn-secondary:hover {
  background: #667eea;
  color: white;
}

/* Ensure modal buttons have proper contrast */
.modal-content .btn-secondary {
  background: transparent;
  border: 2px solid var(--glass-border);
  color: var(--text-primary);
}

.modal-content .btn-secondary:hover {
  background: rgba(102, 126, 234, 0.1);
  border-color: var(--primary);
  color: var(--primary);
}

[data-theme="dark"] .modal-content .btn-secondary {
  background: rgba(30, 41, 59, 0.6);
  border: 2px solid rgba(102, 126, 234, 0.4);
  color: white;
}

[data-theme="dark"] .modal-content .btn-secondary:hover {
  background: rgba(102, 126, 234, 0.2);
  border-color: #667eea;
  color: white;
}

[data-theme="light"] .modal-content .btn-secondary {
  background: white;
  border: 2px solid #94a3b8;
  color: #475569;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .modal-content .btn-secondary:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
  color: #334155;
}

[data-theme="light"] .filter-btn {
  background: white;
  color: #475569;
  border: 2px solid #94a3b8;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .filter-btn.active {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-color: transparent;
}

[data-theme="light"] .filter-btn:hover {
  border-color: #667eea;
}

[data-theme="light"] .fund-badge {
  border: 1px solid #cbd5e1;
}

[data-theme="light"] .empty-state {
  background: rgba(102, 126, 234, 0.05);
  border: 2px dashed #cbd5e1;
}

[data-theme="light"] .modal-content {
  background: linear-gradient(135deg, #e0e7ff 0%, #f0f4ff 50%, #fae8ff 100%);
  border: 3px solid #64748b;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .modal-header {
  border-bottom: 2px solid #94a3b8;
  background: white;
}

[data-theme="light"] .modal-body {
  background: white;
  padding: 1.5rem;
  margin: 0.5rem;
  border-radius: 0.5rem;
  border: 2px solid #cbd5e1;
}

[data-theme="light"] .modal-footer {
  border-top: 2px solid #94a3b8;
  background: #f8fafc;
}

[data-theme="light"] input,
[data-theme="light"] select,
[data-theme="light"] textarea {
  background: #f8fafc;
  color: #0f172a;
  border: 2px solid #64748b;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.08);
  font-weight: 500;
}

[data-theme="light"] input:focus,
[data-theme="light"] select:focus,
[data-theme="light"] textarea:focus {
  border-color: #667eea;
  background: white;
  box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.2), inset 0 1px 3px rgba(0, 0, 0, 0.05);
}

[data-theme="light"] input::placeholder,
[data-theme="light"] textarea::placeholder {
  color: #94a3b8;
}

[data-theme="light"] .expense-card-compact {
  background: white;
  border: 2px solid #94a3b8;
  border-left: 4px solid #667eea;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .expense-title-compact,
[data-theme="light"] .expense-title {
  color: #0f172a;
}

[data-theme="light"] .expense-header:hover {
  background: rgba(102, 126, 234, 0.05);
}

[data-theme="light"] .expense-details {
  border-top: 2px solid #cbd5e1;
}

[data-theme="light"] .meta-item {
  color: #64748b;
}

[data-theme="light"] .expense-notes {
  background: rgba(102, 126, 234, 0.05);
  color: #475569;
  border-left-color: #667eea;
}

[data-theme="light"] .interaction-btn {
  background: white;
  border: 2px solid #94a3b8;
  color: #64748b;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .interaction-btn:hover {
  background: #eff6ff;
  border-color: #667eea;
  color: #667eea;
}
/* Collapsible headers and content in light mode */
[data-theme="light"] .collapsible-header {
  background: #f8fafc !important;
  border: 2px solid #94a3b8 !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) !important;
}

[data-theme="light"] .collapsible-header:hover {
  background: #eff6ff !important;
  border-color: #64748b !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08) !important;
}

[data-theme="light"] .collapsible-header strong,
[data-theme="light"] .collapsible-header span {
  color: #0f172a !important;
}

[data-theme="light"] .collapsible-content {
  color: #1e293b;
  background: white;
  padding: 1rem;
  border-radius: 8px;
  border: 2px solid #94a3b8;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .collapsible-content * {
  color: #1e293b !important;
}

/* Fix specific light mode text issues */
[data-theme="light"] #simpleModeBalanceDashboard,
[data-theme="light"] #simpleModeBalanceDashboard * {
  color: #0f172a !important;
}

[data-theme="light"] #recurringExpensesList,
[data-theme="light"] #recurringExpensesList * {
  color: #1e293b !important;
}

[data-theme="light"] #balancesTab,
[data-theme="light"] #balancesTab * {
  color: #0f172a !important;
}

[data-theme="light"] #budgetContent,
[data-theme="light"] #budgetContent * {
  color: #0f172a !important;
}

[data-theme="light"] h3,
[data-theme="light"] h4 {
  color: #0f172a;
}

[data-theme="light"] p {
  color: #475569;
}

/* Fix balance cards visibility */
[data-theme="light"] .balance-item,
[data-theme="light"] .balance-card {
  background: white;
  border: 2px solid #94a3b8;
  color: #0f172a;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .balance-item *,
[data-theme="light"] .balance-card * {
  color: #0f172a !important;
}

[data-theme="light"] .balance-amount {
  color: #0f172a !important;
  font-weight: 700;
}

[data-theme="light"] .tab-description {
  color: #64748b;
}

/* Budget progress bars in light mode */
[data-theme="light"] .budget-progress {
  background: #e2e8f0;
}

[data-theme="light"] .budget-progress-bar {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* Ensure all text in fund detail is visible in light mode */
[data-theme="light"] #fundDetailSection {
  color: #0f172a;
}

[data-theme="light"] #fundDetailSection strong {
  color: #0f172a;
}

[data-theme="light"] #fundDetailSection span {
  color: #475569;
}

[data-theme="light"] #fundDetailSection p {
  color: #64748b;
}

/* Additional light mode border improvements */
[data-theme="light"] .member-item,
[data-theme="light"] .proposal-item {
  background: white;
  border: 2px solid #94a3b8;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .member-item:hover,
[data-theme="light"] .proposal-item:hover {
  background: #f8fafc;
  border-color: #64748b;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

/* Recurring expenses items */
[data-theme="light"] .recurring-list > div,
[data-theme="light"] .recurring-expense-item {
  background: white;
  border: 2px solid #94a3b8 !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* Budget items */
[data-theme="light"] .budget-item {
  background: white;
  border: 2px solid #94a3b8;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* General container borders */
[data-theme="light"] .info-box {
  background: #eff6ff;
  border: 2px solid #64748b;
  border-left: 4px solid #3b82f6;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .warning-box {
  background: #fffbeb;
  border: 2px solid #f59e0b;
  border-left: 4px solid #f59e0b;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Select dropdown specific styling */
[data-theme="light"] select {
  background: #f8fafc;
  background-image: url('data:image/svg+xml;charset=UTF-8,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 12 12"><path fill="%2364748b" d="M6 9L1 4h10z"/></svg>');
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 12px;
  padding-right: 2.5rem;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  cursor: pointer;
}

[data-theme="light"] select:focus {
  background-color: white;
}

/* Input with prefix (like $ sign) */
[data-theme="light"] .input-with-prefix,
[data-theme="light"] .input-with-suffix {
  border: 2px solid #64748b;
  background: #f8fafc;
}

[data-theme="light"] .input-prefix,
[data-theme="light"] .input-suffix {
  background: #e2e8f0;
  color: #475569;
  font-weight: 700;
  border-right: 2px solid #94a3b8;
}

/* Date inputs */
[data-theme="light"] input[type="date"],
[data-theme="light"] input[type="time"],
[data-theme="light"] input[type="datetime-local"] {
  background: #f8fafc;
  border: 2px solid #64748b;
  color: #0f172a;
  font-weight: 500;
}

/* Checkbox and radio styling */
[data-theme="light"] input[type="checkbox"],
[data-theme="light"] input[type="radio"] {
  width: 24px;
  height: 24px;
  border: 4px solid #000000;
  background: #ffffff;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  border-radius: 6px;
  position: relative;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.25), inset 0 1px 2px rgba(255, 255, 255, 0.8);
  flex-shrink: 0;
}

[data-theme="light"] input[type="checkbox"]:hover {
  border-color: #1e3a8a;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3), inset 0 1px 2px rgba(255, 255, 255, 0.8);
}

[data-theme="light"] input[type="checkbox"]:checked,
[data-theme="light"] input[type="radio"]:checked {
  background: #1e40af;
  border-color: #000000;
  box-shadow: 0 3px 8px rgba(30, 64, 175, 0.6), inset 0 -1px 3px rgba(0, 0, 0, 0.3);
}

[data-theme="light"] input[type="checkbox"]:checked::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* Member checkbox label text */
[data-theme="light"] .member-checkbox-label {
  color: #0f172a;
  font-weight: 600;
}

[data-theme="light"] .member-checkbox-address {
  color: #64748b;
  font-size: 0.75rem;
  background: #f1f5f9;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  margin-top: 0.25rem;
}

/* Member Share Items Light Mode */
[data-theme="light"] .member-share-item {
  background: #f8fafc;
  border: 2px solid #e2e8f0;
}

[data-theme="light"] .member-share-item:hover {
  background: #eff6ff;
  border-color: #cbd5e1;
}

[data-theme="light"] .member-share-item.selected {
  background: rgba(102, 126, 234, 0.08);
  border-color: #667eea;
}

[data-theme="light"] .member-share-name {
  color: #0f172a;
  font-weight: 600;
}

[data-theme="light"] .member-share-address {
  color: #64748b;
}

[data-theme="light"] .share-btn {
  background: #eff6ff;
  border: 2px solid #667eea;
  color: #667eea;
}

[data-theme="light"] .share-btn:hover {
  background: #667eea;
  color: white;
}

[data-theme="light"] .share-count {
  color: #0f172a;
  font-weight: 700;
}

/* Dividers and separators */
[data-theme="light"] hr,
[data-theme="light"] .divider {
  border-color: #94a3b8;
  opacity: 1;
}

/* Profile panel items */
[data-theme="light"] .profile-info-item {
  border-bottom: 2px solid #cbd5e1;
}

[data-theme="light"] .profile-stat-card {
  border: 2px solid #94a3b8;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* Form groups in light mode */
[data-theme="light"] .form-group {
  margin-bottom: var(--spacing-md);
}

[data-theme="light"] .form-group label {
  color: #0f172a;
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

[data-theme="light"] .form-group small {
  color: #64748b;
  font-size: 0.8rem;
  background: #f1f5f9;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  display: inline-block;
  margin-top: 0.5rem;
  border-left: 3px solid #94a3b8;
}

/* Member checkbox list items */
[data-theme="light"] .members-checkbox-list {
  background: white;
  border: 3px solid #64748b;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.06);
  padding: 1rem;
}

[data-theme="light"] .member-checkbox-item {
  background: #ffffff !important;
  border: 2px solid #cbd5e1 !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
  margin-bottom: 0.75rem;
}

[data-theme="light"] .member-checkbox-item:hover {
  background: #f8fafc !important;
  border-color: #94a3b8 !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;
  transform: translateY(-1px);
}

[data-theme="light"] .member-checkbox-item.selected {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
  border-color: #5a67d8 !important;
  border-width: 3px !important;
  box-shadow: 0 4px 16px rgba(102, 126, 234, 0.5), 0 0 0 3px rgba(102, 126, 234, 0.2) !important;
  transform: scale(1.02);
}

[data-theme="light"] .member-checkbox-item.selected .member-checkbox-label {
  color: #ffffff !important;
  font-weight: 700 !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2) !important;
}

[data-theme="light"] .member-checkbox-item.selected .member-checkbox-address {
  color: rgba(255, 255, 255, 0.9) !important;
}

[data-theme="light"] .member-checkbox-label {
  color: #0f172a !important;
  font-weight: 500 !important;
}

[data-theme="light"] .member-checkbox-address {
  color: #64748b !important;
}

/* PAID BY checkbox options - Light Mode */
[data-theme="light"] .checkbox-option {
  background: #ffffff;
  border: 2px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  margin-bottom: 0.5rem;
  padding: 0.75rem;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  display: flex;
  align-items: center;
}

[data-theme="light"] .checkbox-option:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

/* SELECTED STATE - ULTRA VISIBLE */
[data-theme="light"] .checkbox-option:has(input:checked) {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
  border: 3px solid #5a67d8 !important;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.5) !important;
}

[data-theme="light"] .checkbox-option:has(input:checked) label {
  color: #ffffff !important;
  font-weight: 700 !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2) !important;
}

[data-theme="light"] .checkbox-option:has(input:checked) .member-name {
  color: #ffffff !important;
  font-size: 0.95rem !important;
  font-weight: 700 !important;
}

[data-theme="light"] .checkbox-option:has(input:checked) .member-avatar {
  background: #ffffff !important;
  color: #667eea !important;
  border: 2px solid #ffffff !important;
  box-shadow: 0 2px 6px rgba(255, 255, 255, 0.3) !important;
  font-weight: 800 !important;
}

[data-theme="light"] .checkbox-option label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  margin: 0;
  padding: 0;
  flex: 1;
}

[data-theme="light"] .checkbox-option .member-name {
  color: #0f172a;
  font-weight: 600;
  font-size: 0.95rem;
}

[data-theme="light"] .checkbox-option .member-avatar {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  border: 2px solid #e2e8f0;
  transition: all 0.3s ease;
}

[data-theme="light"] .checkbox-option input[type="checkbox"] {
  width: 24px;
  height: 24px;
  min-width: 24px;
  margin-right: 0.75rem;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background: white;
  border: 2px solid #94a3b8;
  border-radius: 6px;
  position: relative;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
}

[data-theme="light"] .checkbox-option input[type="checkbox"]:hover {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1),
              inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .checkbox-option input[type="checkbox"]:checked {
  background: #1e40af;
  border-color: #1e40af;
  box-shadow: 0 2px 6px rgba(30, 64, 175, 0.35);
}

[data-theme="light"] .checkbox-option input[type="checkbox"]:checked::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
}

[data-theme="light"] .checkbox-option input[type="checkbox"]:focus {
  outline: none;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.25),
              inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* ===================================
   NOTIFICATIONS SYSTEM
   =================================== */

.notifications-btn {
  position: relative;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 0.625rem 1rem;
  cursor: pointer;
  transition: all var(--transition-base);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-primary);
}

.notifications-btn:hover {
  background: rgba(102, 126, 234, 0.1);
  border-color: rgba(102, 126, 234, 0.3);
  transform: translateY(-1px);
}

.bell-icon {
  font-size: 1.25rem;
  line-height: 1;
}

.notification-badge {
  position: absolute;
  top: -0.25rem;
  right: -0.25rem;
  background: #ef4444;
  color: white;
  border-radius: 10px;
  padding: 0.125rem 0.375rem;
  font-size: 0.7rem;
  font-weight: 700;
  min-width: 1.25rem;
  text-align: center;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

.notifications-panel {
  position: fixed;
  top: 4.5rem;
  right: 1rem;
  width: 400px;
  max-width: calc(100vw - 2rem);
  max-height: 600px;
  background: var(--bg-secondary);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.notifications-header {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.notifications-header h3 {
  margin: 0;
  font-size: 1.1rem;
  color: var(--text-primary);
}

.notifications-header-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.btn-text {
  background: none;
  border: none;
  color: var(--accent-purple);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  transition: color var(--transition-fast);
}

.btn-text:hover {
  color: var(--accent-blue);
  text-decoration: underline;
}

.btn-icon-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.btn-icon-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

.notifications-list {
  overflow-y: auto;
  flex: 1;
  padding: 0.5rem;
}

.notifications-list::-webkit-scrollbar {
  width: 6px;
}

.notifications-list::-webkit-scrollbar-track {
  background: transparent;
}

.notifications-list::-webkit-scrollbar-thumb {
  background: var(--glass-border);
  border-radius: 3px;
}

.notifications-list::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

.empty-notifications {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 2rem;
  text-align: center;
  color: var(--text-muted);
}

.empty-notifications .empty-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.empty-notifications p {
  margin: 0;
  font-size: 0.95rem;
}

.notification-item {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-bottom: 0.5rem;
  cursor: pointer;
  transition: all var(--transition-base);
  position: relative;
}

.notification-item:hover {
  background: rgba(102, 126, 234, 0.05);
  border-color: rgba(102, 126, 234, 0.2);
  transform: translateX(-2px);
}

.notification-item.unread {
  border-left: 4px solid #667eea;
  background: rgba(102, 126, 234, 0.08);
}

.notification-item.unread::before {
  content: '';
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 8px;
  height: 8px;
  background: #667eea;
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(102, 126, 234, 0.6);
}

.notification-header {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.notification-icon {
  font-size: 1.5rem;
  line-height: 1;
  flex-shrink: 0;
}

.notification-content {
  flex: 1;
}

.notification-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 0.25rem 0;
}

.notification-message {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.4;
}

.notification-time {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

.notification-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--glass-border);
}

.notification-action-btn {
  flex: 1;
  padding: 0.5rem 1rem;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.notification-action-btn.primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.notification-action-btn.primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.notification-action-btn.secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  border: 1px solid var(--glass-border);
}

.notification-action-btn.secondary:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* Light Mode Notifications */
[data-theme="light"] .notifications-btn {
  background: white;
  border: 2px solid #e2e8f0;
  color: #475569;
}

[data-theme="light"] .notifications-btn:hover {
  background: #eff6ff;
  border-color: #667eea;
}

[data-theme="light"] .notifications-panel {
  background: white;
  border: 1px solid #e2e8f0;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .notifications-header {
  border-bottom-color: #e2e8f0;
}

[data-theme="light"] .notifications-header h3 {
  color: #0f172a;
}

[data-theme="light"] .btn-text {
  color: #667eea;
}

[data-theme="light"] .btn-text:hover {
  color: #4f46e5;
}

[data-theme="light"] .btn-icon-close {
  color: #64748b;
}

[data-theme="light"] .btn-icon-close:hover {
  background: #f1f5f9;
  color: #0f172a;
}

[data-theme="light"] .notifications-list::-webkit-scrollbar-thumb {
  background: #cbd5e1;
}

[data-theme="light"] .notifications-list::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

[data-theme="light"] .empty-notifications {
  color: #64748b;
}

[data-theme="light"] .notification-item {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

[data-theme="light"] .notification-item:hover {
  background: #eff6ff;
  border-color: #cbd5e1;
}

[data-theme="light"] .notification-item.unread {
  background: rgba(102, 126, 234, 0.05);
  border-left-color: #667eea;
}

[data-theme="light"] .notification-title {
  color: #0f172a;
}

[data-theme="light"] .notification-message {
  color: #475569;
}

[data-theme="light"] .notification-time {
  color: #94a3b8;
}

[data-theme="light"] .notification-actions {
  border-top-color: #e2e8f0;
}

[data-theme="light"] .notification-action-btn.secondary {
  background: white;
  color: #475569;
  border-color: #cbd5e1;
}

[data-theme="light"] .notification-action-btn.secondary:hover {
  background: #f8fafc;
}

@media (max-width: 768px) {
  .notifications-panel {
    right: 0.5rem;
    width: calc(100vw - 1rem);
    top: 4rem;
  }

  .notifications-btn {
    padding: 0.5rem 0.75rem;
  }

  .bell-icon {
    font-size: 1.1rem;
  }
}

/* Notification Banner (Main Page Widget) */
.notification-banner {
  position: fixed;
  top: 70px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 999;
}

/* === PROFILE PANEL === */
.profile-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 1000;
  display: flex;
  justify-content: flex-end;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.profile-panel:not(.hidden) {
  opacity: 1;
  visibility: visible;
}

.profile-panel-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

.profile-panel-content {
  position: relative;
  width: 100%;
  max-width: 550px;
  background: var(--bg-primary);
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform 0.3s ease;
}

/* Custom Scrollbar for Profile Panel */
.profile-panel-content::-webkit-scrollbar {
  width: 8px;
}

.profile-panel-content::-webkit-scrollbar-track {
  background: transparent;
}

.profile-panel-content::-webkit-scrollbar-thumb {
  background: rgba(102, 126, 234, 0.3);
  border-radius: 10px;
  transition: background 0.3s ease;
}

.profile-panel-content::-webkit-scrollbar-thumb:hover {
  background: rgba(102, 126, 234, 0.5);
}

/* Firefox */
.profile-panel-content {
  scrollbar-width: thin;
  scrollbar-color: rgba(102, 126, 234, 0.3) transparent;
}

.profile-panel:not(.hidden) .profile-panel-content {
  transform: translateX(0);
}

/* Profile Header */
.profile-header {
  background: var(--glass-bg);
  border-bottom: 1px solid var(--glass-border);
  padding: 2rem;
}

.profile-header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.profile-header-top h2 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
}

.profile-user-info {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.profile-avatar {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: var(--primary-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
  box-shadow: 0 4px 16px rgba(102, 126, 234, 0.4);
}

.profile-details {
  flex: 1;
  min-width: 0;
}

.profile-details h3 {
  margin: 0 0 0.35rem 0;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
}

.profile-details p {
  margin: 0 0 1rem 0;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.profile-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.profile-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(102, 126, 234, 0.1);
  border: 1px solid rgba(102, 126, 234, 0.2);
  border-radius: var(--radius-full);
  padding: 0.25rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-icon {
  font-size: 0.9rem;
}

/* Profile Stats - More compact */
.profile-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--glass-border);
}

.profile-stat-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 1rem 0.75rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: all 0.3s ease;
}

.profile-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.stat-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.25rem;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Profile Tabs */
.profile-tabs {
  display: flex;
  background: var(--bg-primary);
  border-bottom: 2px solid var(--glass-border);
  padding: 0 1.5rem;
  gap: 0.5rem;
  overflow-x: auto;
}

.profile-tab {
  background: transparent;
  border: none;
  padding: 1rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: all 0.3s ease;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.profile-tab:hover {
  color: var(--text-primary);
  background: rgba(102, 126, 234, 0.05);
}

.profile-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.profile-tab span {
  font-size: 1.1rem;
}

/* Tab Content */
.profile-tab-content {
  flex: 1;
  overflow-y: auto;
  padding: 2rem;
}

.profile-tab-panel {
  display: none;
}

.profile-tab-panel.active {
  display: block;
}

.profile-section {
  margin-bottom: 2.5rem;
}

.profile-section:last-child {
  margin-bottom: 0;
}

.profile-section h4 {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0 0 1.25rem 0;
  color: var(--text-primary);
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.section-header h4 {
  margin: 0;
}

/* Profile Info Grid */
.profile-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.profile-info-item {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
}

.profile-info-item label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.5rem;
}

.profile-info-item span {
  display: block;
  font-size: 0.95rem;
  color: var(--text-primary);
  font-weight: 500;
}

/* Activity List */
.profile-activity-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.activity-item {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  gap: 1rem;
  align-items: center;
}

.activity-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.activity-content {
  flex: 1;
  min-width: 0;
}

.activity-title {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.activity-time {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Groups List */
.profile-groups-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.profile-group-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.3s ease;
  cursor: pointer;
}

.profile-group-card:hover {
  background: rgba(102, 126, 234, 0.05);
  border-color: rgba(102, 126, 234, 0.3);
  transform: translateX(4px);
}

.group-card-info {
  flex: 1;
  min-width: 0;
}

.group-card-name {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.group-card-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.group-card-icon {
  font-size: 1.5rem;
  opacity: 0.6;
}

/* Subscription Card */
.subscription-card {
  background: var(--glass-bg);
  border: 2px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}

.subscription-badge {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--glass-border);
}

.plan-icon {
  font-size: 3rem;
}

.plan-info h3 {
  margin: 0 0 0.25rem 0;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
}

.plan-info p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.plan-features {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.feature-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.95rem;
}

.feature-item.disabled {
  opacity: 0.5;
}

.feature-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
}

/* Settings List */
.settings-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.setting-item {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.setting-info {
  flex: 1;
  min-width: 0;
}

.setting-label {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.setting-description {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.setting-select {
  background: var(--bg-secondary);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.3s ease;
}

.setting-select:focus {
  outline: none;
  border-color: var(--primary);
}

/* Toggle Switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--bg-secondary);
  transition: 0.3s;
  border-radius: 26px;
  border: 2px solid var(--glass-border);
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 2px;
  bottom: 2px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
  background-color: var(--primary);
  border-color: var(--primary);
}

.toggle-switch input:checked + .toggle-slider:before {
  transform: translateX(22px);
}

/* Action Buttons */
.action-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.btn-block {
  width: 100%;
  justify-content: center;
}

.btn-danger {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
}

.btn-danger:hover {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
  transform: translateY(-1px);
}

/* Empty State */
.empty-state-text {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  padding: 2rem;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .profile-panel-content {
    max-width: 100%;
  }
  
  .profile-header {
    padding: 1.5rem 1rem;
  }
  
  .profile-avatar {
    width: 70px;
    height: 70px;
    font-size: 2rem;
  }
  
  .profile-details h3 {
    font-size: 1.2rem;
  }
  
  .profile-details p {
    font-size: 0.85rem;
  }
  
  .profile-badges {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .profile-stats {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    padding: 1rem;
  }

  .profile-stat-card {
    flex-direction: column;
    padding: 0.75rem 0.5rem;
    text-align: center;
  }
  
  .stat-icon {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
  }
  
  .stat-value {
    font-size: 1.1rem;
    margin-bottom: 0.15rem;
  }
  
  .stat-label {
    font-size: 0.65rem;
  }

  .profile-tabs {
    padding: 0 1rem;
    gap: 0.25rem;
  }

  .profile-tab {
    padding: 0.75rem 0.75rem;
    font-size: 0.85rem;
  }

  .profile-tab span {
    font-size: 1rem;
  }

  .profile-tab-content {
    padding: 1.25rem 1rem;
  }
  
  .profile-section {
    margin-bottom: 1.75rem;
  }
  
  .profile-section h4 {
    font-size: 1rem;
    margin-bottom: 1rem;
  }

  .profile-info-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
  
  .profile-info-item {
    padding: 1rem;
  }
  
  .subscription-card {
    padding: 1.25rem;
  }
  
  .plan-info h3 {
    font-size: 1.3rem;
  }
}

.notification-banner {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 12px 20px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  animation: slideDown 0.3s ease-out;
  min-width: 320px;
  max-width: 500px;
}

.notification-banner.hidden {
  display: none;
}

.notification-banner-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.notification-banner-icon {
  font-size: 20px;
  animation: bellRing 1s ease-in-out infinite;
}

@keyframes bellRing {
  0%, 100% { transform: rotate(0deg); }
  10%, 30% { transform: rotate(-10deg); }
  20%, 40% { transform: rotate(10deg); }
}

.notification-banner-content span:nth-child(2) {
  flex: 1;
  font-weight: 500;
  font-size: 14px;
}

.notification-banner-btn {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 6px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  transition: all 0.2s ease;
}

.notification-banner-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
}

.notification-banner-close {
  background: transparent;
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.8;
  transition: opacity 0.2s ease;
}

.notification-banner-close:hover {
  opacity: 1;
}

[data-theme="light"] .notification-banner {
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

/* Settlement Card Styles */
.settlement-card {
  border-left: 4px solid #10b981;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(5, 150, 105, 0.05) 100%);
}

.settlement-card .expense-header {
  background: transparent;
}

.payment-amount {
  color: #10b981 !important;
  font-weight: 600;
}

.badge-payment {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-left: 8px;
}

[data-theme="light"] .settlement-card {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.15) 0%, rgba(5, 150, 105, 0.08) 100%);
  border-left-color: #059669;
}

[data-theme="light"] .payment-amount {
  color: #059669 !important;
}

/* ===================================
   PWA INSTALL PROMPT & OFFLINE INDICATOR
   =================================== */

/* PWA Install Prompt */
.pwa-install-prompt {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 16px 20px;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(102, 126, 234, 0.4);
  z-index: 10000;
  max-width: 90%;
  width: 480px;
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.pwa-install-prompt.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.pwa-install-content {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.pwa-install-icon {
  font-size: 32px;
  flex-shrink: 0;
}

.pwa-install-text {
  flex: 1;
  min-width: 200px;
}

.pwa-install-text strong {
  display: block;
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 4px;
  color: white;
}

.pwa-install-text p {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.95);
  margin: 0;
  line-height: 1.4;
}

.pwa-install-actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
  width: 100%;
  margin-top: 12px;
}

.pwa-install-actions .btn-sm {
  padding: 10px 20px;
  font-size: 14px;
  border-radius: 8px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  flex: 1;
  min-width: 100px;
}

.pwa-install-actions .btn-primary {
  background: white;
  color: #667eea;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.pwa-install-actions .btn-primary:hover {
  background: rgba(255, 255, 255, 0.95);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.pwa-install-actions .btn-ghost {
  background: rgba(255, 255, 255, 0.15);
  color: white;
  border: 2px solid rgba(255, 255, 255, 0.4);
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 600;
}

.pwa-install-actions .btn-ghost:hover {
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.6);
}

/* Offline Ready Indicator */
.offline-ready-indicator {
  position: fixed;
  top: 20px;
  right: 20px;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  padding: 12px 20px;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.3);
  z-index: 9999;
  opacity: 0;
  transform: translateY(-20px);
  transition: all 0.3s ease;
}

.offline-ready-indicator.show {
  opacity: 1;
  transform: translateY(0);
}

.offline-ready-content {
  display: flex;
  align-items: center;
  gap: 10px;
}

.offline-ready-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  font-weight: bold;
  font-size: 14px;
}

.offline-ready-text {
  font-size: 14px;
  font-weight: 600;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .pwa-install-prompt {
    bottom: 10px;
    width: calc(100% - 20px);
    padding: 16px;
    border-radius: 12px;
  }
  
  .pwa-install-content {
    gap: 12px;
  }

  .pwa-install-icon {
    font-size: 28px;
  }

  .pwa-install-text {
    width: 100%;
  }

  .pwa-install-text strong {
    font-size: 15px;
  }

  .pwa-install-text p {
    font-size: 12px;
  }
  
  .pwa-install-actions {
    width: 100%;
    gap: 8px;
    margin-top: 10px;
  }

  .pwa-install-actions .btn-sm {
    padding: 10px 16px;
    font-size: 13px;
    flex: 1;
  }
  
  .pwa-install-actions .btn-ghost {
    padding: 8px 14px;
  }

  .offline-ready-indicator {
    top: 10px;
    right: 10px;
    left: 10px;
    padding: 10px 16px;
  }

  .offline-ready-text {
    font-size: 13px;
  }
}

/* Light Theme Adjustments */
[data-theme="light"] .pwa-install-prompt {
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  box-shadow: 0 8px 32px rgba(79, 70, 229, 0.3);
}

[data-theme="light"] .pwa-install-actions .btn-primary {
  background: white;
  color: #4f46e5;
}

[data-theme="light"] .offline-ready-indicator {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  box-shadow: 0 4px 16px rgba(5, 150, 105, 0.3);
}

/* ============================================
   UPGRADE PRO BUTTON
   ============================================ */
.upgrade-pro-btn {
  position: relative;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  padding: 0.6rem 1rem;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.upgrade-pro-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.upgrade-pro-btn:active {
  transform: translateY(0);
}

.upgrade-pro-btn .upgrade-text {
  font-weight: 700;
}

/* ============================================
   SUBSCRIPTION PLANS REDESIGN
   ============================================ */
.subscription-header {
  text-align: center;
  margin-bottom: 2rem;
}

.subscription-header h4 {
  font-size: 1.8rem;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.subscription-header p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.subscription-plans {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.subscription-card {
  position: relative;
  background: var(--glass-bg);
  border: 2px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  text-align: center;
  transition: all 0.3s ease;
}

.subscription-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.subscription-card.free-plan {
  border-color: #43e97b;
}

.subscription-card.pro-plan {
  border-color: #667eea;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
}

.plan-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  padding: 0.4rem 1rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.plan-badge.current {
  background: #43e97b;
  color: white;
}

.plan-badge.recommended {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.subscription-card .plan-icon {
  font-size: 4rem;
  margin: 1rem 0;
  display: block;
}

.subscription-card h3 {
  font-size: 1.8rem;
  font-weight: 700;
  margin: 0.5rem 0;
  color: var(--text-primary);
}

.plan-price {
  margin: 1rem 0 0.5rem 0;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.3rem;
}

.plan-price .price {
  font-size: 2.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.subscription-card.free-plan .plan-price .price {
  background: linear-gradient(135deg, #43e97b 0%, #38d9a9 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.plan-price .period {
  font-size: 1rem;
  color: var(--text-muted);
  font-weight: 500;
}

.plan-price-annual {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.save-badge {
  background: #43e97b;
  color: white;
  padding: 0.2rem 0.5rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 700;
  margin-left: 0.3rem;
}

.plan-description {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin: 1rem 0 1.5rem 0;
  min-height: 3rem;
}

.stripe-button-container {
  margin-top: 1.5rem;
}

.stripe-button-container .btn-primary {
  width: 100%;
  padding: 0.875rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.stripe-button-container .btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.subscription-footer {
  text-align: center;
  padding: 1.5rem;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
}

.subscription-footer p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 768px) {
  .upgrade-pro-btn .upgrade-text {
    display: none;
  }
  
  .subscription-plans {
    grid-template-columns: 1fr;
    gap: 0.75rem;
    padding: 0;
    margin-bottom: 1rem;
  }
  
  .subscription-card {
    padding: 1rem 0.75rem;
    margin: 0;
    border-radius: 12px;
  }
  
  .subscription-card .plan-icon {
    font-size: 2rem;
    margin: 0.25rem 0;
  }
  
  .subscription-card h3 {
    font-size: 1.25rem;
    margin: 0.2rem 0;
  }
  
  .plan-price {
    margin: 0.4rem 0 0.2rem 0;
  }
  
  .plan-price .price {
    font-size: 1.6rem;
  }
  
  .plan-price .period {
    font-size: 0.85rem;
  }
  
  .plan-price-annual {
    font-size: 0.75rem;
    margin-bottom: 0.4rem;
  }
  
  .plan-description {
    font-size: 0.8rem;
    margin: 0.4rem 0 0.75rem 0;
    min-height: auto;
    line-height: 1.3;
  }
  
  .stripe-button-container {
    margin-top: 0.75rem;
  }
  
  .stripe-button-container .btn-primary {
    padding: 0.65rem 0.875rem;
    font-size: 0.85rem;
  }
  
  .plan-badge {
    font-size: 0.65rem;
    padding: 0.25rem 0.7rem;
    top: -10px;
  }
  
  .save-badge {
    font-size: 0.7rem;
    padding: 0.15rem 0.4rem;
  }
  
  .subscription-footer {
    padding: 0.875rem;
    font-size: 0.8rem;
    margin-top: 1rem;
  }
  
  .subscription-header {
    margin-bottom: 1.25rem;
  }
  
  .subscription-header h4 {
    font-size: 1.4rem;
  }
  
  .subscription-header p {
    font-size: 0.85rem;
  }
}
/* ===================================
   USER MENU DROPDOWN - Modern Design
   =================================== */

.user-menu-container {
    position: relative;
}

.user-menu-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-full);
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition-base);
    font-family: inherit;
    min-width: 140px;
}

.user-menu-btn:hover {
    background: var(--glass-border);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.user-menu-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.user-menu-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    flex: 1;
    min-width: 0;
}

.user-menu-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.user-menu-status {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.user-menu-arrow {
    font-size: 0.6rem;
    color: var(--text-muted);
    transition: transform var(--transition-base);
    flex-shrink: 0;
}

.user-menu-btn.active .user-menu-arrow {
    transform: rotate(180deg);
}

.user-menu-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    min-width: 280px;
    background: var(--bg-secondary);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    overflow: hidden;
    animation: slideDown 0.2s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.menu-section {
    padding: 0.5rem;
}

.menu-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    border-bottom: 1px solid var(--glass-border);
}

.menu-header-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.menu-header-info {
    flex: 1;
    min-width: 0;
}

.menu-header-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.menu-header-email {
    font-size: 0.8rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.menu-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: inherit;
    text-align: left;
}

.menu-item:hover {
    background: var(--glass-bg);
}

.menu-item-static {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
}

.menu-item-danger {
    color: var(--error);
}

.menu-item-danger:hover {
    background: rgba(239, 68, 68, 0.1);
}

.menu-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
    width: 24px;
    text-align: center;
}

.menu-content {
    flex: 1;
    min-width: 0;
}

.menu-title {
    font-size: 0.875rem;
    font-weight: 500;
    color: inherit;
    margin-bottom: 0.1rem;
}

.menu-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.menu-item-danger .menu-title {
    color: var(--error);
}

.wallet-address {
    font-family: 'Courier New', monospace;
    font-size: 0.7rem;
}

.menu-divider {
    height: 1px;
    background: var(--glass-border);
    margin: 0.5rem 0;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .user-menu-btn {
        min-width: auto;
        padding: 0.5rem;
    }
    
    .user-menu-info {
        display: none;
    }
    
    .user-menu-arrow {
        display: none;
    }
    
    .user-menu-dropdown {
        right: -10px;
        min-width: 260px;
    }
}

@media (max-width: 480px) {
    .user-menu-dropdown {
        position: fixed;
        right: 0.5rem;
        left: 0.5rem;
        min-width: auto;
        max-width: calc(100vw - 1rem);
    }
}
/* ===================================
   SIGN IN MODAL - Split Screen Design
   =================================== */

/* Modal Auth Container */
.modal-auth {
    max-width: 1000px !important;
    width: 95vw !important;
    min-height: 600px;
    padding: 0 !important;
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.auth-container {
    display: grid;
    grid-template-columns: 45% 55%;
    min-height: 600px;
}

/* Left Brand Section */
.auth-brand {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.auth-brand::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: float 15s ease-in-out infinite;
}

.brand-content {
    position: relative;
    z-index: 1;
    text-align: center;
    color: white;
}

.brand-icon {
    font-size: 5rem;
    margin-bottom: 1.5rem;
    filter: drop-shadow(0 4px 12px rgba(0,0,0,0.2));
    animation: pulse 3s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.brand-title {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1rem;
    text-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.brand-subtitle {
    font-size: 1.25rem;
    opacity: 0.95;
    margin-bottom: 3rem;
    line-height: 1.6;
}

.brand-features {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    text-align: left;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 1.1rem;
    padding: 0.75rem;
    background: rgba(255,255,255,0.1);
    border-radius: var(--radius-md);
    backdrop-filter: blur(10px);
}

.feature-icon {
    font-size: 1.75rem;
    flex-shrink: 0;
}

/* Right Form Section */
.auth-form-container {
    padding: 3rem;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-form-content {
    width: 100%;
    max-width: 420px;
}

.auth-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.auth-description {
    font-size: 1rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
}

/* Auth Buttons */
.auth-options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.auth-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.875rem;
    padding: 1.125rem 1.5rem;
    border-radius: var(--radius-lg);
    font-size: 1.0625rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.auth-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.auth-btn:hover::before {
    left: 100%;
}

.auth-btn-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.auth-btn-text {
    flex: 1;
}

/* Google Button */
.auth-btn-google {
    background: white;
    color: #1f2937;
    border: 2px solid #e5e7eb;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.auth-btn-google:hover {
    background: #fafafa;
    border-color: #4285f4;
    box-shadow: 0 6px 16px rgba(66,133,244,0.25);
    transform: translateY(-2px);
}

[data-theme="dark"] .auth-btn-google {
    background: #2d3748;
    color: #f7fafc;
    border-color: #4a5568;
}

[data-theme="dark"] .auth-btn-google:hover {
    background: #374151;
    border-color: #667eea;
    box-shadow: 0 6px 16px rgba(102,126,234,0.3);
}

/* Email Button */
.auth-btn-email {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(102,126,234,0.3);
}

.auth-btn-email:hover {
    background: linear-gradient(135deg, #5568d3 0%, #653a8f 100%);
    box-shadow: 0 6px 20px rgba(102,126,234,0.4);
    transform: translateY(-2px);
}

/* MetaMask Button */
.auth-btn-metamask {
    background: linear-gradient(135deg, #f6851b 0%, #e2761b 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(246,133,27,0.3);
}

.auth-btn-metamask:hover {
    background: linear-gradient(135deg, #e2761b 0%, #cd6116 100%);
    box-shadow: 0 6px 20px rgba(246,133,27,0.4);
    transform: translateY(-2px);
}

/* Primary Auth Button (for forms) */
.auth-btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(102,126,234,0.3);
}

.auth-btn-primary:hover {
    background: linear-gradient(135deg, #5568d3 0%, #653a8f 100%);
    box-shadow: 0 6px 20px rgba(102,126,234,0.4);
    transform: translateY(-2px);
}

/* Divider */
.auth-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 1.5rem 0 1rem 0;
    color: var(--text-muted);
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--glass-border);
    opacity: 0.5;
}

.auth-divider span {
    padding: 0 1.25rem;
    text-transform: uppercase;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: var(--text-muted);
}

/* Advanced Options */
.auth-advanced {
    border: 2px solid var(--glass-border);
    border-radius: var(--radius-lg);
    background: var(--glass-bg);
    overflow: hidden;
    transition: all var(--transition-base);
}

.auth-advanced:hover {
    border-color: #f6851b;
}

.auth-advanced[open] {
    border-color: #f6851b;
    box-shadow: 0 4px 16px rgba(246,133,27,0.15);
}

.auth-advanced-summary {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 1rem 1.25rem;
    cursor: pointer;
    user-select: none;
    list-style: none;
    transition: all var(--transition-fast);
}

.auth-advanced-summary::-webkit-details-marker {
    display: none;
}

.advanced-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.advanced-text {
    flex: 1;
    font-weight: 600;
    font-size: 0.9375rem;
    color: var(--text-primary);
}

.advanced-badge {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    padding: 0.25rem 0.625rem;
    background: rgba(246,133,27,0.15);
    color: #f6851b;
    border-radius: var(--radius-full);
    letter-spacing: 0.05em;
}

.advanced-arrow {
    font-size: 0.875rem;
    transition: transform var(--transition-base);
    opacity: 0.6;
    flex-shrink: 0;
}

.auth-advanced[open] .advanced-arrow {
    transform: rotate(180deg);
}

.auth-advanced-content {
    padding: 0 1.25rem 1.25rem 1.25rem;
    animation: slideDownFade 0.3s ease;
}

.advanced-description {
    color: var(--text-muted);
    font-size: 0.875rem;
    line-height: 1.6;
    margin-bottom: 1rem;
    padding: 1rem;
    background: rgba(246,133,27,0.05);
    border-left: 3px solid #f6851b;
    border-radius: var(--radius-sm);
}

.advanced-note {
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.75rem;
    font-style: italic;
}

/* Form Styling */
#emailSignInForm,
#createAccountForm {
    animation: fadeInUp 0.4s ease;
    padding-top: 1rem;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.625rem;
    font-weight: 600;
    font-size: 0.9375rem;
    color: var(--text-primary);
}

.input-modern {
    width: 100%;
    padding: 1rem;
    border: 2px solid var(--glass-border);
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 1rem;
    transition: all var(--transition-base);
}

.input-modern:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(102,126,234,0.1);
    background: var(--bg-primary);
}

.input-modern::placeholder {
    color: var(--text-muted);
    opacity: 0.5;
}

/* Close Button */
.modal-auth .modal-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 10;
    width: 40px;
    height: 40px;
    background: rgba(0,0,0,0.5);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all var(--transition-base);
}

.modal-auth .modal-close:hover {
    background: rgba(0,0,0,0.7);
    transform: rotate(90deg);
}

/* Link Buttons */
.btn-link {
    background: transparent;
    border: none;
    color: var(--primary);
    padding: 0.75rem;
    text-decoration: none;
    cursor: pointer;
    font-size: 0.9375rem;
    font-weight: 500;
    transition: all var(--transition-fast);
    border-radius: var(--radius-sm);
    display: block;
    width: 100%;
    text-align: center;
}

.btn-link:hover {
    color: var(--primary-dark);
    background: rgba(102,126,234,0.1);
}

/* Responsive Design */
@media (max-width: 768px) {
    .modal-auth {
        max-width: 95vw !important;
        width: 95vw !important;
        min-height: auto;
    }
    
    .auth-container {
        grid-template-columns: 1fr;
    }
    
    .auth-brand {
        display: none;
    }
    
    .auth-form-container {
        padding: 2rem 1.5rem;
    }
    
    .brand-title {
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    .auth-form-container {
        padding: 1.5rem 1rem;
    }
    
    .auth-title {
        font-size: 1.5rem;
    }
    
    .auth-btn {
        padding: 1rem 1.25rem;
        font-size: 0.9375rem;
    }
    
    .btn-primary-auth {
        padding: 0.875rem 1.25rem;
        font-size: 0.9375rem;
    }
    
    .modal-header h2 {
        font-size: 1.5rem;
    }
}

/* ===================================
   CHALLENGE MODE STYLES
   =================================== */

/* Challenge Mode - Player Selection Styles */
.player-selection-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 1.5rem 0;
    padding: 1rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
}

.btn-select-all {
    background: white;
    color: #667eea;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.btn-select-all:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.selected-count {
    color: white;
    font-weight: 600;
    font-size: 1.1rem;
}

.player-selection-list {
    display: grid;
    gap: 0.75rem;
    margin: 1.5rem 0;
    max-height: 400px;
    overflow-y: auto;
    padding: 0.5rem;
}

.player-checkbox-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.player-checkbox-item:hover {
    border-color: #667eea;
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.1);
}

.player-checkbox-item.selected {
    background: linear-gradient(135deg, #667eea15 0%, #764ba215 100%);
    border-color: #667eea;
}

.player-checkbox-item input[type="checkbox"] {
    width: 24px;
    height: 24px;
    margin-right: 1rem;
    cursor: pointer;
    accent-color: #667eea;
}

.player-checkbox-info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.player-checkbox-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 1.2rem;
}

.player-checkbox-name {
    font-weight: 600;
    color: #333;
}

.player-selection-footer {
    margin-top: 2rem;
    display: flex;
    justify-content: center;
}

.player-selection-footer .btn-primary {
    min-width: 200px;
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

.player-selection-footer .btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #ccc;
}

/* Dark Mode Support for Player Selection */
[data-theme="dark"] .player-checkbox-item {
    background: #2d3748;
    border-color: #4a5568;
}

[data-theme="dark"] .player-checkbox-item:hover {
    border-color: #667eea;
    background: #374151;
}

[data-theme="dark"] .player-checkbox-item.selected {
    background: linear-gradient(135deg, #667eea25 0%, #764ba225 100%);
    border-color: #667eea;
}

[data-theme="dark"] .player-checkbox-name {
    color: #e2e8f0;
}

/* Challenge Mode Button */
.btn-challenge-mode {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
    box-shadow: 0 2px 8px rgba(245, 87, 108, 0.3);
}

.btn-challenge-mode:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(245, 87, 108, 0.4);
}

/* Challenge Modal */
.modal-large {
    max-width: 900px !important;
}

.challenge-step {
    padding: 1.5rem;
}

.challenge-intro {
    text-align: center;
    margin-bottom: 2rem;
}

.challenge-intro h3 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.challenge-intro p {
    color: var(--text-secondary);
    font-size: 1rem;
}

.btn-back {
    background: transparent;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 0.5rem 1rem;
    color: var(--text-secondary);
    cursor: pointer;
    margin-bottom: 1rem;
    transition: all var(--transition-base);
}

.btn-back:hover {
    background: var(--glass-bg);
    color: var(--text-primary);
}

/* Mode Selection Cards */
.mode-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.mode-card {
    background: var(--glass-bg);
    border: 2px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-base);
}

.mode-card:hover {
    background: rgba(102, 126, 234, 0.1);
    border-color: var(--primary-light);
    transform: translateY(-4px);
}

.mode-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.mode-card h4 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.mode-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.mode-badge {
    display: inline-block;
    padding: 0.375rem 0.875rem;
    background: var(--primary-gradient);
    border-radius: var(--radius-full);
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Game Selection Grid */
.game-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
}

.game-card {
    background: var(--glass-bg);
    border: 2px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.game-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--primary-gradient);
    opacity: 0;
    transition: opacity var(--transition-base);
}

.game-card:hover::before {
    opacity: 0.05;
}

.game-card:hover {
    border-color: var(--primary-light);
    transform: translateY(-2px);
}

.game-card.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.game-card.disabled:hover {
    transform: none;
}

.game-icon {
    font-size: 3rem;
    margin-bottom: 0.75rem;
    position: relative;
    z-index: 1;
}

.game-card h4 {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    position: relative;
    z-index: 1;
}

.game-card p {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 0.75rem;
    position: relative;
    z-index: 1;
}

.game-difficulty {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    position: relative;
    z-index: 1;
}

.game-difficulty.easy {
    background: rgba(67, 233, 123, 0.2);
    color: #43e97b;
}

.game-difficulty.medium {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
}

.game-difficulty.fun {
    background: rgba(240, 147, 251, 0.2);
    color: #f093fb;
}

.game-difficulty.hard {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.game-difficulty.special {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.2), rgba(118, 75, 162, 0.2));
    color: #667eea;
}

/* Color Match Game Styles */
.color-match-word {
    text-align: center;
    margin: 2rem 0;
    padding: 1rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
}

.color-match-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-top: 2rem;
}

.color-option-btn {
    padding: 1.5rem;
    border: 3px solid white;
    border-radius: 12px;
    color: white;
    font-weight: bold;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.color-option-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
}

/* Shake It Game Styles */
.shake-counter {
    text-align: center;
    margin: 2rem 0;
}

.shake-icon {
    font-size: 4rem;
    animation: shake-icon 0.5s infinite;
}

.shake-count {
    font-size: 4rem;
    font-weight: bold;
    color: var(--primary);
    margin: 1rem 0;
}

.shake-label {
    font-size: 1.2rem;
    color: var(--text-secondary);
}

.shake-timer {
    text-align: center;
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary);
    margin: 1rem 0;
}

@keyframes shake-icon {
    0%, 100% { transform: rotate(-5deg); }
    50% { transform: rotate(5deg); }
}

@keyframes shake-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* Memory Cards Game Styles */
.memory-stats {
    display: flex;
    justify-content: space-around;
    margin-bottom: 2rem;
    padding: 1.25rem;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 12px;
}

.memory-stats .stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.memory-stats .stat-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.memory-stats .stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.memory-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    max-width: 500px;
    margin: 0 auto 1.5rem;
    padding: 1.5rem;
}

.memory-card {
    aspect-ratio: 1;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    transform-style: preserve-3d;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    min-height: 80px;
    min-width: 80px;
}

.memory-card .card-front,
.memory-card .card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    backface-visibility: hidden;
    border-radius: 12px;
}

.memory-card .card-back {
    transform: rotateY(180deg);
    background: white;
}

.memory-card.flipped {
    transform: rotateY(180deg);
}

.memory-card:hover:not(.flipped) {
    transform: scale(1.05);
}

/* Player Transition Screen */
.player-transition {
    text-align: center;
    padding: 2rem;
}

.player-avatar-large {
    font-size: 5rem;
    margin-bottom: 1rem;
}

.game-name {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary);
    margin: 1rem 0;
}

.game-instructions {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin: 1.5rem 0;
}

/* Tie Explanation */
.tie-explanation {
    margin-top: 0.5rem;
    padding: 0.75rem;
    background: rgba(245, 158, 11, 0.1);
    border-left: 3px solid #f59e0b;
    border-radius: 4px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Math Challenge Styles */
.math-equation {
    text-align: center;
    font-size: 3rem;
    font-weight: bold;
    margin: 2rem 0;
    color: var(--primary);
}

/* AI Trivia Styles */
.trivia-question {
    margin: 2rem 0;
    padding: 1.5rem;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 12px;
    border-left: 4px solid var(--primary);
}

.trivia-question h3 {
    margin: 0;
    color: var(--text-primary);
    line-height: 1.6;
}

.trivia-options {
    display: grid;
    gap: 1rem;
}

.trivia-option-btn {
    padding: 1rem 1.5rem;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    color: #333;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
}

.trivia-option-btn:hover {
    border-color: var(--primary);
    background: rgba(102, 126, 234, 0.05);
    transform: translateX(5px);
}

[data-theme="dark"] .trivia-option-btn {
    background: #2d3748;
    border-color: #4a5568;
    color: #e2e8f0;
}

[data-theme="dark"] .trivia-option-btn:hover {
    background: #374151;
}

.loading-spinner {
    text-align: center;
    font-size: 2rem;
    padding: 3rem;
    animation: pulse 1.5s ease-in-out infinite;
}

/* Remote Selection Options */
.remote-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
}

.remote-card {
    background: var(--glass-bg);
    border: 2px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-base);
}

.remote-card:hover {
    background: rgba(102, 126, 234, 0.1);
    border-color: var(--primary-light);
    transform: translateY(-2px);
}

.remote-icon {
    font-size: 3rem;
    margin-bottom: 0.75rem;
}

.remote-card h4 {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.remote-card p {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 0.75rem;
}

.remote-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: rgba(102, 126, 234, 0.2);
    border-radius: var(--radius-full);
    color: var(--primary-light);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
}

/* Game Play Area */
.game-turn-screen {
    text-align: center;
    padding: 2rem;
    min-height: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.game-player-indicator {
    margin-bottom: 2rem;
}

.player-avatar {
    font-size: 4rem;
    margin-bottom: 0.5rem;
}

.game-player-indicator h2 {
    font-size: 1.75rem;
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.game-instructions {
    margin-bottom: 2rem;
}

.game-instructions h3 {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
}

.game-instructions p {
    color: var(--text-secondary);
    font-size: 1rem;
}

.ready-indicator {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--accent-orange);
    margin-top: 1rem;
    animation: pulse 1.5s ease-in-out infinite;
}

/* Quick Tap Game */
.quick-tap-waiting {
    padding: 3rem;
}

.pulse-indicator {
    width: 80px;
    height: 80px;
    margin: 0 auto 1rem;
    border-radius: 50%;
    background: var(--accent-orange);
    animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

.quick-tap-button {
    width: 250px;
    height: 250px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    color: white;
    font-size: 2rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 8px 32px rgba(67, 233, 123, 0.4);
    transition: all 0.1s ease;
}

.quick-tap-button:active {
    transform: scale(0.95);
}

.score-display {
    padding: 2rem;
}

.score-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.score-value {
    font-size: 3rem;
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 1rem 0;
}

/* Number Guess Game */
.previous-guesses {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-bottom: 1.5rem;
    max-width: 300px;
}

.previous-guess {
    padding: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Spinner Wheel (Remote Mode) */
.spinner-wheel-container {
    position: relative;
    width: 350px;
    height: 350px;
    margin: 2rem auto;
    filter: drop-shadow(0 10px 30px rgba(102, 126, 234, 0.4));
}

.spinner-pointer {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 3rem;
    color: #f5576c;
    z-index: 10;
    filter: drop-shadow(0 4px 8px rgba(245, 87, 108, 0.6));
    animation: pulse-pointer 1.5s ease-in-out infinite;
}

@keyframes pulse-pointer {
    0%, 100% {
        transform: translateX(-50%) translateY(0) scale(1);
    }
    50% {
        transform: translateX(-50%) translateY(-5px) scale(1.1);
    }
}

.spinner-wheel {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 8px solid #764ba2;
    background: conic-gradient(
        from 0deg,
        #667eea 0deg,
        #764ba2 90deg,
        #f093fb 180deg,
        #667eea 270deg,
        #764ba2 360deg
    );
    box-shadow: 
        0 0 0 16px rgba(102, 126, 234, 0.15),
        0 0 0 24px rgba(118, 75, 162, 0.1),
        0 12px 40px rgba(0,0,0,0.4),
        inset 0 0 60px rgba(255,255,255,0.15);
    position: relative;
    overflow: hidden;
    will-change: transform;
}

/* Center circle decoration */
.spinner-wheel::before {
    content: '🎯';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #ffffff 0%, #f0f0f0 100%);
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    z-index: 5;
}

.wheel-segment {
    position: absolute;
    width: 50%;
    height: 50%;
    top: 50%;
    left: 50%;
    transform-origin: 0% 0%;
    transform: rotate(calc(360deg / var(--total) * var(--index)));
    clip-path: polygon(0 0, 100% 0, 50% 100%);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 30px;
    background: linear-gradient(
        to bottom right,
        rgba(255, 255, 255, 0.35),
        rgba(255, 255, 255, 0.08)
    );
    border-right: 2px solid rgba(255, 255, 255, 0.4);
}

.wheel-segment:nth-child(odd) {
    background: linear-gradient(
        to bottom right,
        rgba(255, 255, 255, 0.25),
        rgba(255, 255, 255, 0.05)
    );
}

.wheel-segment:nth-child(even) {
    background: linear-gradient(
        to bottom right,
        rgba(0, 0, 0, 0.15),
        rgba(0, 0, 0, 0.03)
    );
}

.segment-text {
    color: white;
    font-weight: 800;
    font-size: 1rem;
    text-shadow: 
        0 2px 4px rgba(0,0,0,0.6),
        0 0 10px rgba(0,0,0,0.4);
    transform: rotate(calc(180deg / var(--total)));
    white-space: nowrap;
    user-select: none;
    letter-spacing: 0.5px;
}

/* Spinning animation */
.spinner-wheel.spinning {
    animation: continuous-spin 0.8s linear infinite;
}

@keyframes continuous-spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Glow effect during spin */
.spinner-wheel-container.active {
    animation: glow-pulse 1s ease-in-out infinite;
}

@keyframes glow-pulse {
    0%, 100% {
        filter: drop-shadow(0 10px 30px rgba(102, 126, 234, 0.4));
    }
    50% {
        filter: drop-shadow(0 10px 50px rgba(245, 87, 108, 0.6)) drop-shadow(0 0 30px rgba(102, 126, 234, 0.8));
    }
}

.spinner-status {
    text-align: center;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-top: 1.5rem;
    animation: pulse 1.5s ease-in-out infinite;
}

/* Results Screen */
.result-screen {
    margin-bottom: 2rem;
}

.result-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.result-screen h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.result-screen h3 {
    color: var(--text-secondary);
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.result-extra-info {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.results-list {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 2rem;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.result-row {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    border-bottom: 1px solid var(--glass-border);
}

.result-row:last-child {
    border-bottom: none;
}

.result-row.loser-row {
    background: rgba(239, 68, 68, 0.1);
    border-radius: var(--radius-md);
}

.result-row.eliminated-row {
    background: rgba(231, 76, 60, 0.15);
    opacity: 0.8;
}

.result-row.eliminated-row .result-score {
    color: #e74c3c;
    font-weight: 600;
}

.result-medal {
    font-size: 1.5rem;
    margin-right: 0.75rem;
}

.result-name {
    flex: 1;
    font-weight: 600;
}

.result-score {
    font-weight: 700;
    color: var(--primary-light);
}

.result-announcement {
    background: var(--glass-bg);
    border: 2px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.loser-badge {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.result-announcement h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.loser-explanation {
    font-size: 0.9rem;
    color: #888;
    margin-top: 0.5rem;
    font-style: italic;
}

.result-winner {
    margin: 1.5rem 0;
}

.winner-avatar {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.result-winner h3 {
    font-size: 1.75rem;
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.result-method {
    margin-top: 1rem;
}

.result-method small {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.result-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Challenge Indicator in Expense Form */
.challenge-indicator {
    background: linear-gradient(135deg, rgba(240, 147, 251, 0.1) 0%, rgba(245, 87, 108, 0.1) 100%);
    border: 2px solid rgba(245, 87, 108, 0.3);
    border-radius: var(--radius-lg);
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.challenge-badge {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* Responsive */
@media (max-width: 768px) {
    .mode-options,
    .game-grid,
    .remote-options {
        grid-template-columns: 1fr;
    }
    
    .modal {
        padding: 0.5rem;
    }
    
    .modal-large {
        max-width: 95vw !important;
        width: 95vw !important;
        margin: 0 !important;
    }
    
    .modal-content {
        max-height: 95vh !important;
        height: auto !important;
        min-height: 0 !important;
        overflow-y: auto !important;
        width: 100% !important;
        display: flex !important;
        flex-direction: column !important;
    }
    
    .modal-header {
        flex-shrink: 0;
        padding: 1rem !important;
    }
    
    .modal-body {
        padding: 1rem !important;
        overflow-y: visible !important;
        flex: 1 1 auto !important;
        min-height: 0 !important;
    }
    
    .challenge-step {
        padding: 0.5rem !important;
        min-height: 0 !important;
    }
    
    .challenge-intro {
        margin-bottom: 1.5rem;
    }
    
    .challenge-intro h3 {
        font-size: 1.5rem;
    }
    
    .player-selection-controls {
        flex-direction: column;
        gap: 1rem;
        padding: 0.75rem;
    }
    
    .selected-count {
        font-size: 1rem;
    }
    
    .player-selection-list {
        max-height: 50vh;
        padding: 0.25rem;
        gap: 0.5rem;
    }
    
    .player-checkbox-item {
        padding: 0.75rem;
    }
    
    .player-checkbox-avatar {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }
    
    .player-checkbox-name {
        font-size: 0.95rem;
    }
    
    .player-selection-footer .btn-primary {
        min-width: 100%;
        padding: 0.875rem 1.5rem;
        font-size: 1rem;
    }
    
    .game-turn-screen {
        padding: 1rem;
        min-height: 300px;
    }
    
    .quick-tap-button {
        width: 200px;
        height: 200px;
        font-size: 1.5rem;
    }
    
    .spinner-wheel-container {
        width: 250px;
        height: 250px;
    }
    
    .memory-grid {
        max-width: 100%;
        gap: 1rem;
        padding: 1rem;
    }
    
    .memory-card {
        font-size: 2rem;
        min-height: 60px;
        min-width: 60px;
    }
}

/* Player Transition Screen Styles */
.player-transition {
    text-align: center;
    padding: 3rem 2rem;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
    border-radius: var(--radius-lg);
    margin: 2rem 0;
}

.player-transition h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.player-avatar-large {
    font-size: 5rem;
    margin-bottom: 1.5rem;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.1));
}

.game-name {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary);
    margin: 1rem 0;
}

.game-instructions {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin: 1.5rem 0 2rem;
    line-height: 1.6;
}

.player-transition .btn {
    font-size: 1.2rem;
    padding: 1rem 3rem;
    margin-top: 1rem;
}

/* Tie Explanation Styles */
.tie-explanation {
    margin-top: 0.75rem;
    padding: 0.875rem 1rem;
    background: rgba(245, 158, 11, 0.12);
    border-left: 4px solid #f59e0b;
    border-radius: 6px;
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Enhanced Memory Stats */
.memory-stats .stat-item {
    text-align: center;
}

/* Dark Mode Support for New Elements */
[data-theme="dark"] .memory-stats {
    background: rgba(102, 126, 234, 0.15);
}

[data-theme="dark"] .memory-stats .stat-label {
    color: rgba(255, 255, 255, 0.7);
}

[data-theme="dark"] .memory-card .card-back {
    background: #2d3748;
    color: #fff;
}

[data-theme="dark"] .player-transition {
    background: rgba(102, 126, 234, 0.08);
}

[data-theme="dark"] .tie-explanation {
    background: rgba(245, 158, 11, 0.18);
    color: rgba(255, 255, 255, 0.85);
    border-left-color: #fbbf24;
}

[data-theme="dark"] .game-name {
    color: #818cf8;
}

[data-theme="dark"] .player-transition h2 {
    color: #f9fafb;
}

/* Rhythm Battle Game Styles */
.rhythm-display {
    background: rgba(102, 126, 234, 0.1);
    border-radius: 12px;
    padding: 1rem;
    margin: 2rem 0;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rhythm-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    max-width: 300px;
    margin: 0 auto;
    padding: 1.5rem;
}

.rhythm-btn {
    width: 100%;
    aspect-ratio: 1;
    border: none;
    border-radius: 16px;
    font-size: 3rem;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

.rhythm-red {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
}

.rhythm-blue {
    background: linear-gradient(135deg, #4dabf7 0%, #339af0 100%);
}

.rhythm-green {
    background: linear-gradient(135deg, #51cf66 0%, #37b24d 100%);
}

.rhythm-yellow {
    background: linear-gradient(135deg, #ffd43b 0%, #fab005 100%);
}

.rhythm-btn:active {
    transform: scale(0.95) !important;
}

.rhythm-score {
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    margin-top: 1.5rem;
}

/* Emoji Hunt Game Styles */
.emoji-hunt-stats {
    display: flex;
    justify-content: space-around;
    margin-bottom: 1.5rem;
    padding: 1.25rem;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 12px;
}

.emoji-hunt-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 0.5rem;
    max-width: 500px;
    margin: 0 auto;
    padding: 1rem;
}

.emoji-cell {
    aspect-ratio: 1;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.15) 0%, rgba(118, 75, 162, 0.15) 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.emoji-cell:hover:not(.found):not(.wrong) {
    transform: scale(1.1);
    border-color: var(--primary);
}

.emoji-cell.found {
    border-color: #43e97b;
    box-shadow: 0 0 15px rgba(67, 233, 123, 0.5);
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Dark mode support for new games */
[data-theme="dark"] .rhythm-display {
    background: rgba(102, 126, 234, 0.15);
}

[data-theme="dark"] .emoji-hunt-stats {
    background: rgba(102, 126, 234, 0.15);
}

[data-theme="dark"] .emoji-cell {
    background: rgba(102, 126, 234, 0.2);
}

/* Responsive for new games */
@media (max-width: 768px) {
    .emoji-hunt-grid {
        grid-template-columns: repeat(6, 1fr);
        max-width: 350px;
    }
    
    .rhythm-buttons {
        max-width: 250px;
    }
}

/* Dice Battle Styles */
.dice-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.dice {
    font-size: 6rem;
    display: inline-block;
    transition: all 0.3s ease;
}

.dice.rolling {
    animation: dice-roll 0.1s infinite;
}

.dice.final {
    animation: dice-land 0.5s ease;
}

@keyframes dice-roll {
    0%, 100% { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(180deg) scale(1.2); }
}

@keyframes dice-land {
    0% { transform: scale(1.5) rotate(360deg); }
    50% { transform: scale(0.8); }
    100% { transform: scale(1) rotate(0deg); }
}

.dice-results {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 400px;
    margin: 0 auto;
}

.dice-result-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 12px;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.dice-result-item.loser {
    background: rgba(245, 87, 108, 0.15);
    border-color: #f5576c;
    box-shadow: 0 4px 12px rgba(245, 87, 108, 0.3);
}

.dice-result-medal {
    font-size: 2rem;
    min-width: 50px;
    text-align: center;
}

.dice-result-info {
    flex: 1;
}

.dice-result-name {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
}

.dice-result-roll {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

/* Card Draw Styles */
.card-draw-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    min-height: 200px;
}

.card-back {
    font-size: 6rem;
    display: inline-block;
}

.card-back.flipping {
    animation: card-flip 1.5s infinite;
}

@keyframes card-flip {
    0%, 100% { transform: rotateY(0deg); }
    50% { transform: rotateY(180deg); }
}

.playing-card {
    display: inline-block;
    padding: 1rem 1.5rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.2);
    font-weight: 700;
    font-size: 2rem;
    min-width: 100px;
    text-align: center;
    animation: card-reveal 0.5s ease;
}

.playing-card.large {
    font-size: 4rem;
    padding: 2rem 3rem;
    min-width: 150px;
}

.playing-card.red {
    color: #dc143c;
}

.playing-card.black {
    color: #1a1a1a;
}

@keyframes card-reveal {
    0% { transform: scale(0) rotateY(180deg); opacity: 0; }
    100% { transform: scale(1) rotateY(0deg); opacity: 1; }
}

.card-results {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 400px;
    margin: 0 auto;
}

.card-result-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 12px;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.card-result-item.loser {
    background: rgba(245, 87, 108, 0.15);
    border-color: #f5576c;
    box-shadow: 0 4px 12px rgba(245, 87, 108, 0.3);
}

.card-result-medal {
    font-size: 2rem;
    min-width: 50px;
    text-align: center;
}

.card-result-info {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-result-name {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* Dark mode support for new remote methods */
[data-theme="dark"] .playing-card {
    background: #2d3748;
    color: #f9fafb;
}

[data-theme="dark"] .playing-card.red {
    color: #fc8181;
}

[data-theme="dark"] .playing-card.black {
    color: #e2e8f0;
}

[data-theme="dark"] .dice-result-item,
[data-theme="dark"] .card-result-item {
    background: rgba(102, 126, 234, 0.15);
}

[data-theme="dark"] .dice-result-item.loser,
[data-theme="dark"] .card-result-item.loser {
    background: rgba(245, 87, 108, 0.2);
}

/* Ant Pool Roulette Styles */
.ant-march {
    display: inline-block;
    animation: ant-walk 3s linear infinite;
}

@keyframes ant-walk {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(10px); }
    50% { transform: translateX(0); }
    75% { transform: translateX(-10px); }
}

.criteria-roulette {
    min-height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 16px;
    margin: 1rem 0;
}

/* Enhanced game icons with ant theme */
.game-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.remote-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

/* Ant-themed pulse animation */
@keyframes ant-pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.9;
    }
}

/* Dark mode for ant elements */
[data-theme="dark"] .criteria-roulette {
    background: rgba(102, 126, 234, 0.15);
}

[data-theme="dark"] .ant-march {
    filter: brightness(1.2);
}

/* Mobile Responsive for New Games and Features */
@media (max-width: 768px) {
    /* Dice Battle Mobile */
    .dice-container {
        padding: 1rem;
    }
    
    .dice {
        font-size: 4rem;
    }
    
    .dice-results,
    .card-results {
        max-width: 100%;
        padding: 0 0.5rem;
    }
    
    .dice-result-item,
    .card-result-item {
        padding: 0.75rem 1rem;
        flex-wrap: wrap;
    }
    
    .dice-result-medal,
    .card-result-medal {
        font-size: 1.5rem;
        min-width: 40px;
    }
    
    .dice-result-name,
    .card-result-name {
        font-size: 1rem;
    }
    
    .dice-result-roll {
        font-size: 0.875rem;
    }
    
    /* Card Draw Mobile */
    .card-draw-container {
        padding: 1rem;
        min-height: 150px;
    }
    
    .card-back {
        font-size: 4rem;
    }
    
    .playing-card {
        font-size: 1.5rem;
        padding: 0.75rem 1rem;
        min-width: 80px;
    }
    
    .playing-card.large {
        font-size: 2.5rem;
        padding: 1.5rem 2rem;
        min-width: 120px;
    }
    
    /* Ant Pool Roulette Mobile */
    .criteria-roulette {
        min-height: 150px;
        padding: 1rem;
        margin: 0.5rem 0;
    }
    
    .game-icon,
    .remote-icon {
        font-size: 2rem;
        margin-bottom: 0.75rem;
    }
    
    .ant-march {
        font-size: 1.5rem;
    }
    
    /* Mode Options and Game Grids Mobile */
    .mode-option,
    .game-card,
    .remote-option {
        padding: 1rem;
    }
    
    .mode-option h3,
    .game-card h4,
    .remote-option h4 {
        font-size: 1rem;
    }
    
    .mode-option p,
    .game-card p,
    .remote-option p {
        font-size: 0.85rem;
    }
}

/* Extra small mobile devices */
@media (max-width: 480px) {
    .modal-content {
        max-height: 98vh !important;
        margin: 0.25rem;
    }
    
    .modal-header {
        padding: 1rem;
    }
    
    .modal-header h2 {
        font-size: 1.25rem;
    }
    
    .modal-body {
        padding: 0.75rem !important;
    }
    
    .challenge-intro h3 {
        font-size: 1.25rem;
    }
    
    .challenge-intro p {
        font-size: 0.875rem;
    }
    
    .player-checkbox-item {
        padding: 0.5rem;
    }
    
    .player-checkbox-avatar {
        width: 30px;
        height: 30px;
        font-size: 0.9rem;
    }
    
    .player-checkbox-name {
        font-size: 0.875rem;
    }
    
    input[type="checkbox"] {
        width: 20px !important;
        height: 20px !important;
    }
    
    .dice,
    .card-back {
        font-size: 3rem;
    }
    
    .playing-card.large {
        font-size: 2rem;
        padding: 1rem 1.5rem;
        min-width: 100px;
    }
    
    .game-icon,
    .remote-icon {
        font-size: 1.75rem;
    }
}
