/* Performance Optimized CSS - Mobile First Approach */

/* Remove Google Fonts imports for better performance */
/* Use system fonts instead */

/* CSS Custom Properties for better performance */
:root {
  --primary-color: #4F46E5;
  --primary-hover: #4338CA;
  --secondary-color: #10B981;
  --text-primary: #1F2937;
  --text-secondary: #6B7280;
  --background-light: #F9FAFB;
  --background-white: #FFFFFF;
  --border-color: #E5E7EB;
  --transition-fast: 0.2s ease;
  --transition-medium: 0.3s ease;
  --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);
}

/* Optimized CSS Reset */
*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  color: var(--text-primary);
  line-height: 1.6;
  background-color: var(--background-light);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Optimized Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1rem;
}

/* Mobile-first responsive typography */
h1 {
  font-size: clamp(1.5rem, 4vw, 2.5rem);
}

h2 {
  font-size: clamp(1.25rem, 3vw, 2rem);
}

h3 {
  font-size: clamp(1.125rem, 2.5vw, 1.5rem);
}

/* Optimized Button Styles */
.btn-primary {
  background-color: var(--primary-color);
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  font-weight: 600;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  display: inline-block;
  text-decoration: none;
  color: white;
  font-size: 1rem;
}

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

.btn-primary:active {
  transform: translateY(0);
}

/* Optimized Card Design */
.card {
  background: var(--background-white);
  border-radius: 1rem;
  border: 1px solid var(--border-color);
  transition: all var(--transition-medium);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

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

/* Mobile-first Navigation */
nav {
  background: var(--background-white);
  padding: 1rem;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  align-items: center;
}

.nav-links a {
  color: var(--text-primary);
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  transition: all var(--transition-fast);
  font-weight: 500;
}

.nav-links a:hover {
  background-color: var(--background-light);
  color: var(--primary-color);
}

/* Mobile-first Hero Section */
.hero-section {
  background: linear-gradient(135deg, var(--primary-color) 0%, #6366F1 100%);
  color: white;
  padding: clamp(3rem, 8vw, 6rem) 1rem;
  position: relative;
  overflow: hidden;
  text-align: center;
}

.hero-section h1 {
  margin-bottom: 1.5rem;
  font-size: clamp(2rem, 6vw, 3.5rem);
}

.hero-section p {
  font-size: clamp(1rem, 3vw, 1.25rem);
  margin-bottom: 2rem;
  opacity: 0.9;
}

/* Optimized Form Elements */
.form-control {
  border-radius: 0.5rem;
  border: 1px solid var(--border-color);
  padding: 0.75rem 1rem;
  transition: all var(--transition-fast);
  width: 100%;
  font-size: 1rem;
}

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

/* Optimized Animations - Reduced motion for better performance */
@media (prefers-reduced-motion: no-preference) {
  .animate-fade-in {
    animation: fadeIn 0.5s ease-in;
  }

  @keyframes fadeIn {
    from {
      opacity: 0;
      transform: translateY(10px);
    }

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

/* Mobile-first Grid System */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

.grid {
  display: grid;
  gap: 1.5rem;
}

/* Mobile-first responsive grid */
.grid-1 {
  grid-template-columns: 1fr;
}

.grid-2 {
  grid-template-columns: 1fr;
}

.grid-3 {
  grid-template-columns: 1fr;
}

/* Tablet breakpoint */
@media (min-width: 768px) {
  .grid-2 {
    grid-template-columns: repeat(2, 1fr);
  }

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

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

/* Desktop breakpoint */
@media (min-width: 1024px) {
  .grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }

  .hero-section {
    padding: clamp(4rem, 10vw, 8rem) 2rem;
  }
}

/* Optimized Images */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Lazy loading for images */
.lazy-image {
  opacity: 0;
  transition: opacity var(--transition-medium);
}

.lazy-image.loaded {
  opacity: 1;
}

/* Optimized Footer */
footer {
  background: var(--text-primary);
  color: white;
  padding: 2rem 1rem;
  margin-top: 3rem;
}

.footer-content {
  text-align: center;
}

.footer-links {
  margin-bottom: 1rem;
}

.footer-links a {
  color: white;
  text-decoration: none;
  margin: 0 0.5rem;
  opacity: 0.8;
  transition: opacity var(--transition-fast);
}

.footer-links a:hover {
  opacity: 1;
}

/* Utility Classes */
.text-center {
  text-align: center;
}

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

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

.mb-1 {
  margin-bottom: 0.5rem;
}

.mb-2 {
  margin-bottom: 1rem;
}

.mb-3 {
  margin-bottom: 1.5rem;
}

.mb-4 {
  margin-bottom: 2rem;
}

.p-1 {
  padding: 0.5rem;
}

.p-2 {
  padding: 1rem;
}

.p-3 {
  padding: 1.5rem;
}

.p-4 {
  padding: 2rem;
}

.hidden {
  display: none;
}

.visible {
  display: block;
}

/* Loading States */
.loading {
  opacity: 0;
  transition: opacity var(--transition-medium);
}

.loaded {
  opacity: 1;
}

/* Optimized Alert Styles */
.alert {
  padding: 1rem;
  border-radius: 0.5rem;
  margin-bottom: 1rem;
  border: 1px solid transparent;
}

.alert-success {
  background-color: #d1fae5;
  border-color: #10b981;
  color: #065f46;
}

.alert-error {
  background-color: #fee2e2;
  border-color: #ef4444;
  color: #991b1b;
}

.alert-warning {
  background-color: #fef3c7;
  border-color: #f59e0b;
  color: #92400e;
}

/* Mobile-specific optimizations */
@media (max-width: 768px) {
  .nav-links {
    flex-direction: column;
    gap: 0.5rem;
  }

  .hero-section {
    padding: 2rem 1rem;
  }

  .btn-primary {
    width: 100%;
    text-align: center;
  }

  .card {
    margin-bottom: 1rem;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  :root {
    --primary-color: #000000;
    --text-primary: #000000;
    --background-white: #ffffff;
    --border-color: #000000;
  }
}

/* Print styles */
@media print {

  .nav-links,
  footer,
  .btn-primary {
    display: none;
  }

  body {
    background: white;
    color: black;
  }
}