/* =================================================================
   TechWayFit Theme Enhancements
   Enhanced modern theme with improved visual design and UX
   ================================================================= */

/* =================================================================
   CSS Custom Properties (Variables)
   ================================================================= */
:root {
  /* Enhanced Color Palette */
  --primary-color: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #dbeafe;
  --secondary-color: #64748b;
  --accent-color: #f59e0b;
  --success-color: #10b981;
  --warning-color: #f59e0b;
  --error-color: #ef4444;
  --info-color: #3b82f6;
  
  /* Dark theme variants */
  --dark-bg: #0f172a;
  --dark-surface: #1e293b;
  --dark-text: #f8fafc;
  --dark-text-secondary: #cbd5e1;
  
  /* Typography */
  --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-secondary: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
  --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: 1.875rem;
  --font-size-4xl: 2.25rem;
  
  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  
  /* Border radius */
  --radius-sm: 0.25rem;
  --radius-md: 0.375rem;
  --radius-lg: 0.5rem;
  --radius-xl: 0.75rem;
  --radius-2xl: 1rem;
  
  /* Transitions */
  --transition-fast: 150ms ease-in-out;
  --transition-normal: 250ms ease-in-out;
  --transition-slow: 350ms ease-in-out;
}

/* =================================================================
   Base Styles & Typography Improvements
   ================================================================= */
body {
  font-family: var(--font-primary);
  line-height: 1.6;
  color: #374151;
  background-color: #ffffff;
  transition: background-color var(--transition-normal);
}

/* Enhanced typography hierarchy */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: var(--space-4);
  color: #111827;
}

h1 {
  font-size: var(--font-size-4xl);
  background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

h2 {
  font-size: var(--font-size-3xl);
  color: #1f2937;
  position: relative;
}

h2::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 0;
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
  border-radius: var(--radius-lg);
}

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

/* Enhanced links */
a {
  color: var(--primary-color);
  text-decoration: none;
  transition: all var(--transition-fast);
}

a:hover {
  color: var(--primary-hover);
  text-decoration: underline;
  text-decoration-color: var(--primary-color);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

/* =================================================================
   Card Components Enhancement
   ================================================================= */
.card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-normal);
  overflow: hidden;
  position: relative;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
  border-color: var(--primary-light);
}

.card:hover::before {
  opacity: 1;
}

.card-header {
  padding: var(--space-6);
  border-bottom: 1px solid #f3f4f6;
  background: linear-gradient(135deg, #ffffff, #f9fafb);
}

.card-body {
  padding: var(--space-6);
}

.card-title {
  font-size: var(--font-size-xl);
  font-weight: 600;
  color: #111827;
  margin-bottom: var(--space-2);
}

.card-text {
  color: #6b7280;
  line-height: 1.6;
}

/* =================================================================
   Button Enhancements
   ================================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  font-weight: 500;
  font-size: var(--font-size-sm);
  border-radius: var(--radius-lg);
  transition: all var(--transition-fast);
  cursor: pointer;
  border: none;
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left var(--transition-normal);
}

.btn:hover::before {
  left: 100%;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
  color: white;
  box-shadow: var(--shadow-md);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  color: white;
  text-decoration: none;
}

.btn-secondary {
  background: white;
  color: var(--primary-color);
  border: 2px solid var(--primary-color);
}

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

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

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

/* =================================================================
   Navigation Enhancements
   ================================================================= */
.navbar {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(229, 231, 235, 0.5);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-normal);
}

.navbar-brand {
  font-weight: 700;
  font-size: var(--font-size-xl);
  background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-link {
  font-weight: 500;
  color: #374151;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--primary-color);
  transition: all var(--transition-fast);
  transform: translateX(-50%);
}

.nav-link:hover,
.nav-link.active {
  color: var(--primary-color);
  background: var(--primary-light);
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 80%;
}

/* =================================================================
   Form Enhancements
   ================================================================= */
.form-control {
  border: 2px solid #e5e7eb;
  border-radius: var(--radius-lg);
  padding: var(--space-3) var(--space-4);
  font-size: var(--font-size-base);
  transition: all var(--transition-fast);
  background: #ffffff;
}

.form-control:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
  outline: none;
}

.form-label {
  font-weight: 500;
  color: #374151;
  margin-bottom: var(--space-2);
}

/* =================================================================
   Hero Section Enhancements
   ================================================================= */
.hero-section {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: var(--space-16) 0;
  position: relative;
  overflow: hidden;
}

.hero-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="white" stroke-width="0.5" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
}

.hero-title {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  margin-bottom: var(--space-6);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.hero-subtitle {
  font-size: var(--font-size-xl);
  margin-bottom: var(--space-8);
  opacity: 0.9;
}

/* =================================================================
   Content Sections
   ================================================================= */
.content-section {
  padding: var(--space-16) 0;
}

.section-title {
  text-align: center;
  margin-bottom: var(--space-12);
}

.section-subtitle {
  text-align: center;
  font-size: var(--font-size-lg);
  color: #6b7280;
  margin-bottom: var(--space-8);
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* =================================================================
   Blog Enhancements
   ================================================================= */
.blog-card {
  background: white;
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: all var(--transition-normal);
  height: 100%;
  display: flex;
  flex-direction: column;
}

.blog-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-xl);
}

.blog-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  transition: transform var(--transition-normal);
}

.blog-card:hover .blog-image {
  transform: scale(1.05);
}

.blog-content {
  padding: var(--space-6);
  flex: 1;
  display: flex;
  flex-direction: column;
}

.blog-title {
  font-size: var(--font-size-lg);
  font-weight: 600;
  margin-bottom: var(--space-3);
  color: #111827;
}

.blog-excerpt {
  color: #6b7280;
  margin-bottom: var(--space-4);
  flex: 1;
}

.blog-meta {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  font-size: var(--font-size-sm);
  color: #9ca3af;
  margin-bottom: var(--space-4);
}

.blog-author {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.blog-date {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/* =================================================================
   Quiz Enhancements
   ================================================================= */
.quiz-container {
  background: white;
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  box-shadow: var(--shadow-lg);
  margin: var(--space-8) 0;
}

.quiz-progress {
  background: #f3f4f6;
  height: 8px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: var(--space-8);
}

.quiz-progress-bar {
  background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
  height: 100%;
  transition: width var(--transition-normal);
  border-radius: var(--radius-lg);
}

.quiz-question {
  font-size: var(--font-size-xl);
  font-weight: 600;
  margin-bottom: var(--space-6);
  color: #111827;
}

.quiz-option {
  background: white;
  border: 2px solid #e5e7eb;
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  margin-bottom: var(--space-3);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.quiz-option:hover {
  border-color: var(--primary-color);
  background: var(--primary-light);
}

.quiz-option.selected {
  border-color: var(--primary-color);
  background: var(--primary-color);
  color: white;
}

.quiz-option.correct {
  border-color: var(--success-color);
  background: #dcfce7;
  color: #166534;
}

.quiz-option.incorrect {
  border-color: var(--error-color);
  background: #fee2e2;
  color: #991b1b;
}

/* =================================================================
   Footer Enhancements
   ================================================================= */
.footer {
  background: linear-gradient(135deg, #1f2937, #111827);
  color: white;
  padding: var(--space-16) 0 var(--space-8) 0;
  margin-top: var(--space-16);
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--space-8);
  margin-bottom: var(--space-8);
}

.footer-section h4 {
  color: white;
  margin-bottom: var(--space-4);
}

.footer-section a {
  color: #d1d5db;
  display: block;
  margin-bottom: var(--space-2);
  transition: color var(--transition-fast);
}

.footer-section a:hover {
  color: var(--primary-color);
}

.footer-bottom {
  border-top: 1px solid #374151;
  padding-top: var(--space-6);
  text-align: center;
  color: #9ca3af;
}

/* =================================================================
   Utility Classes
   ================================================================= */
.text-gradient {
  background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.bg-gradient {
  background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
}

.glass {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.animate-float {
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
}

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

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

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

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

/* =================================================================
   Dark Mode Support
   ================================================================= */
@media (prefers-color-scheme: dark) {
  :root {
    --primary-light: #1e40af;
  }
  
  body {
    background-color: var(--dark-bg);
    color: var(--dark-text);
  }
  
  .card {
    background: var(--dark-surface);
    border-color: #374151;
    color: var(--dark-text);
  }
  
  .navbar {
    background: rgba(15, 23, 42, 0.95);
    border-bottom-color: rgba(55, 65, 81, 0.5);
  }
  
  .form-control {
    background: var(--dark-surface);
    border-color: #374151;
    color: var(--dark-text);
  }
  
  .form-control:focus {
    border-color: var(--primary-color);
  }
}

/* =================================================================
   Responsive Design
   ================================================================= */
@media (max-width: 768px) {
  :root {
    --font-size-4xl: 2rem;
    --font-size-3xl: 1.5rem;
    --space-16: 3rem;
    --space-12: 2rem;
  }
  
  .hero-section {
    padding: var(--space-12) 0;
  }
  
  .content-section {
    padding: var(--space-12) 0;
  }
  
  .card-body {
    padding: var(--space-4);
  }
  
  .btn {
    padding: var(--space-2) var(--space-4);
    font-size: var(--font-size-xs);
  }
}

@media (max-width: 480px) {
  .footer-content {
    grid-template-columns: 1fr;
  }
  
  .blog-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-2);
  }
}

/* =================================================================
   Accessibility Improvements
   ================================================================= */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

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

/* Focus styles for better accessibility */
*:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* =================================================================
   Print Styles
   ================================================================= */
@media print {
  .navbar,
  .footer,
  .btn,
  .quiz-container {
    display: none !important;
  }
  
  body {
    background: white !important;
    color: black !important;
  }
  
  .card {
    border: 1px solid #ccc !important;
    box-shadow: none !important;
  }
}
