/* ==========================================
   Burhani Guards - Main Stylesheet
   Cream/Beige Theme Design System
   ========================================== */

/* CSS Custom Properties (Design Tokens) */
:root {
  /* Colors - Cream/Beige Theme */
  --color-bg-primary: #FAF8F4;
  --color-bg-secondary: #FFFFFF;
  --color-bg-tertiary: #F5F3EF;
  --color-bg-card: #FFFFFF;

  /* Accent Colors - Brown/Tan */
  --color-accent-primary: #8B7355;
  --color-accent-secondary: #A69076;
  --color-accent-dark: #6B5A45;
  --color-accent-darker: #5A4A38;
  --color-accent-gradient: linear-gradient(135deg, #8B7355 0%, #A69076 100%);
  --color-accent-light: rgba(139, 115, 85, 0.08);

  /* Text Colors */
  --color-text-primary: #2C2824;
  --color-text-secondary: #6B6560;
  --color-text-muted: #9C9690;
  --color-text-brand: #8B7355;

  /* Status Colors */
  --color-success: #4CAF50;
  --color-success-light: rgba(76, 175, 80, 0.12);
  --color-warning: #E5A637;
  --color-warning-light: rgba(229, 166, 55, 0.12);
  --color-error: #E57373;
  --color-error-light: rgba(229, 115, 115, 0.12);
  --color-info: #64B5F6;
  --color-ongoing: #E5A637;

  /* Border */
  --color-border: #E8E4DE;
  --color-border-light: #F0ECE6;

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

  /* Border Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-2xl: 1.5rem;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(44, 40, 36, 0.04);
  --shadow-md: 0 4px 12px rgba(44, 40, 36, 0.06);
  --shadow-lg: 0 8px 24px rgba(44, 40, 36, 0.08);
  --shadow-card: 0 2px 8px rgba(44, 40, 36, 0.04);

  /* Typography */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-base: 1rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.25rem;
  --font-size-2xl: 1.5rem;
  --font-size-3xl: 2rem;
  --font-size-4xl: 2.5rem;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 350ms ease;

  /* Safe areas for mobile */
  --safe-area-bottom: env(safe-area-inset-bottom, 0px);
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

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

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 600;
  line-height: 1.3;
  color: var(--color-text-primary);
}

h1 {
  font-size: var(--font-size-3xl);
}

h2 {
  font-size: var(--font-size-2xl);
}

h3 {
  font-size: var(--font-size-xl);
}

h4 {
  font-size: var(--font-size-lg);
}

p {
  color: var(--color-text-secondary);
}

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

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

/* Layout */
.container {
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  padding: 0 var(--space-md);
}

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-bottom: 80px;
  /* Space for bottom nav */
}

.page-content {
  flex: 1;
  padding: var(--space-lg) 0;
}

/* ==========================================
   Top Header
   ========================================== */
.top-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-md);
  background: var(--color-bg-secondary);
}

.header-brand {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.header-logo {
  width: 32px;
  height: 32px;
}

.header-title {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: #2d5016;
}

.header-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--color-bg-tertiary);
  border: 2px solid var(--color-border);
}

/* ==========================================
   Bottom Navigation
   ========================================== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--color-bg-secondary);
  border-top: 1px solid var(--color-border);
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: var(--space-sm) 0;
  padding-bottom: calc(var(--space-sm) + var(--safe-area-bottom));
  z-index: 100;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: var(--space-sm) var(--space-md);
  color: var(--color-text-muted);
  text-decoration: none;
  font-size: var(--font-size-xs);
  transition: color var(--transition-fast);
}

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

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

.nav-icon {
  width: 24px;
  height: 24px;
}

/* ==========================================
   Cards
   ========================================== */
.card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-lg);
  box-shadow: var(--shadow-card);
}

.card-header {
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--color-border-light);
}

.card-title {
  font-size: var(--font-size-lg);
  margin-bottom: 0;
}

/* ==========================================
   Stat Cards
   ========================================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
}

.stat-card {
  background: var(--color-bg-tertiary);
  border-radius: var(--radius-xl);
  padding: var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.stat-card-dark {
  background: #1e293b;
  color: white;
}

.stat-card-dark .stat-label {
  color: rgba(255, 255, 255, 0.7);
}

.stat-icon {
  font-size: 1.25rem;
  margin-bottom: var(--space-xs);
}

.stat-value {
  font-size: var(--font-size-3xl);
  font-weight: 700;
  line-height: 1;
}

.stat-label {
  font-size: var(--font-size-xs);
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ==========================================
   Buttons
   ========================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-xl);
  font-size: var(--font-size-base);
  font-weight: 600;
  border: none;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
}

/* Primary Button - Main CTA */
.btn-primary {
  background: var(--color-accent-primary);
  color: white;
  box-shadow: var(--shadow-md);
}

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

.btn-primary:active {
  background: var(--color-accent-darker);
  transform: translateY(0);
}

/* Secondary Button */
.btn-secondary {
  background: var(--color-bg-tertiary);
  color: var(--color-text-primary);
}

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

.btn-secondary:active {
  background: #D8D4CE;
}

/* Success Button */
.btn-success {
  background: var(--color-success);
  color: white;
}

.btn-success:hover {
  background: #3D8B40;
  color: white;
}

.btn-success:active {
  background: #2E6B30;
}

/* Danger Button */
.btn-danger {
  background: var(--color-error);
  color: white;
}

.btn-danger:hover {
  background: #D65C5C;
  color: white;
}

.btn-danger:active {
  background: #C74545;
}

/* Warning Button */
.btn-warning {
  background: var(--color-warning);
  color: #1a1a1a;
}

.btn-warning:hover {
  background: #D4962F;
  color: #1a1a1a;
}

.btn-warning:active {
  background: #C38827;
}

/* Info Button */
.btn-info {
  background: var(--color-info);
  color: white;
}

.btn-info:hover {
  background: #4BA3E8;
  color: white;
}

.btn-info:active {
  background: #3A92D7;
}

/* Outline Buttons */
.btn-outline {
  background: transparent;
  border: 2px solid var(--color-border);
  color: var(--color-text-primary);
}

.btn-outline:hover {
  background: var(--color-bg-tertiary);
  border-color: var(--color-text-muted);
  color: var(--color-text-primary);
}

.btn-outline:active {
  background: var(--color-border);
}

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

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

.btn-outline-danger:active {
  background: #D65C5C;
  border-color: #D65C5C;
}

/* Size Variants */
.btn-lg {
  padding: var(--space-md) var(--space-2xl);
  font-size: var(--font-size-lg);
}

.btn-sm {
  padding: var(--space-sm) var(--space-lg);
  font-size: var(--font-size-sm);
}

.btn-xs {
  padding: var(--space-xs) var(--space-md);
  font-size: var(--font-size-xs);
}

.btn-block {
  width: 100%;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.btn:disabled:hover {
  transform: none;
}

/* ==========================================
   Forms
   ========================================== */
.form-group {
  margin-bottom: var(--space-lg);
}

.form-label {
  display: block;
  margin-bottom: var(--space-sm);
  font-weight: 500;
  font-size: var(--font-size-sm);
  color: var(--color-text-primary);
}

.form-control {
  width: 100%;
  padding: var(--space-md) var(--space-lg);
  font-size: var(--font-size-base);
  color: var(--color-text-primary);
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  transition: all var(--transition-fast);
}

.form-control:focus {
  outline: none;
  border-color: var(--color-accent-primary);
  box-shadow: 0 0 0 3px var(--color-accent-light);
}

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

/* Input with icon */
.input-group {
  position: relative;
}

.input-icon {
  position: absolute;
  left: var(--space-lg);
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-muted);
  font-size: 1.25rem;
}

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

.input-action {
  position: absolute;
  right: var(--space-md);
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--color-text-muted);
  cursor: pointer;
}

/* ==========================================
   Tabs / Filter Pills
   ========================================== */
.tabs {
  display: flex;
  gap: var(--space-xs);
  border-bottom: 1px solid var(--color-border);
  margin-bottom: var(--space-lg);
}

.tab {
  padding: var(--space-sm) var(--space-md);
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--color-text-muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
}

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

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

/* ==========================================
   Event Cards
   ========================================== */
.event-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-lg);
  margin-bottom: var(--space-md);
}

.event-title {
  font-size: var(--font-size-lg);
  font-weight: 700;
  margin-bottom: var(--space-xs);
}

.event-date {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-md);
}

.event-progress {
  background: var(--color-bg-tertiary);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  margin-bottom: var(--space-md);
}

.progress-text {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-sm);
}

.progress-bar {
  height: 6px;
  background: var(--color-border);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--color-accent-primary);
  border-radius: var(--radius-full);
  transition: width var(--transition-base);
}

/* ==========================================
   Badges
   ========================================== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: var(--space-xs) var(--space-sm);
  font-size: var(--font-size-xs);
  font-weight: 500;
  border-radius: var(--radius-md);
}

.badge-success {
  background: var(--color-success-light);
  color: var(--color-success);
}

.badge-warning {
  background: var(--color-warning-light);
  color: var(--color-warning);
}

.badge-error {
  background: var(--color-error-light);
  color: var(--color-error);
}

.badge-neutral {
  background: var(--color-bg-tertiary);
  color: var(--color-text-secondary);
}

/* ==========================================
   Activity List
   ========================================== */
.activity-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.activity-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-md) 0;
  border-bottom: 1px solid var(--color-border-light);
}

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

.activity-content {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.activity-time {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
}

/* ==========================================
   Horizontal Scroll Cards
   ========================================== */
.horizontal-scroll {
  display: flex;
  gap: var(--space-md);
  overflow-x: auto;
  padding: var(--space-sm) 0;
  margin: 0 calc(-1 * var(--space-md));
  padding-left: var(--space-md);
  padding-right: var(--space-md);
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.horizontal-scroll::-webkit-scrollbar {
  display: none;
}

.scroll-card {
  flex: 0 0 160px;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-md);
}

.scroll-card-title {
  font-size: var(--font-size-sm);
  font-weight: 600;
  margin-bottom: var(--space-xs);
}

.scroll-card-date {
  font-size: var(--font-size-xs);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-md);
}

/* ==========================================
   Profile Page
   ========================================== */
.profile-header {
  text-align: center;
  padding: var(--space-xl) 0;
}

.profile-avatar {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--color-bg-tertiary);
  margin-bottom: var(--space-md);
}

.profile-name {
  font-size: var(--font-size-2xl);
  font-weight: 700;
  margin-bottom: var(--space-xs);
}

.profile-role {
  font-size: var(--font-size-base);
  color: var(--color-text-secondary);
}

.profile-list {
  background: var(--color-bg-card);
  border-radius: var(--radius-xl);
  overflow: hidden;
}

.profile-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-lg);
  border-bottom: 1px solid var(--color-border-light);
}

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

.profile-label {
  font-size: var(--font-size-base);
  color: var(--color-text-primary);
}

.profile-value {
  font-size: var(--font-size-base);
  color: var(--color-text-secondary);
}

.profile-arrow {
  color: var(--color-text-muted);
  margin-left: var(--space-sm);
}

/* ==========================================
   Auth Pages
   ========================================== */
.auth-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-xl);
  background: var(--color-bg-primary);
}

.auth-card {
  width: 100%;
  max-width: 400px;
}

.auth-header {
  text-align: center;
  margin-bottom: var(--space-2xl);
}

.auth-logo {
  width: 80px;
  height: 80px;
  margin: 0 auto var(--space-lg);
  background: var(--color-bg-tertiary);
  border-radius: var(--radius-xl);
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-logo svg {
  width: 48px;
  height: 48px;
  color: var(--color-accent-primary);
}

.auth-title {
  font-size: var(--font-size-2xl);
  font-weight: 600;
  margin-bottom: var(--space-sm);
}

.auth-subtitle {
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
}

.auth-footer {
  text-align: center;
  margin-top: var(--space-xl);
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
}

.auth-back {
  position: absolute;
  top: var(--space-lg);
  left: var(--space-lg);
  font-size: 1.5rem;
  color: var(--color-text-primary);
  text-decoration: none;
}

/* ==========================================
   Loading & Toasts
   ========================================== */
.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--color-border);
  border-top: 3px solid var(--color-accent-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.toast-container {
  position: fixed;
  top: var(--space-lg);
  right: var(--space-lg);
  left: var(--space-lg);
  z-index: 1100;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.toast {
  padding: var(--space-md) var(--space-lg);
  background: var(--color-bg-card);
  border-left: 4px solid;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  animation: slideIn 0.3s ease;
}

.toast-success {
  border-color: var(--color-success);
}

.toast-error {
  border-color: var(--color-error);
}

.toast-warning {
  border-color: var(--color-warning);
}

.toast-info {
  border-color: var(--color-info);
}

@keyframes slideIn {
  from {
    transform: translateY(-100%);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* ==========================================
   Utilities
   ========================================== */
.text-center {
  text-align: center;
}

.text-left {
  text-align: left;
}

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

.mt-1 {
  margin-top: var(--space-sm);
}

.mt-2 {
  margin-top: var(--space-md);
}

.mt-3 {
  margin-top: var(--space-lg);
}

.mt-4 {
  margin-top: var(--space-xl);
}

.mb-1 {
  margin-bottom: var(--space-sm);
}

.mb-2 {
  margin-bottom: var(--space-md);
}

.mb-3 {
  margin-bottom: var(--space-lg);
}

.mb-4 {
  margin-bottom: var(--space-xl);
}

.hidden {
  display: none !important;
}

.visible {
  display: block !important;
}

.flex {
  display: flex;
}

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.gap-1 {
  gap: var(--space-sm);
}

.gap-2 {
  gap: var(--space-md);
}

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

.section-title {
  font-size: var(--font-size-lg);
  font-weight: 700;
  margin-bottom: var(--space-md);
}

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

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

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

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

@media (max-width: 768px) {

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

/* Avatar */
.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--color-bg-tertiary);
}

.avatar-lg {
  width: 80px;
  height: 80px;
}

/* Welcome Section */
.welcome-section {
  margin-bottom: var(--space-xl);
}

.welcome-text {
  font-size: var(--font-size-2xl);
  font-weight: 700;
}

/* ==========================================
   Global Mobile Improvements
   ========================================== */

/* Floating Action Button - Global Style */
.fab {
  position: fixed;
  bottom: 100px;
  right: 1rem;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--color-accent-gradient);
  color: white;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s, box-shadow 0.2s;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.fab:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
  color: white;
}

/* Better button variants */
.btn-outline-primary {
  background: transparent;
  border: 2px solid var(--color-accent-primary);
  color: var(--color-accent-primary);
}

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

.btn-outline-primary:active {
  background: var(--color-accent-dark);
  border-color: var(--color-accent-dark);
}

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

.btn-outline-secondary:hover {
  background: var(--color-bg-tertiary);
  border-color: var(--color-text-muted);
  color: var(--color-text-primary);
}

.btn-outline-secondary:active {
  background: var(--color-border);
}

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

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

.btn-outline-success:active {
  background: #3D8B40;
  border-color: #3D8B40;
}

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

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

.btn-outline-error:active {
  background: #D65C5C;
  border-color: #D65C5C;
}

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

.btn-outline-warning:hover {
  background: var(--color-warning);
  color: #1a1a1a;
}

.btn-outline-warning:active {
  background: #D4962F;
  border-color: #D4962F;
}

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

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

.btn-outline-info:active {
  background: #4BA3E8;
  border-color: #4BA3E8;
}

/* Badge additional styles */
.badge-secondary {
  background: var(--color-bg-tertiary);
  color: var(--color-text-secondary);
}

.badge-info {
  background: rgba(6, 182, 212, 0.15);
  color: var(--color-info);
}

.badge-primary {
  background: var(--color-accent-light);
  color: var(--color-accent-primary);
}

/* Card with better mobile spacing */
@media (max-width: 480px) {
  .card {
    padding: var(--space-md);
  }

  .stats-grid {
    gap: var(--space-sm);
  }

  .stat-card {
    padding: var(--space-md);
  }

  .stat-value {
    font-size: var(--font-size-2xl);
  }

  h2 {
    font-size: var(--font-size-xl);
  }

  h3 {
    font-size: var(--font-size-lg);
  }

  .btn {
    padding: var(--space-sm) var(--space-md);
    font-size: var(--font-size-sm);
  }

  .btn-sm {
    padding: var(--space-xs) var(--space-sm);
    font-size: var(--font-size-xs);
  }

  /* Fix flex wrapping on mobile */
  .flex-wrap-mobile {
    flex-wrap: wrap;
  }

  /* Bottom action buttons should stack */
  .card-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
  }

  .card-actions .btn {
    width: 100%;
    justify-content: center;
  }
}

/* ==========================================
   Enhanced Mobile Responsiveness
   ========================================== */

/* Mobile-friendly layout utilities */
@media (max-width: 640px) {

  /* Force vertical stacking on mobile */
  .mobile-stack {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: var(--space-md) !important;
  }

  /* Stack buttons vertically on mobile */
  .mobile-btn-stack {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: var(--space-sm);
  }

  .mobile-btn-stack .btn,
  .mobile-btn-stack a {
    width: 100%;
    justify-content: center;
  }

  /* Full width on mobile */
  .mobile-full-width {
    width: 100% !important;
  }

  /* Prevent text overflow */
  h1,
  h2,
  h3,
  h4,
  h5,
  h6 {
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
  }

  /* Better paragraph handling */
  p {
    word-wrap: break-word;
    overflow-wrap: break-word;
  }

  /* Ensure all tables are scrollable */
  table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
  }

  /* Improve form layout on mobile */
  .form-control {
    font-size: 16px;
    /* Prevents zoom on iOS */
  }

  /* Better spacing for participant items */
  .participant-item {
    flex-direction: column;
    align-items: flex-start !important;
    gap: var(--space-sm);
  }

  .participant-actions {
    width: 100%;
    flex-direction: column;
  }

  .participant-actions .btn,
  .participant-actions a,
  .participant-actions form {
    width: 100%;
  }

  .participant-actions button {
    width: 100%;
  }

  /* Card content stacking */
  .card>div[style*="display: flex"] {
    flex-direction: column;
    align-items: flex-start !important;
  }

  /* Improve horizontal scroll containers */
  .horizontal-scroll {
    margin: 0 calc(-1 * var(--space-md));
    padding: var(--space-sm) var(--space-md);
  }
}

/* Tablet optimizations */
@media (min-width: 641px) and (max-width: 1024px) {
  .container {
    max-width: 720px;
  }

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

/* Touch-friendly improvements for all mobile devices */
@media (hover: none) and (pointer: coarse) {

  /* Ensure all interactive elements are at least 44x44px */
  .btn,
  button,
  a.btn,
  input[type="submit"],
  input[type="button"] {
    min-height: 44px;
    min-width: 44px;
  }

  /* Remove hover effects on touch devices */
  .btn:hover,
  .nav-item:hover,
  a:hover {
    transform: none;
  }
}