/**
 * Educare International - Design System
 * Comprehensive UI/UX improvements based on modern design principles
 * Following TODO.txt recommendations for enhanced user experience
 */

/* ========================================
   1. CSS CUSTOM PROPERTIES (Design Tokens)
   ======================================== */

:root {
  /* Primary Color Palette - Sophisticated & Professional */
  --primary-color: #1e293b;
  /* Deep Slate/Indigo */
  --primary-dark: #0f172a;
  /* Darker Slate */
  --primary-light: #334155;
  /* Lighter Slate */
  --primary-lighter: #94a3b8;
  --primary-lightest: #f1f5f9;

  /* Brand Accent - Sophisticated Gold/Mustard */
  --secondary-color: #d4af37;
  /* Classic Gold */
  --secondary-dark: #b8860b;
  /* Dark Goldenrod */
  --secondary-light: #f1c40f;
  /* Brighter Gold */
  --secondary-soft: rgba(212, 175, 55, 0.1);

  /* Accent Color - Deep Purple/Violet */
  --accent-color: #6366f1;
  /* Indigo-500 */
  --accent-dark: #4f46e5;
  /* Indigo-600 */
  --accent-light: #818cf8;
  /* Indigo-400 */

  /* Semantic Colors */
  --success-color: #10b981;
  --warning-color: #f59e0b;
  --error-color: #ef4444;
  --info-color: #3b82f6;

  /* Neutral Colors - Improved hierarchy */
  --text-primary: #0f172a;
  /* Near black for readability */
  --text-secondary: #475569;
  /* Slate-600 */
  --text-tertiary: #64748b;
  /* Slate-500 */
  --text-light: #94a3b8;
  /* Slate-400 */
  --text-white: #ffffff;

  /* Background Colors */
  --bg-white: #ffffff;
  --bg-gray-50: #f8fafc;
  --bg-gray-100: #f1f5f9;
  --bg-gray-200: #e2e8f0;
  --bg-primary: #f1f5f9;
  --bg-glass: rgba(255, 255, 255, 0.7);

  /* Border Colors - Subtle & Modern */
  --border-light: #f1f5f9;
  --border-medium: #e2e8f0;
  --border-dark: #cbd5e1;

  /* Typography - Premium Font Stack */
  --font-primary: 'Inter', system-ui, -apple-system, sans-serif;
  --font-heading: 'Plus Jakarta Sans', 'Inter', sans-serif;
  --font-serif: 'Playfair Display', serif;
  /* For that academic/premium feel */

  /* Font Sizes - Modular scale */
  --text-xs: 0.75rem;
  /* 12px */
  --text-sm: 0.875rem;
  /* 14px */
  --text-base: 1rem;
  /* 16px */
  --text-lg: 1.125rem;
  /* 18px */
  --text-xl: 1.25rem;
  /* 20px */
  --text-2xl: 1.5rem;
  /* 24px */
  --text-3xl: 2rem;
  /* 32px */
  --text-4xl: 2.5rem;
  /* 40px */
  --text-5xl: 3.5rem;
  /* 56px */
  --text-6xl: 4.5rem;
  /* 72px */

  /* Font Weights */
  --font-normal: 400;
  --font-medium: 500;
  --font-semibold: 600;
  --font-bold: 700;
  --font-extrabold: 800;

  /* Line Heights - Improved readability */
  --leading-tight: 1.1;
  --leading-snug: 1.3;
  --leading-normal: 1.5;
  --leading-relaxed: 1.7;
  --leading-loose: 2;

  /* Spacing Scale */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-8: 3rem;
  --space-10: 4rem;
  --space-12: 5rem;
  --space-16: 8rem;

  /* Border Radius - More generous for modern look */
  --radius-sm: 0.375rem;
  --radius-base: 0.5rem;
  --radius-md: 0.75rem;
  --radius-lg: 1rem;
  --radius-xl: 1.5rem;
  --radius-2xl: 2.5rem;
  --radius-full: 9999px;

  /* Shadows - Soft, large-radius premium shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-base: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.02);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.05), 0 10px 10px -5px rgba(0, 0, 0, 0.02);
  --shadow-xl: 0 35px 60px -15px rgba(0, 0, 0, 0.1);
  --shadow-glass: 0 8px 32px 0 rgba(31, 38, 135, 0.07);

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 300ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 500ms cubic-bezier(0.4, 0, 0.2, 1);


  /* Z-index layers */
  --z-base: 0;
  --z-dropdown: 1000;
  --z-sticky: 1020;
  --z-fixed: 1030;
  --z-modal-backdrop: 1040;
  --z-modal: 1050;
  --z-popover: 1060;
  --z-tooltip: 1070;

  /* Touch targets - Minimum 44px for accessibility */
  --touch-target-min: 44px;

  /* Container widths */
  --container-sm: 640px;
  --container-md: 768px;
  --container-lg: 1024px;
  --container-xl: 1280px;
  --container-2xl: 1536px;
}

/* ========================================
   2. BASE STYLES & RESETS
   ======================================== */

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

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

body {
  font-family: var(--font-primary);
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
  color: var(--text-primary);
  background-color: var(--bg-white);
  overflow-x: hidden;
}

/* ========================================
   3. TYPOGRAPHY SYSTEM - Consistent Hierarchy
   ======================================== */

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-heading);
  font-weight: var(--font-bold);
  line-height: var(--leading-tight);
  color: var(--text-primary);
  margin-bottom: var(--space-4);
}

h1 {
  font-size: var(--text-5xl);
  font-weight: var(--font-extrabold);
  letter-spacing: -0.025em;
}

h2 {
  font-size: var(--text-4xl);
  font-weight: var(--font-bold);
  letter-spacing: -0.025em;
}

h3 {
  font-size: var(--text-3xl);
  font-weight: var(--font-bold);
}

h4 {
  font-size: var(--text-2xl);
  font-weight: var(--font-semibold);
}

h5 {
  font-size: var(--text-xl);
  font-weight: var(--font-semibold);
}

h6 {
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
}

p {
  margin-bottom: var(--space-4);
  color: var(--text-secondary);
  line-height: var(--leading-relaxed);
}

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

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

a:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* ========================================
   4. STICKY NAVIGATION - Improved UX
   ======================================== */

.educare-header {
  background: var(--bg-white);
  box-shadow: var(--shadow-sm);
  position: relative;
  z-index: var(--z-sticky);
  transition: all var(--transition-base);
}

.educare-header-fixed {
  position: fixed !important;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  box-shadow: var(--shadow-md) !important;
  animation: slideDown var(--transition-base);
}

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

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

/* Navigation items - Enhanced hover states */
.educare-navItems ul li a {
  position: relative;
  color: var(--text-primary);
  font-weight: var(--font-medium);
  padding: var(--space-2) var(--space-4);
  transition: all var(--transition-fast);
  border-radius: var(--radius-base);
}

.educare-navItems ul li a:hover {
  color: var(--primary-color);
  background-color: var(--bg-primary);
}

.educare-navItems ul li a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%) scaleX(0);
  width: 80%;
  height: 2px;
  background-color: var(--primary-color);
  transition: transform var(--transition-base);
}

.educare-navItems ul li a:hover::after,
.educare-navItems ul li a.active::after {
  transform: translateX(-50%) scaleX(1);
}

/* ========================================
   5. BUTTON SYSTEM - Prominent CTAs
   ======================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-family: var(--font-primary);
  font-weight: var(--font-semibold);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-lg);
  border: none;
  cursor: pointer;
  transition: all var(--transition-base);
  text-decoration: none;
  min-height: var(--touch-target-min);
  white-space: nowrap;
}

/* Primary CTA Button - Most prominent */
.btn-primary,
.btn-inquirynow,
.hero-btn,
.search-button {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
  color: var(--text-white);
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

.btn-primary::before,
.btn-inquirynow::before,
.hero-btn::before,
.search-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary-color) 100%);
  opacity: 0;
  transition: opacity var(--transition-base);
}

.btn-primary:hover,
.btn-inquirynow:hover,
.hero-btn:hover,
.search-button:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-primary:hover::before,
.btn-inquirynow:hover::before,
.hero-btn:hover::before,
.search-button:hover::before {
  opacity: 1;
}

.btn-primary:active,
.btn-inquirynow:active,
.hero-btn:active,
.search-button:active {
  transform: translateY(0);
  box-shadow: var(--shadow-base);
}

/* Secondary Button */
.btn-secondary {
  background-color: var(--secondary-color);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
  background-color: var(--secondary-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

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

.btn-outline:hover,
.btn-outline-primary:hover {
  background-color: var(--primary-color);
  color: var(--text-white);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* Ghost Button */
.btn-ghost {
  background-color: transparent;
  color: var(--text-primary);
}

.btn-ghost:hover {
  background-color: var(--bg-gray-100);
}

/* Button Sizes */
.btn-sm {
  font-size: var(--text-sm);
  padding: var(--space-2) var(--space-4);
  min-height: 36px;
}

.btn-lg {
  font-size: var(--text-lg);
  padding: var(--space-4) var(--space-8);
  min-height: 52px;
}

/* Button States */
.btn:disabled,
.btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.btn:focus-visible {
  outline: 3px solid var(--primary-lighter);
  outline-offset: 2px;
}

/* ========================================
   6. FORM ELEMENTS - WCAG Compliant
   ======================================== */

.form-input,
.form-select,
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="password"],
input[type="search"],
select,
textarea {
  width: 100%;
  font-family: var(--font-primary);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--text-primary);
  background-color: var(--bg-white);
  border: 2px solid var(--border-light);
  border-radius: var(--radius-base);
  padding: var(--space-3) var(--space-4);
  min-height: var(--touch-target-min);
  transition: all var(--transition-fast);
}

.form-input:hover,
.form-select:hover,
input:hover,
select:hover,
textarea:hover {
  border-color: var(--border-medium);
}

.form-input:focus,
.form-select:focus,
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px var(--primary-lightest);
}

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

.form-group {
  margin-bottom: var(--space-5);
}

/* ========================================
   7. CARD COMPONENT - Improved Hierarchy
   ======================================== */

.card,
.service-card,
.event-card,
.contact-card,
.blog-card {
  background-color: var(--bg-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-base);
  padding: var(--space-6);
  transition: all var(--transition-base);
  border: 1px solid var(--border-light);
}

.card:hover,
.service-card:hover,
.event-card:hover,
.contact-card:hover,
.blog-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
}

/* ========================================
   8. WHITE SPACE & SPACING
   ======================================== */

.section {
  padding: var(--space-16) 0;
}

.section-large {
  padding: var(--space-24) 0;
}

.section-header,
.section-title-wrapper {
  text-align: center;
  margin-bottom: var(--space-12);
  max-width: 768px;
  margin-left: auto;
  margin-right: auto;
}

.section-title {
  margin-bottom: var(--space-4);
}

.section-subtitle {
  font-size: var(--text-lg);
  color: var(--text-secondary);
  line-height: var(--leading-relaxed);
}

/* ========================================
   9. RESPONSIVE GRID SYSTEM
   ======================================== */

.container {
  width: 100%;
  max-width: var(--container-xl);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-4);
  padding-right: var(--space-4);
}

@media (min-width: 640px) {
  .container {
    padding-left: var(--space-6);
    padding-right: var(--space-6);
  }
}

@media (min-width: 1024px) {
  .container {
    padding-left: var(--space-8);
    padding-right: var(--space-8);
  }
}

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

.grid-cols-1 {
  grid-template-columns: repeat(1, minmax(0, 1fr));
}

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

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

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

@media (max-width: 1023px) {

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

@media (max-width: 639px) {

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

/* ========================================
   10. ACCESSIBILITY ENHANCEMENTS
   ======================================== */

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

/* Skip to main content link */
.skip-to-main {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--primary-color);
  color: var(--text-white);
  padding: var(--space-2) var(--space-4);
  text-decoration: none;
  z-index: 100;
}

.skip-to-main:focus {
  top: 0;
}

/* Screen reader only content */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  :root {
    --border-light: #000000;
    --border-medium: #000000;
  }
}

/* Reduced motion support */
@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;
  }
}

/* ========================================
   11. UTILITY CLASSES
   ======================================== */

/* Text utilities */
.text-center {
  text-align: center;
}

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

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

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

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

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

.font-bold {
  font-weight: var(--font-bold);
}

.font-semibold {
  font-weight: var(--font-semibold);
}

.font-medium {
  font-weight: var(--font-medium);
}

/* Spacing utilities */
.mt-4 {
  margin-top: var(--space-4);
}

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

.my-8 {
  margin-top: var(--space-8);
  margin-bottom: var(--space-8);
}

.mx-auto {
  margin-left: auto;
  margin-right: auto;
}

/* Display utilities */
.hidden {
  display: none;
}

.block {
  display: block;
}

.inline-block {
  display: inline-block;
}

.flex {
  display: flex;
}

.inline-flex {
  display: inline-flex;
}

.grid {
  display: grid;
}

/* Flexbox utilities */
.items-center {
  align-items: center;
}

.justify-center {
  justify-content: center;
}

.justify-between {
  justify-content: space-between;
}

.gap-4 {
  gap: var(--space-4);
}

/* Rounded corners */
.rounded {
  border-radius: var(--radius-base);
}

.rounded-lg {
  border-radius: var(--radius-lg);
}

.rounded-full {
  border-radius: var(--radius-full);
}

/* Shadow utilities */
.shadow-sm {
  box-shadow: var(--shadow-sm);
}

.shadow {
  box-shadow: var(--shadow-base);
}

.shadow-md {
  box-shadow: var(--shadow-md);
}

.shadow-lg {
  box-shadow: var(--shadow-lg);
}

/* ========================================
   12. ANIMATIONS & MICRO-INTERACTIONS
   ======================================== */

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

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

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

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

.animate-fadeIn {
  animation: fadeIn var(--transition-base) ease-out;
}

.animate-slideUp {
  animation: slideUp var(--transition-slow) ease-out;
}

.animate-scaleIn {
  animation: scaleIn var(--transition-base) ease-out;
}

/* Hover lift effect */
.hover-lift {
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.hover-lift:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

/* ========================================
   13. RESPONSIVE UTILITIES
   ======================================== */

@media (max-width: 767px) {
  h1 {
    font-size: var(--text-4xl);
  }

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

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

  h4 {
    font-size: var(--text-xl);
  }

  .section {
    padding: var(--space-12) 0;
  }

  .section-large {
    padding: var(--space-16) 0;
  }
}

@media (max-width: 480px) {
  html {
    font-size: 14px;
  }

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

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