/**
 * Ganesh Portal Design System
 * Modern, unified theme with CSS variables for consistency
 *
 * Usage: Include this file FIRST in all templates
 */

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

:root {
  /* Primary Colors - Purple Gradient Theme */
  --color-primary: #667eea;
  --color-primary-dark: #764ba2;
  --color-primary-light: #8b9cf7;
  --color-primary-rgb: 102, 126, 234;

  /* Secondary Colors */
  --color-secondary: #6c757d;
  --color-secondary-dark: #545b62;

  /* Accent Gradients */
  --gradient-primary: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  --gradient-blue: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  --gradient-green: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
  --gradient-orange: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
  --gradient-teal: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
  --gradient-dark: linear-gradient(135deg, #1a252f 0%, #2c3e50 100%);

  /* Semantic Colors */
  --color-success: #28a745;
  --color-success-light: #d4edda;
  --color-success-dark: #155724;

  --color-danger: #dc3545;
  --color-danger-light: #f8d7da;
  --color-danger-dark: #721c24;

  --color-warning: #ffc107;
  --color-warning-light: #fff3cd;
  --color-warning-dark: #856404;

  --color-info: #17a2b8;
  --color-info-light: #d1ecf1;
  --color-info-dark: #0c5460;

  /* Neutral Colors */
  --color-white: #ffffff;
  --color-gray-50: #f8f9fa;
  --color-gray-100: #f1f4f8;
  --color-gray-200: #e9ecef;
  --color-gray-300: #dee2e6;
  --color-gray-400: #ced4da;
  --color-gray-500: #adb5bd;
  --color-gray-600: #6c757d;
  --color-gray-700: #495057;
  --color-gray-800: #343a40;
  --color-gray-900: #212529;
  --color-black: #000000;

  /* Text Colors */
  --text-primary: #2c3e50;
  --text-secondary: #7f8c8d;
  --text-muted: #95a5a6;
  --text-light: #ffffff;

  /* Background Colors */
  --bg-body: var(--color-gray-50);
  --bg-card: var(--color-white);
  --bg-elevated: var(--color-white);

  /* Border Colors */
  --border-color: var(--color-gray-300);
  --border-color-light: var(--color-gray-200);

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.15);
  --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.2);
  --shadow-primary: 0 4px 15px rgba(var(--color-primary-rgb), 0.3);

  /* Border Radius */
  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-pill: 50px;
  --radius-circle: 50%;

  /* Spacing Scale */
  --space-1: 0.25rem;   /* 4px */
  --space-2: 0.5rem;    /* 8px */
  --space-3: 0.75rem;   /* 12px */
  --space-4: 1rem;      /* 16px */
  --space-5: 1.5rem;    /* 24px */
  --space-6: 2rem;      /* 32px */
  --space-7: 2.5rem;    /* 40px */
  --space-8: 3rem;      /* 48px */

  /* Typography */
  --font-family-base: 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Roboto', 'Helvetica Neue', Arial, sans-serif;
  --font-family-mono: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Mono', 'Droid Sans Mono', monospace;

  /* Font Sizes */
  --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 Weights */
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;

  /* Line Heights */
  --line-height-tight: 1.25;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.75;

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-base: 0.2s ease;
  --transition-slow: 0.3s ease;
  --transition-transform: transform 0.2s ease;
  --transition-all: all 0.2s ease;

  /* Z-Index Scale */
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-fixed: 300;
  --z-modal-backdrop: 400;
  --z-modal: 500;
  --z-popover: 600;
  --z-tooltip: 700;

  /* Container Widths */
  --container-sm: 540px;
  --container-md: 720px;
  --container-lg: 960px;
  --container-xl: 1140px;
  --container-xxl: 1400px;
}

/* ========================================
   BASE STYLES
   ======================================== */

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

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

body {
  font-family: var(--font-family-base);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-normal);
  line-height: var(--line-height-normal);
  color: var(--text-primary);
  background-color: var(--bg-body);
  min-height: 100vh;
}

/* Body with gradient background */
body.bg-gradient {
  background: var(--gradient-primary);
  background-attachment: fixed;
}

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

h1, h2, h3, h4, h5, h6 {
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-tight);
  color: var(--text-primary);
  margin-bottom: var(--space-3);
}

h1 { font-size: var(--font-size-4xl); }
h2 { font-size: var(--font-size-3xl); }
h3 { font-size: var(--font-size-2xl); }
h4 { font-size: var(--font-size-xl); }
h5 { font-size: var(--font-size-lg); }
h6 { font-size: var(--font-size-base); }

p {
  margin-bottom: var(--space-4);
}

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

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

.text-primary { color: var(--color-primary) !important; }
.text-secondary { color: var(--text-secondary) !important; }
.text-muted { color: var(--text-muted) !important; }
.text-success { color: var(--color-success) !important; }
.text-danger { color: var(--color-danger) !important; }
.text-warning { color: var(--color-warning-dark) !important; }
.text-info { color: var(--color-info) !important; }
.text-white { color: var(--color-white) !important; }

/* ========================================
   UTILITY CLASSES
   ======================================== */

/* Backgrounds */
.bg-primary-gradient {
  background: var(--gradient-primary) !important;
}

.bg-blue-gradient {
  background: var(--gradient-blue) !important;
}

.bg-green-gradient {
  background: var(--gradient-green) !important;
}

.bg-orange-gradient {
  background: var(--gradient-orange) !important;
}

.bg-teal-gradient {
  background: var(--gradient-teal) !important;
}

.bg-dark-gradient {
  background: var(--gradient-dark) !important;
}

/* Shadows */
.shadow-xs { box-shadow: var(--shadow-xs); }
.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }
.shadow-xl { box-shadow: var(--shadow-xl); }

/* Border Radius */
.rounded-xs { border-radius: var(--radius-xs); }
.rounded-sm { border-radius: var(--radius-sm); }
.rounded-md { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: var(--radius-xl); }
.rounded-pill { border-radius: var(--radius-pill); }

/* ========================================
   SCROLLBAR STYLING
   ======================================== */

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--color-gray-200);
  border-radius: var(--radius-xs);
}

::-webkit-scrollbar-thumb {
  background: var(--gradient-primary);
  border-radius: var(--radius-xs);
  border: 2px solid var(--color-gray-200);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-primary-dark);
}

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

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

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

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

@keyframes shimmer {
  0% { background-position: -1000px 0; }
  100% { background-position: 1000px 0; }
}

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

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

.animate-pulse {
  animation: pulse 2s ease-in-out infinite;
}

.loading-shimmer {
  animation: shimmer 2s infinite;
  background: linear-gradient(90deg, var(--color-gray-100) 8%, var(--color-gray-200) 18%, var(--color-gray-100) 33%);
  background-size: 1000px 100%;
}

/* ========================================
   RESPONSIVE BREAKPOINTS
   ======================================== */

/* Mobile first approach */
/* sm: 576px, md: 768px, lg: 992px, xl: 1200px, xxl: 1400px */

@media (max-width: 575.98px) {
  :root {
    --font-size-4xl: 1.75rem;
    --font-size-3xl: 1.5rem;
    --font-size-2xl: 1.25rem;
  }
}
