/* =============================================
   THE COTTAGE BOUNTY BOARD — Design System
   Theme: "Campfire at Night"
   ============================================= */

/* ---------------------
   CSS Custom Properties
   --------------------- */
:root {
  --bg-primary: #0f1419;
  --bg-secondary: #1a2332;
  --bg-card: #1e2d3d;
  --bg-card-hover: #243447;
  --bg-input: #162029;
  --bg-overlay: rgba(0, 0, 0, 0.7);

  --accent-gold: #f4a825;
  --accent-gold-light: #ffc94d;
  --accent-gold-dark: #c4851a;
  --accent-gold-glow: rgba(244, 168, 37, 0.3);
  --accent-green: #2d9b5a;
  --accent-green-light: #3ec96f;
  --accent-red: #e04545;
  --accent-red-light: #ff6b6b;
  --accent-blue: #3b82f6;
  --accent-purple: #a855f7;

  --text-primary: #e8e6e3;
  --text-secondary: #8899a6;
  --text-heading: #ffffff;
  --text-muted: #5a6a7a;

  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-accent: rgba(244, 168, 37, 0.4);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 20px var(--accent-gold-glow);
  --shadow-glow-strong: 0 0 40px var(--accent-gold-glow);

  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;

  --transition-fast: 150ms ease;
  --transition-normal: 250ms ease;
  --transition-slow: 400ms ease;

  --navbar-height: 64px;

  /* Category colors */
  --cat-groom: #f4a825;
  --cat-leafs: #3b82f6;
  --cat-golf: #2d9b5a;
  --cat-chaos: #a855f7;
}

/* ---------------------
   Reset & Base
   --------------------- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-body);
  background: var(--bg-primary);
  background-image:
    radial-gradient(ellipse at 50% 0%, rgba(244, 168, 37, 0.05) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 100%, rgba(59, 130, 246, 0.03) 0%, transparent 50%);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body::-webkit-scrollbar {
  width: 6px;
}

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

body::-webkit-scrollbar-thumb {
  background: var(--text-muted);
  border-radius: 3px;
}

/* ---------------------
   Typography
   --------------------- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--text-heading);
  line-height: 1.2;
  font-weight: 700;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.2rem; }

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

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

/* ---------------------
   Layout
   --------------------- */
.container {
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding: 0 16px;
}

.page {
  padding-top: calc(var(--navbar-height) + 20px);
  padding-bottom: calc(var(--navbar-height) + 20px); /* Add padding for bottom navigation on mobile */
  min-height: 100vh;
}

.page-header {
  text-align: center;
  margin-bottom: 28px;
}

.page-header h1 {
  font-size: 1.75rem;
  font-weight: 800;
  margin-bottom: 4px;
}

.page-header .subtitle {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* ---------------------
   Navbar
   --------------------- */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--navbar-height);
  background: rgba(15, 20, 25, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
}

.navbar::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent-gold), transparent);
  opacity: 0.6;
}

.navbar-logo {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--text-heading);
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.navbar-logo .emoji {
  font-size: 1.3rem;
}

.navbar-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--navbar-height);
  background: rgba(15, 20, 25, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border-subtle);
  z-index: 1999; /* Float above content, below overlays */
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 0 8px;
}

.navbar-nav::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent-gold), transparent);
  opacity: 0.6;
}

.navbar-nav .nav-link {
  flex: 1;
  max-width: 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 4px 0;
  color: var(--text-secondary);
  font-size: 0.6rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: all var(--transition-fast);
  cursor: pointer;
  border: none;
  background: none;
}

.navbar-nav .nav-link .nav-icon {
  font-size: 1.2rem;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
  color: var(--accent-gold);
  background: transparent;
}

.navbar-user {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-full);
  transition: background var(--transition-fast);
}

.navbar-user:hover {
  background: rgba(255, 255, 255, 0.05);
}

.navbar-user .user-avatar-sm {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border-accent);
}

/* ---------------------
   Cards
   --------------------- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 20px;
  transition: all var(--transition-normal);
  box-shadow: var(--shadow-card);
}

.card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.12);
  transform: translateY(-2px);
}

.card-static {
  composes: card;
}

.card-static:hover {
  transform: none;
  background: var(--bg-card);
}

/* ---------------------
   Buttons
   --------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
  overflow: hidden;
  text-decoration: none;
}

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

.btn-primary {
  background: linear-gradient(135deg, var(--accent-gold), var(--accent-gold-dark));
  color: #0f1419;
  box-shadow: 0 2px 12px var(--accent-gold-glow);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--accent-gold-light), var(--accent-gold));
  box-shadow: 0 4px 20px var(--accent-gold-glow);
  transform: translateY(-1px);
}

.btn-success {
  background: linear-gradient(135deg, var(--accent-green), #228b4a);
  color: white;
}

.btn-success:hover {
  background: linear-gradient(135deg, var(--accent-green-light), var(--accent-green));
}

.btn-danger {
  background: linear-gradient(135deg, var(--accent-red), #c33);
  color: white;
}

.btn-danger:hover {
  background: linear-gradient(135deg, var(--accent-red-light), var(--accent-red));
}

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

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.15);
}

.btn-sm {
  padding: 6px 14px;
  font-size: 0.8rem;
}

.btn-lg {
  padding: 14px 28px;
  font-size: 1rem;
}

.btn-block {
  display: flex;
  width: 100%;
}

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

/* ---------------------
   Avatars
   --------------------- */
.avatar {
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border-subtle);
  background: var(--bg-secondary);
  flex-shrink: 0;
}

.avatar-sm { width: 36px; height: 36px; }
.avatar-md { width: 48px; height: 48px; }
.avatar-lg { width: 64px; height: 64px; }
.avatar-xl { width: 120px; height: 120px; }
.avatar-xxl { width: 160px; height: 160px; }

.avatar-initials {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-family: var(--font-heading);
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}

/* ---------------------
   Login Page
   --------------------- */
.login-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px 16px;
}

.login-hero {
  text-align: center;
  margin-bottom: 40px;
}

.login-hero .campfire {
  font-size: 4rem;
  margin-bottom: 16px;
  animation: flicker 2s ease-in-out infinite alternate;
}

.login-hero h1 {
  font-size: 2rem;
  font-weight: 900;
  background: linear-gradient(135deg, var(--accent-gold-light), var(--accent-gold), var(--accent-gold-dark));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
}

.login-hero .groom-name {
  font-size: 2.5rem;
}

.login-hero .tagline {
  color: var(--text-secondary);
  font-size: 1rem;
  font-style: italic;
}

.login-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  width: 100%;
  max-width: 400px;
}

.login-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 20px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-normal);
  color: var(--text-primary);
  font-family: var(--font-body);
}

.login-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-accent);
  transform: translateY(-3px);
  box-shadow: var(--shadow-glow);
}

.login-btn .login-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.1rem;
  color: white;
}

.login-btn .login-name {
  font-weight: 600;
  font-size: 0.95rem;
}

.login-admin-link {
  margin-top: 32px;
  color: var(--text-muted);
  font-size: 0.8rem;
  cursor: pointer;
  transition: color var(--transition-fast);
}

.login-admin-link:hover {
  color: var(--text-secondary);
}

/* ---------------------
   Scoreboard
   --------------------- */
.stakes-card {
  background: linear-gradient(135deg, rgba(244, 168, 37, 0.08), rgba(244, 168, 37, 0.02));
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 24px;
}

.stakes-card h3 {
  font-size: 1rem;
  color: var(--accent-gold);
  margin-bottom: 12px;
}

.stakes-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 8px;
  font-size: 0.85rem;
  line-height: 1.5;
}

.stakes-row:last-child { margin-bottom: 0; }

.stakes-row .stakes-emoji {
  font-size: 1.2rem;
  flex-shrink: 0;
}

.stakes-row .stakes-label {
  color: var(--text-secondary);
}

.stakes-row strong {
  color: var(--text-primary);
}

.scoreboard-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.player-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.player-row:hover {
  background: var(--bg-card-hover);
  transform: translateX(4px);
}

.player-row.rank-1 {
  border-color: var(--accent-gold);
  box-shadow: 0 0 20px rgba(244, 168, 37, 0.15);
}

.player-row.rank-2 {
  border-color: #adb5bd;
}

.player-row.rank-3 {
  border-color: #cd7f32;
}

.player-row.is-current-user {
  background: rgba(244, 168, 37, 0.05);
}

.player-rank {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--text-muted);
  min-width: 32px;
  text-align: center;
}

.rank-1 .player-rank { color: var(--accent-gold); }
.rank-2 .player-rank { color: #adb5bd; }
.rank-3 .player-rank { color: #cd7f32; }

.player-info {
  flex: 1;
  min-width: 0;
}

.player-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-heading);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-bounties {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.player-points {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.3rem;
  color: var(--accent-gold);
  text-align: right;
  min-width: 60px;
}

.player-points .pts-label {
  font-size: 0.6rem;
  font-weight: 500;
  color: var(--text-muted);
  display: block;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.points-bar-container {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.03);
}

.points-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-gold), var(--accent-gold-light));
  border-radius: 0 3px 3px 0;
  transition: width 1s ease-out;
}

/* ---------------------
   Bounty Board
   --------------------- */
.bounty-category {
  margin-bottom: 28px;
}

.category-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  cursor: pointer;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 14px;
  user-select: none;
}

.category-header h2 {
  font-size: 1.15rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.category-header .category-count {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-secondary);
  padding: 2px 10px;
  border-radius: var(--radius-full);
}

.category-header .chevron {
  color: var(--text-muted);
  transition: transform var(--transition-normal);
  font-size: 1.2rem;
}

.category-header.collapsed .chevron {
  transform: rotate(-90deg);
}

.bounty-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.bounty-list.collapsed {
  display: none;
}

.bounty-card {
  position: relative;
  padding: 16px;
  padding-left: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  transition: all var(--transition-normal);
  overflow: hidden;
}

.bounty-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
}

.bounty-card.cat-groom::before { background: var(--cat-groom); }
.bounty-card.cat-leafs::before { background: var(--cat-leafs); }
.bounty-card.cat-golf::before { background: var(--cat-golf); }
.bounty-card.cat-chaos::before { background: var(--cat-chaos); }

.bounty-card:hover {
  background: var(--bg-card-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
}

.bounty-card.claimed {
  opacity: 0.7;
  border-color: var(--accent-green);
}

.bounty-card.pending-claim {
  border-color: var(--accent-gold);
}

.bounty-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.bounty-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-heading);
}

.bounty-points-badge {
  display: flex;
  align-items: center;
  gap: 4px;
  background: linear-gradient(135deg, var(--accent-gold), var(--accent-gold-dark));
  color: #0f1419;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 0.8rem;
  white-space: nowrap;
  flex-shrink: 0;
  box-shadow: 0 2px 8px var(--accent-gold-glow);
}

.bounty-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 12px;
}

.bounty-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.bounty-proof-type {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.bounty-status {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: var(--radius-full);
}

.bounty-status.status-pending {
  background: rgba(244, 168, 37, 0.15);
  color: var(--accent-gold);
}

.bounty-status.status-approved {
  background: rgba(45, 155, 90, 0.15);
  color: var(--accent-green-light);
}

.bounty-status.status-rejected {
  background: rgba(224, 69, 69, 0.15);
  color: var(--accent-red-light);
}

/* ---------------------
   Profile Page
   --------------------- */
.profile-section {
  text-align: center;
  margin-bottom: 32px;
}

.avatar-upload-wrapper {
  position: relative;
  display: inline-block;
  cursor: pointer;
  margin-bottom: 16px;
}

.avatar-upload-wrapper::after {
  content: '📷';
  position: absolute;
  bottom: 8px;
  right: 8px;
  width: 36px;
  height: 36px;
  background: var(--accent-gold);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  border: 3px solid var(--bg-primary);
  transition: transform var(--transition-fast);
}

.avatar-upload-wrapper:hover::after {
  transform: scale(1.1);
}

.avatar-upload-wrapper img {
  border: 3px solid var(--border-accent);
}

.profile-name {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: center;
}

.stat-card .stat-value {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.8rem;
  color: var(--accent-gold);
}

.stat-card .stat-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 4px;
}

.profile-claims-section h3 {
  margin-bottom: 14px;
  font-size: 1rem;
}

.claim-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
}

.claim-item .claim-title {
  font-weight: 500;
  font-size: 0.9rem;
}

.claim-item .claim-points {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--accent-gold);
}

/* ---------------------
   Admin Panel
   --------------------- */
.admin-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 24px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: 4px;
}

.admin-tab {
  flex: 1;
  padding: 10px;
  text-align: center;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.admin-tab.active {
  background: var(--bg-card);
  color: var(--accent-gold);
  box-shadow: var(--shadow-card);
}

.admin-tab:hover:not(.active) {
  color: var(--text-primary);
}

.admin-claim-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 12px;
}

.admin-claim-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.admin-claim-info {
  flex: 1;
}

.admin-claim-info .claim-user {
  font-weight: 600;
  font-size: 0.9rem;
}

.admin-claim-info .claim-bounty {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.admin-claim-info .claim-time {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.admin-claim-notes {
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 12px;
  font-style: italic;
}

.admin-claim-proof {
  margin-bottom: 12px;
}

.admin-claim-proof img {
  max-width: 100%;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
}

.admin-claim-actions {
  display: flex;
  gap: 8px;
}

/* Admin Bounty List */
.admin-bounty-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  margin-bottom: 8px;
  transition: all var(--transition-fast);
}

.admin-bounty-item.inactive {
  opacity: 0.5;
}

.admin-bounty-info {
  flex: 1;
  min-width: 0;
}

.admin-bounty-title {
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-bounty-meta {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.admin-bounty-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

/* Toggle Switch */
.toggle-switch {
  position: relative;
  width: 44px;
  height: 24px;
  background: var(--text-muted);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: background var(--transition-fast);
  flex-shrink: 0;
}

.toggle-switch.active {
  background: var(--accent-green);
}

.toggle-switch::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background: white;
  border-radius: 50%;
  transition: transform var(--transition-fast);
}

.toggle-switch.active::after {
  transform: translateX(20px);
}

/* ---------------------
   Forms
   --------------------- */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-input,
.form-textarea,
.form-select {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.9rem;
  transition: border-color var(--transition-fast);
  outline: none;
}

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

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

.form-select {
  appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238899a6' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.form-select option {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

/* ---------------------
   Modal
   --------------------- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg-overlay);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 2000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: fadeIn 200ms ease;
}

@media (min-height: 600px) {
  .modal-overlay {
    align-items: center;
  }
}

.modal-content {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: 24px;
  width: 100%;
  max-width: 480px;
  max-height: 85vh;
  overflow-y: auto;
  animation: slideUp 300ms ease;
}

@media (min-height: 600px) {
  .modal-content {
    border-radius: var(--radius-lg);
  }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.modal-header h3 {
  font-size: 1.2rem;
}

.modal-close {
  width: 32px;
  height: 32px;
  border: none;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

.modal-footer {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 20px;
}

/* ---------------------
   Toasts
   --------------------- */
#toast-container {
  position: fixed;
  top: calc(var(--navbar-height) + 12px);
  right: 16px;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  animation: slideInRight 300ms ease;
  pointer-events: auto;
  cursor: pointer;
  max-width: 340px;
  box-shadow: var(--shadow-card);
}

.toast.toast-success {
  background: rgba(45, 155, 90, 0.95);
  color: white;
  border-left: 4px solid var(--accent-green-light);
}

.toast.toast-error {
  background: rgba(224, 69, 69, 0.95);
  color: white;
  border-left: 4px solid var(--accent-red-light);
}

.toast.toast-info {
  background: rgba(59, 130, 246, 0.95);
  color: white;
  border-left: 4px solid var(--accent-blue);
}

.toast.removing {
  animation: slideOutRight 300ms ease forwards;
}

/* ---------------------
   Empty States & Loading
   --------------------- */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-secondary);
}

.empty-state .empty-emoji {
  font-size: 3rem;
  margin-bottom: 12px;
}

.empty-state p {
  font-size: 0.9rem;
  max-width: 280px;
  margin: 0 auto;
}

.loading-spinner {
  display: flex;
  justify-content: center;
  padding: 48px;
}

.loading-spinner::after {
  content: '';
  width: 36px;
  height: 36px;
  border: 3px solid var(--border-subtle);
  border-top-color: var(--accent-gold);
  border-radius: 50%;
  animation: spin 800ms linear infinite;
}

/* ---------------------
   File Upload
   --------------------- */
.file-upload-area {
  border: 2px dashed var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  color: var(--text-secondary);
}

.file-upload-area:hover {
  border-color: var(--accent-gold);
  background: rgba(244, 168, 37, 0.05);
}

.file-upload-area .upload-icon {
  font-size: 2rem;
  margin-bottom: 8px;
}

.file-upload-area p {
  font-size: 0.85rem;
}

.file-preview {
  margin-top: 12px;
}

.file-preview img {
  max-width: 100%;
  max-height: 200px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

/* ---------------------
   Utilities
   --------------------- */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-sm { gap: 8px; }
.gap-md { gap: 16px; }
.mt-sm { margin-top: 8px; }
.mt-md { margin-top: 16px; }
.mt-lg { margin-top: 24px; }
.mb-sm { margin-bottom: 8px; }
.mb-md { margin-bottom: 16px; }
.text-center { text-align: center; }
.text-muted { color: var(--text-secondary); }
.text-gold { color: var(--accent-gold); }
.text-sm { font-size: 0.8rem; }
.fw-bold { font-weight: 700; }
.hidden { display: none !important; }

/* ---------------------
   Animations
   --------------------- */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

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

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

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

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

@keyframes flicker {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.8; transform: scale(1.02); }
}

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 8px var(--accent-gold-glow); }
  50% { box-shadow: 0 0 20px var(--accent-gold-glow); }
}

/* ---------------------
   Responsive
   --------------------- */
@media (min-width: 768px) {
  .login-grid {
    grid-template-columns: repeat(3, 1fr);
    max-width: 500px;
  }

  .login-hero h1 {
    font-size: 2.5rem;
  }

  .login-hero .groom-name {
    font-size: 3rem;
  }

  .container {
    max-width: 720px;
  }

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

  .page {
    padding-bottom: 40px;
  }

  .navbar-nav {
    position: static;
    height: auto;
    background: transparent;
    backdrop-filter: none;
    border-top: none;
    z-index: auto;
    display: flex;
    justify-content: flex-start;
    padding: 0;
    gap: 4px;
  }

  .navbar-nav::after {
    display: none;
  }

  .navbar-nav .nav-link {
    flex: none;
    max-width: none;
    padding: 6px 12px;
    font-size: 0.65rem;
  }

  .navbar-nav .nav-link:hover,
  .navbar-nav .nav-link.active {
    background: rgba(244, 168, 37, 0.1);
  }
}

/* Admin password form on admin page */
.admin-login-form {
  max-width: 320px;
  margin: 0 auto;
  text-align: center;
  padding: 48px 0;
}

.admin-login-form h2 {
  margin-bottom: 8px;
}

.admin-login-form p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 24px;
}

.admin-login-form .form-group {
  text-align: left;
}

/* Refresh button */
.refresh-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.2rem;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.refresh-btn:hover {
  color: var(--accent-gold);
  background: rgba(244, 168, 37, 0.1);
}

.refresh-btn.spinning {
  animation: spin 800ms linear;
}

/* Welcome banner */
.welcome-banner {
  text-align: center;
  padding: 12px;
  margin-bottom: 20px;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.welcome-banner strong {
  color: var(--accent-gold);
}

/* ---------------------
   Ledger Page
   --------------------- */
.ledger-filters {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.filter-chip {
  padding: 6px 16px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.filter-chip:hover {
  border-color: var(--accent-gold);
  color: var(--text-primary);
}

.filter-chip.active {
  background: var(--accent-gold);
  border-color: var(--accent-gold);
  color: #0f1419;
  font-weight: 600;
}

.ledger-entry {
  display: flex;
  margin-bottom: 16px;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  transition: all var(--transition-normal);
}

.ledger-entry:hover {
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: var(--shadow-card);
}

.ledger-entry-accent {
  width: 5px;
  flex-shrink: 0;
}

.ledger-entry-content {
  flex: 1;
  padding: 16px;
  min-width: 0;
}

.ledger-entry-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.ledger-user {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.ledger-user-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.ledger-user-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-heading);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ledger-timestamp {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.ledger-badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  white-space: nowrap;
  flex-shrink: 0;
}

.ledger-badge-approved {
  background: rgba(45, 155, 90, 0.15);
  color: var(--accent-green-light);
}

.ledger-badge-pending {
  background: rgba(244, 168, 37, 0.15);
  color: var(--accent-gold);
}

.ledger-bounty-info {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
}

.ledger-cat-emoji {
  font-size: 1.3rem;
  flex-shrink: 0;
  margin-top: 2px;
}

.ledger-bounty-details {
  flex: 1;
  min-width: 0;
}

.ledger-bounty-title {
  display: block;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-heading);
  margin-bottom: 4px;
}

.ledger-bounty-desc {
  display: block;
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.ledger-points-badge {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1rem;
  color: var(--accent-gold);
  background: rgba(244, 168, 37, 0.1);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  white-space: nowrap;
  flex-shrink: 0;
}

.ledger-notes {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.03);
  border-left: 3px solid var(--border-accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin-bottom: 12px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-style: italic;
  line-height: 1.5;
}

.ledger-notes-icon {
  flex-shrink: 0;
}

.ledger-proof {
  margin-top: 4px;
}

.ledger-proof-img {
  width: 100%;
  max-height: 400px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: all var(--transition-normal);
}

.ledger-proof-img:hover {
  border-color: var(--accent-gold);
  box-shadow: var(--shadow-glow);
}

/* Alerts & Admin Reset Section */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  line-height: 1.5;
  border: 1px solid transparent;
}

.alert-danger {
  background: rgba(224, 69, 69, 0.1);
  border-color: rgba(224, 69, 69, 0.25);
  color: var(--accent-red-light);
}

.admin-reset-section {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-top: 12px;
}

