/**
 * SaaDhaGaa PWA Core Styles
 * Consolidated core PWA styles, fixes, and base styling
 * 
 * This file combines:
 * - Base PWA styling
 * - PWA-specific fixes
 * - Login page styles
 * - Theme system
 * - Animation definitions
 */

/* =====================================================
   CSS CUSTOM PROPERTIES (CSS VARIABLES)
   ===================================================== */

:root {
  /* Color System */
  --primary-gold: #E5B80B;
  --primary-gold-hover: #D4A80A;
  --primary-gold-light: #F59E0B;
  --background-dark: #111827;
  --background-medium: #1F2937;
  --background-light: #374151;
  --text-primary: #F9FAFB;
  --text-secondary: #9CA3AF;
  --text-muted: #6B7280;
  
  /* Status Colors */
  --success-color: #10B981;
  --error-color: #EF4444;
  --warning-color: #F59E0B;
  --info-color: #3B82F6;
  
  /* Spacing System */
  --spacing-xs: 0.25rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 2rem;
  --spacing-2xl: 3rem;
  
  /* Border Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  
  /* Typography - Enhanced Responsive System */
  --font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  
  /* Base Typography Scale */
  --font-size-xs: 0.75rem;     /* 12px */
  --font-size-sm: 0.875rem;    /* 14px */
  --font-size-base: 1rem;      /* 16px */
  --font-size-lg: 1.125rem;    /* 18px */
  --font-size-xl: 1.25rem;     /* 20px */
  --font-size-2xl: 1.5rem;     /* 24px */
  --font-size-3xl: 1.875rem;   /* 30px */
  --font-size-4xl: 2.25rem;    /* 36px */
  --font-size-5xl: 3rem;       /* 48px */
  
  /* Line Heights */
  --line-height-tight: 1.25;
  --line-height-snug: 1.375;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.625;
  --line-height-loose: 2;
  
  /* Font Weights */
  --font-weight-light: 300;
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  
  /* Letter Spacing */
  --letter-spacing-tighter: -0.05em;
  --letter-spacing-tight: -0.025em;
  --letter-spacing-normal: 0em;
  --letter-spacing-wide: 0.025em;
  --letter-spacing-wider: 0.05em;
  
  /* Layout - Enhanced Responsive System */
  --container-max-width: 1200px;
  --mobile-max-width: 414px;
  --tablet-max-width: 768px;
  --desktop-min-width: 1024px;
  
  /* Responsive Breakpoints */
  --breakpoint-xs: 320px;   /* Small phones */
  --breakpoint-sm: 480px;   /* Large phones */
  --breakpoint-md: 768px;   /* Tablets */
  --breakpoint-lg: 1024px;  /* Desktop */
  --breakpoint-xl: 1440px;  /* Large desktop */
  
  /* Device-Specific Spacing */
  --spacing-mobile: 0.75;   /* 12px base becomes 9px on mobile */
  --spacing-tablet: 1;      /* 16px base stays 16px on tablet */
  --spacing-desktop: 1.25;  /* 16px base becomes 20px on desktop */
  
  /* Viewport Variables (updated by JavaScript) */
  --vh: 1vh;
  --viewport-width: 100vw;
  --viewport-height: 100vh;
  
  /* Safe Area (for notched devices) */
  --safe-area-top: env(safe-area-inset-top, 0px);
  --safe-area-bottom: env(safe-area-inset-bottom, 0px);
  --safe-area-left: env(safe-area-inset-left, 0px);
  --safe-area-right: env(safe-area-inset-right, 0px);
  
  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-normal: 250ms ease;
  --transition-slow: 350ms ease;
}

/* =====================================================
   GLOBAL RESET AND BASE STYLES
   ===================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  background: linear-gradient(135deg, var(--background-dark), var(--background-medium), var(--background-dark));
  color: var(--text-primary);
  min-height: 100vh;
  min-height: calc(var(--vh, 1vh) * 100);
  overflow-x: hidden;
  
  /* Prevent text selection on UI elements */
  -webkit-user-select: none;
  -moz-user-select: none;
  user-select: none;
  
  /* Disable pull-to-refresh and overscroll */
  overscroll-behavior: none;
  -webkit-overflow-scrolling: touch;
}

/* Allow text selection on content elements */
p, span, div.content, .selectable {
  -webkit-user-select: text;
  -moz-user-select: text;
  user-select: text;
}

/* =====================================================
   SCROLLBAR HIDING FOR PWA
   ===================================================== */

/* Hide scrollbars globally for PWA experience */
html, body {
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE and Edge */
}

html::-webkit-scrollbar,
body::-webkit-scrollbar,
*::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Opera */
}

* {
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE and Edge */
}

/* =====================================================
   PWA-SPECIFIC CLASSES
   ===================================================== */

.pwa-no-scrollbar {
  overflow: hidden !important;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.pwa-no-scrollbar::-webkit-scrollbar {
  display: none;
}

.no-transitions * {
  transition: none !important;
  animation: none !important;
}

.no-scroll {
  overflow: hidden !important;
  position: fixed;
  width: 100%;
  height: 100%;
  touch-action: none;
}

/* =====================================================
   CONTAINER AND LAYOUT SYSTEM
   ===================================================== */

#app-container {
  width: 100%;
  height: 100vh;
  height: calc(var(--vh, 1vh) * 100);
  max-width: 100%;
  overflow: hidden;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, var(--background-dark), var(--background-medium), var(--background-dark));
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.container {
  text-align: center;
  padding: var(--spacing-lg);
  max-width: 600px;
  width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
  overflow-x: hidden;
}

/* =====================================================
   TYPOGRAPHY SYSTEM
   ===================================================== */

h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.2;
  margin-bottom: var(--spacing-md);
}

h1 {
  font-size: var(--font-size-4xl);
  font-weight: 700;
}

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

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

p {
  margin-bottom: var(--spacing-md);
  line-height: 1.6;
}

.highlight {
  color: var(--primary-gold);
}

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

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

/* =====================================================
   BUTTON SYSTEM
   ===================================================== */

.button,
button {
  background-color: var(--primary-gold);
  color: var(--background-dark);
  border: none;
  padding: 0.85rem 1.5rem;
  font-size: var(--font-size-lg);
  font-weight: 600;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-normal);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-sm);
  margin-top: var(--spacing-md);
  position: relative;
  overflow: hidden;
  font-family: var(--font-family);
  
  /* Ensure minimum touch target size */
  min-height: 44px;
  min-width: 44px;
  
  /* Disable system appearance */
  -webkit-appearance: none;
  appearance: none;
}

.button:hover,
button:hover {
  background-color: var(--primary-gold-hover);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(229, 184, 11, 0.3);
}

.button:active,
button:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(229, 184, 11, 0.2);
}

.button:disabled,
button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Button variants */
.button-secondary {
  background-color: var(--background-light);
  color: var(--text-primary);
}

.button-secondary:hover {
  background-color: #4B5563;
  box-shadow: 0 5px 15px rgba(75, 85, 99, 0.3);
}

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

.button-outline:hover {
  background-color: var(--primary-gold);
  color: var(--background-dark);
}

/* =====================================================
   FORM ELEMENTS
   ===================================================== */

.form-group {
  margin-bottom: var(--spacing-lg);
  text-align: left;
}

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

input,
select,
textarea {
  width: 100%;
  padding: 0.75rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(17, 24, 39, 0.8);
  color: var(--text-primary);
  font-size: var(--font-size-base);
  font-family: var(--font-family);
  transition: all var(--transition-normal);
  box-sizing: border-box;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary-gold);
  box-shadow: 0 0 0 2px rgba(229, 184, 11, 0.3);
}

input.error,
select.error,
textarea.error {
  border-color: var(--error-color);
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.3);
}

/* =====================================================
   PIN INPUT SYSTEM
   ===================================================== */

.pin-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  margin: 0 auto 10px auto;
  max-width: 260px;
  padding: var(--spacing-sm) 0;
}

.pin-box {
  width: 48px;
  height: 54px;
  text-align: center;
  font-size: 2rem;
  font-weight: 600;
  border-radius: 10px;
  border: 1.5px solid var(--primary-gold);
  background: rgba(17, 24, 39, 0.92);
  color: var(--text-primary);
  font-family: var(--font-family);
  margin: 0 2px;
  transition: all var(--transition-normal);
  box-shadow: 0 2px 8px rgba(229, 184, 11, 0.08);
  -webkit-text-security: disc;
}

.pin-box:focus {
  outline: none;
  border-color: var(--primary-gold);
  box-shadow: 0 0 0 2px rgba(229, 184, 11, 0.18);
  transform: scale(1.05);
}

/* =====================================================
   LOGIN FORM STYLES
   ===================================================== */

.login-form {
  background: rgba(31, 41, 55, 0.7);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: var(--shadow-lg);
  padding: var(--spacing-xl);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 400px;
  margin-bottom: var(--spacing-xl);
}

.welcome-section {
  display: none;
}

.info {
  margin-top: var(--spacing-2xl);
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
}

/* =====================================================
   ERROR AND SUCCESS STATES
   ===================================================== */

.error-message {
  color: var(--error-color);
  font-size: var(--font-size-sm);
  margin-top: var(--spacing-sm);
  display: none;
}

.success-message {
  color: var(--success-color);
  font-size: var(--font-size-sm);
  margin-top: var(--spacing-sm);
}

/* =====================================================
   ANIMATIONS
   ===================================================== */

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
  20%, 40%, 60%, 80% { transform: translateX(5px); }
}

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

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

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

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

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

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

.shake-error {
  animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) both;
  border-color: var(--error-color) !important;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.3) !important;
}

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

.fade-out {
  animation: fadeOut 0.3s ease-in;
}

.slide-up {
  animation: slideUp 0.3s ease-out;
}

.slide-down {
  animation: slideDown 0.3s ease-out;
}

.pulse {
  animation: pulse 1s infinite;
}

/* =====================================================
   LOADING STATES
   ===================================================== */

.loading {
  position: relative;
  pointer-events: none;
  opacity: 0.7;
}

.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin-top: -10px;
  margin-left: -10px;
  border: 2px solid var(--primary-gold);
  border-top: 2px solid transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(229, 184, 11, 0.3);
  border-top: 4px solid var(--primary-gold);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: var(--spacing-md) auto;
}

/* =====================================================
   THEME SYSTEM
   ===================================================== */

.theme-light {
  --background-dark: #FFFFFF;
  --background-medium: #F9FAFB;
  --background-light: #F3F4F6;
  --text-primary: #111827;
  --text-secondary: #6B7280;
  --text-muted: #9CA3AF;
}

/* Theme dark is the default - styles defined in :root */

/* =====================================================
   MODAL SYSTEM
   ===================================================== */

.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9000;
  backdrop-filter: blur(4px);
}

.modal-content {
  background: var(--background-medium);
  border-radius: var(--radius-xl);
  padding: var(--spacing-xl);
  margin: var(--spacing-md);
  max-width: 90vw;
  max-height: 90vh;
  overflow-y: auto;
  color: var(--text-primary);
  border: 1px solid rgba(229, 184, 11, 0.3);
  box-shadow: var(--shadow-xl);
}

/* =====================================================
   NOTIFICATION SYSTEM
   ===================================================== */

.notification {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  margin-bottom: 10px;
  font-size: var(--font-size-sm);
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  cursor: pointer;
  max-width: 300px;
  word-wrap: break-word;
  color: white;
}

.notification-info {
  background: var(--info-color);
}

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

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

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

/* =====================================================
   ACCESSIBILITY IMPROVEMENTS
   ===================================================== */

/* Focus visible for keyboard navigation */
*:focus-visible {
  outline: 2px solid var(--primary-gold);
  outline-offset: 2px;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  :root {
    --primary-gold: #FFD700;
    --background-dark: #000000;
    --background-medium: #1A1A1A;
    --text-primary: #FFFFFF;
  }
}

/* =====================================================
   PRINT STYLES
   ===================================================== */

@media print {
  body {
    background: white !important;
    color: black !important;
  }
  
  .no-print,
  .modal-backdrop,
  .notification,
  button {
    display: none !important;
  }
}

/* =====================================================
   13. LOGIN PAGE FIXES
   ===================================================== */

/* Prevent horizontal movement/dancing on login page */
#app-container {
  transform: translateZ(0) !important;
  backface-visibility: hidden !important;
  perspective: 1000px !important;
  will-change: transform !important;
  
  position: fixed !important;
  left: 0 !important;
  right: 0 !important;
  margin-left: auto !important;
  margin-right: auto !important;
  
  overflow-x: hidden !important;
  max-width: 1200px !important;
  width: 100% !important;
  
  transition: none !important;
}

.container {
  position: relative !important;
  margin-left: auto !important;
  margin-right: auto !important;
  transform: translateZ(0) !important;
  backface-visibility: hidden !important;
  
  max-width: 600px !important;
  width: 100% !important;
  
  transition: none !important;
}

.no-transitions, 
.no-transitions * {
  transition: none !important;
}

.login-form {
  transform: translateZ(0) !important;
  backface-visibility: hidden !important;
  position: relative !important;
  
  max-width: 400px !important;
  width: 100% !important;
  margin-left: auto !important;
  margin-right: auto !important;
  
  transition: none !important;
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}

/* =====================================================
   PHASE 2: ENHANCED RESPONSIVE TYPOGRAPHY SYSTEM
   ===================================================== */

/* Mobile Typography (320px - 479px) */
@media (max-width: 479px) {
  :root {
    /* Scale down typography for mobile */
    --font-size-xs: 0.7rem;     /* 11px */
    --font-size-sm: 0.8rem;     /* 13px */
    --font-size-base: 0.9rem;   /* 14px */
    --font-size-lg: 1rem;       /* 16px */
    --font-size-xl: 1.1rem;     /* 18px */
    --font-size-2xl: 1.3rem;    /* 21px */
    --font-size-3xl: 1.6rem;    /* 26px */
    --font-size-4xl: 2rem;      /* 32px */
    --font-size-5xl: 2.5rem;    /* 40px */
    
    /* Tighter line heights for mobile */
    --line-height-normal: 1.4;
    --line-height-relaxed: 1.5;
    
    /* Reduce spacing for mobile */
    --spacing-xs: calc(0.25rem * var(--spacing-mobile));
    --spacing-sm: calc(0.5rem * var(--spacing-mobile));
    --spacing-md: calc(1rem * var(--spacing-mobile));
    --spacing-lg: calc(1.5rem * var(--spacing-mobile));
    --spacing-xl: calc(2rem * var(--spacing-mobile));
    --spacing-2xl: calc(3rem * var(--spacing-mobile));
  }
}

/* Tablet Typography (480px - 767px) */
@media (min-width: 480px) and (max-width: 767px) {
  :root {
    /* Standard typography for tablets */
    --font-size-xs: 0.75rem;    /* 12px */
    --font-size-sm: 0.85rem;    /* 14px */
    --font-size-base: 0.95rem;  /* 15px */
    --font-size-lg: 1.1rem;     /* 18px */
    --font-size-xl: 1.2rem;     /* 19px */
    --font-size-2xl: 1.4rem;    /* 22px */
    --font-size-3xl: 1.7rem;    /* 27px */
    --font-size-4xl: 2.1rem;    /* 34px */
    --font-size-5xl: 2.8rem;    /* 45px */
    
    /* Standard spacing for tablets */
    --spacing-xs: calc(0.25rem * var(--spacing-tablet));
    --spacing-sm: calc(0.5rem * var(--spacing-tablet));
    --spacing-md: calc(1rem * var(--spacing-tablet));
    --spacing-lg: calc(1.5rem * var(--spacing-tablet));
    --spacing-xl: calc(2rem * var(--spacing-tablet));
    --spacing-2xl: calc(3rem * var(--spacing-tablet));
  }
}

/* Desktop Typography (768px+) */
@media (min-width: 768px) {
  :root {
    /* Enhanced typography for desktop */
    --font-size-xs: 0.8rem;     /* 13px */
    --font-size-sm: 0.9rem;     /* 14px */
    --font-size-base: 1rem;     /* 16px */
    --font-size-lg: 1.125rem;   /* 18px */
    --font-size-xl: 1.3rem;     /* 21px */
    --font-size-2xl: 1.6rem;    /* 26px */
    --font-size-3xl: 2rem;      /* 32px */
    --font-size-4xl: 2.5rem;    /* 40px */
    --font-size-5xl: 3.2rem;    /* 51px */
    
    /* More relaxed line heights for desktop */
    --line-height-normal: 1.6;
    --line-height-relaxed: 1.75;
    
    /* Increased spacing for desktop */
    --spacing-xs: calc(0.25rem * var(--spacing-desktop));
    --spacing-sm: calc(0.5rem * var(--spacing-desktop));
    --spacing-md: calc(1rem * var(--spacing-desktop));
    --spacing-lg: calc(1.5rem * var(--spacing-desktop));
    --spacing-xl: calc(2rem * var(--spacing-desktop));
    --spacing-2xl: calc(3rem * var(--spacing-desktop));
  }
}

/* Large Desktop Typography (1024px+) */
@media (min-width: 1024px) {
  :root {
    /* Premium typography for large screens */
    --font-size-xs: 0.85rem;    /* 14px */
    --font-size-sm: 0.95rem;    /* 15px */
    --font-size-base: 1.1rem;   /* 18px */
    --font-size-lg: 1.2rem;     /* 19px */
    --font-size-xl: 1.4rem;     /* 22px */
    --font-size-2xl: 1.7rem;    /* 27px */
    --font-size-3xl: 2.2rem;    /* 35px */
    --font-size-4xl: 2.8rem;    /* 45px */
    --font-size-5xl: 3.5rem;    /* 56px */
  }
}

/* Utility Classes for Responsive Typography */
.text-responsive {
  font-size: var(--font-size-base);
  line-height: var(--line-height-normal);
}

.heading-responsive {
  font-size: var(--font-size-2xl);
  line-height: var(--line-height-tight);
  font-weight: var(--font-weight-semibold);
}

.title-responsive {
  font-size: var(--font-size-3xl);
  line-height: var(--line-height-tight);
  font-weight: var(--font-weight-bold);
}

/* Device-Specific Layout Classes */
.mobile-only {
  display: block;
}

.tablet-only,
.desktop-only {
  display: none;
}

@media (min-width: 480px) and (max-width: 767px) {
  .mobile-only,
  .desktop-only {
    display: none;
  }
  
  .tablet-only {
    display: block;
  }
}

@media (min-width: 768px) {
  .mobile-only,
  .tablet-only {
    display: none;
  }
  
  .desktop-only {
    display: block;
  }
}

/* =====================================================
   ADVANCED RESPONSIVE GRID SYSTEM
   ===================================================== */

/* Grid Container */
.responsive-grid {
  display: grid;
  gap: var(--spacing-md);
  width: 100%;
  padding: var(--spacing-sm);
}

/* Mobile Grid (1 column) */
@media (max-width: 479px) {
  .responsive-grid {
    grid-template-columns: 1fr;
    gap: var(--spacing-sm);
    padding: var(--spacing-xs);
  }
  
  .grid-item {
    min-height: 60px;
  }
}

/* Tablet Grid (2 columns) */
@media (min-width: 480px) and (max-width: 767px) {
  .responsive-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-md);
  }
  
  .grid-item-full {
    grid-column: 1 / -1;
  }
  
  .grid-item {
    min-height: 80px;
  }
}

/* Desktop Grid (flexible columns) */
@media (min-width: 768px) {
  .responsive-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--spacing-lg);
    padding: var(--spacing-md);
  }
  
  .grid-item-full {
    grid-column: 1 / -1;
  }
  
  .grid-item-half {
    grid-column: span 1;
  }
  
  .grid-item {
    min-height: 100px;
  }
}

/* Large Desktop Grid (3+ columns) */
@media (min-width: 1024px) {
  .responsive-grid {
    grid-template-columns: repeat(3, 1fr);
    max-width: 1200px;
    margin: 0 auto;
  }
  
  .grid-item-wide {
    grid-column: span 2;
  }
}

/* Content-specific responsive classes */
.content-mobile {
  padding: var(--spacing-sm);
  margin: var(--spacing-xs) 0;
}

.content-tablet {
  padding: var(--spacing-md);
  margin: var(--spacing-sm) 0;
}

.content-desktop {
  padding: var(--spacing-lg);
  margin: var(--spacing-md) 0;
}

/* Apply device-specific content spacing */
@media (max-width: 479px) {
  .responsive-content {
    padding: var(--spacing-sm);
    margin: var(--spacing-xs) 0;
  }
}

@media (min-width: 480px) and (max-width: 767px) {
  .responsive-content {
    padding: var(--spacing-md);
    margin: var(--spacing-sm) 0;
  }
}

@media (min-width: 768px) {
  .responsive-content {
    padding: var(--spacing-lg);
    margin: var(--spacing-md) 0;
  }
}
