/* ============================================================================
   HOMEPAGE STYLES - React Design to Vanilla CSS
   Based on the React UnitConvert homepage design
   ============================================================================ */

/* CSS Custom Properties - Design System */
:root {
  /* Colors - Primary Palette */
  --primary: hsl(222, 47%, 50%);
  --primary-foreground: hsl(0, 0%, 100%);
  --secondary: hsl(280, 60%, 55%);
  --secondary-foreground: hsl(0, 0%, 100%);

  /* Background Colors */
  --background: hsl(0, 0%, 100%);
  --foreground: hsl(222, 47%, 11%);
  --muted: hsl(210, 40%, 96%);
  --muted-foreground: hsl(215, 16%, 47%);

  /* Card & UI Elements */
  --card: hsl(0, 0%, 100%);
  --card-foreground: hsl(222, 47%, 11%);
  --border: hsl(214, 32%, 91%);
  --accent: hsl(210, 40%, 96%);

  /* Gradients */
  --gradient-primary: linear-gradient(135deg, hsl(222, 47%, 50%) 0%, hsl(280, 60%, 55%) 100%);
  --gradient-subtle: linear-gradient(180deg, hsl(0, 0%, 100%) 0%, hsl(210, 40%, 98%) 100%);
  --gradient-text: linear-gradient(135deg, hsl(222, 47%, 50%) 0%, hsl(280, 60%, 55%) 100%);

  /* Spacing Scale */
  --spacing-xs: 0.25rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 2rem;
  --spacing-2xl: 3rem;
  --spacing-3xl: 4rem;

  /* Border Radius */
  --radius-sm: 0.5rem;
  --radius-md: 0.75rem;
  --radius-lg: 1rem;
  --radius-xl: 1.5rem;
  --radius-2xl: 2rem;
  --radius-3xl: 3rem;

  /* 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), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
}

/* ============================================================================
   ANIMATIONS & KEYFRAMES
   ============================================================================ */

@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.95);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.5;
  }
}

/* Animation Utility Classes */
.animate-fade-in {
  animation: fadeIn 0.6s ease-out;
}

.animate-slide-up {
  animation: slideUp 0.6s ease-out;
  animation-delay: 0.1s;
  animation-fill-mode: backwards;
}

.animate-scale-in {
  animation: scaleIn 0.6s ease-out;
  animation-delay: 0.2s;
  animation-fill-mode: backwards;
}

/* ============================================================================
   HERO SECTION
   ============================================================================ */

.hero-section {
  position: relative;
  overflow: hidden;
  background: var(--gradient-subtle);
  padding: 2rem 0 3rem;
  text-align: center;
}

@media (min-width: 768px) {
  .hero-section {
    padding: 3rem 0 5rem;
  }
}

/* Background Decorations */
.hero-bg-decorations {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.hero-bg-decorations::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, hsla(222, 47%, 50%, 0.05) 0%, transparent 100%);
  border-radius: 50%;
  filter: blur(80px);
}

.hero-bg-decorations::after {
  content: '';
  position: absolute;
  bottom: -50%;
  left: -50%;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, hsla(280, 60%, 55%, 0.05) 0%, transparent 100%);
  border-radius: 50%;
  filter: blur(80px);
}

.hero-content {
  position: relative;
  z-index: 10;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Badge */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 1rem;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 1.5rem;
}

.badge-primary {
  background: hsla(222, 47%, 50%, 0.1);
  border: 1px solid hsla(222, 47%, 50%, 0.2);
  color: var(--primary);
}

.pulse-dot {
  display: inline-block;
  width: 0.5rem;
  height: 0.5rem;
  background: var(--secondary);
  border-radius: 50%;
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Headlines */
.hero-headline {
  font-size: 2.25rem;
  font-weight: 700;
  color: var(--foreground);
  margin-bottom: 1.5rem;
  line-height: 1.2;
}

@media (min-width: 768px) {
  .hero-headline {
    font-size: 3rem;
  }
}

@media (min-width: 1024px) {
  .hero-headline {
    font-size: 3.75rem;
  }
}

.gradient-text {
  background: var(--gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subheadline {
  font-size: 1.125rem;
  color: var(--muted-foreground);
  max-width: 42rem;
  margin: 0 auto 2rem;
  line-height: 1.6;
}

@media (min-width: 768px) {
  .hero-subheadline {
    font-size: 1.25rem;
  }
}

/* Feature Checkmarks */
.hero-features {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem 1.5rem;
  margin-bottom: 3rem;
}

.feature-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

@media (min-width: 768px) {
  .feature-check {
    font-size: 1rem;
  }
}

.feature-check::before {
  content: '✓';
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
  background: var(--secondary);
  color: white;
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 700;
}

/* ============================================================================
   QUICK CONVERTER WIDGET
   ============================================================================ */

.quick-converter-card {
  width: 100%;
  max-width: 64rem;
  margin: 0 auto;
  background: hsl(0, 0%, 100%);
  border-radius: var(--radius-2xl);
  padding: 2.5rem;
  box-shadow: 0 20px 60px -10px rgba(0, 0, 0, 0.15);
}

@media (min-width: 768px) {
  .quick-converter-card {
    padding: 2.5rem;
  }
}

.converter-section {
  margin-bottom: 2rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
}

.converter-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted-foreground);
  margin-bottom: 0.5rem;
  text-align: left;
}

.converter-select {
  width: 100%;
  height: 3rem;
  padding: 0 1rem;
  background: hsl(0, 0%, 100%);
  border: 1px solid hsl(214, 32%, 91%);
  border-radius: var(--radius-md);
  font-size: 1rem;
  color: var(--foreground);
  cursor: pointer;
  transition: all 0.2s;
}

.converter-category-select {
  max-width: 20rem;
}

.converter-select:hover {
  border-color: hsl(214, 32%, 85%);
}

.converter-select:focus {
  outline: none;
  border-color: hsl(214, 32%, 80%);
}

.converter-to-select {
  border: 2px solid hsl(217, 91%, 60%);
}

.converter-to-select:hover,
.converter-to-select:focus {
  border-color: hsl(217, 91%, 60%);
}

.converter-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  align-items: center;
}

@media (min-width: 768px) {
  .converter-grid {
    grid-template-columns: 1fr auto 1fr;
    gap: 1.5rem;
  }
}

.converter-column:first-child {
  order: 1;
}

.converter-arrow-wrapper {
  order: 2;
}

.converter-column:last-child {
  order: 3;
}

.converter-column {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: flex-start;
  text-align: left;
}

.converter-label-with-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.converter-to-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  background: hsl(217, 91%, 60%);
  color: white;
  border-radius: 0.375rem;
  border: none;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.converter-to-badge:hover {
  background: hsl(217, 91%, 55%);
  transform: scale(1.1);
}

.converter-to-badge:active,
.converter-to-badge.swap-active {
  transform: rotate(180deg) scale(0.95);
}

.converter-input {
  width: 100%;
  padding: 1rem 1.25rem;
  font-size: 1.875rem;
  font-weight: 600;
  background: hsl(210, 40%, 98%);
  border: 1px solid hsl(214, 32%, 91%);
  border-radius: var(--radius-lg);
  color: var(--foreground);
  transition: all 0.2s;
}

.converter-input:focus {
  outline: none;
  border-color: hsl(214, 32%, 80%);
}

.converter-result-input {
  width: 100%;
  padding: 1rem 1.25rem;
  font-size: 1.875rem;
  font-weight: 700;
  background: hsl(210, 40%, 98%);
  border: 1px solid hsl(214, 32%, 91%);
  border-radius: var(--radius-lg);
  color: hsl(217, 91%, 60%);
  display: flex;
  align-items: center;
  min-height: 4.25rem;
}

.converter-arrow-wrapper {
  display: flex !important;
  align-items: center;
  justify-content: center;
  align-self: center;
  padding: 0.5rem 0;
  order: 2;
}

@media (min-width: 768px) {
  .converter-arrow-wrapper {
    align-self: flex-end;
    padding-bottom: 0.5rem;
  }
}

.converter-arrow-button {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  background: hsl(217, 91%, 60%);
  background: linear-gradient(135deg, hsl(217, 91%, 65%) 0%, hsl(217, 91%, 55%) 100%);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 12px hsla(217, 91%, 60%, 0.25);
}

@media (min-width: 768px) {
  .converter-arrow-button {
    width: 3rem;
    height: 3rem;
  }
}



.converter-arrow-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px hsla(217, 91%, 60%, 0.35);
}

.converter-arrow-button:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px hsla(217, 91%, 60%, 0.25);
}

.converter-arrow-button.swap-active {
  transform: rotate(180deg);
}

.converter-formula {
  margin-top: 2rem;
  text-align: center;
  font-size: 1.125rem;
  color: var(--muted-foreground);
  display: none;
}

.formula-from {
  font-weight: 600;
  color: var(--foreground);
}

.formula-equals {
  margin: 0 0.5rem;
}

.formula-result {
  font-weight: 700;
  font-size: 1.25rem;
  color: hsl(217, 91%, 60%);
}

/* ============================================================================
   SECTION LAYOUTS
   ============================================================================ */

.section {
  padding: 2.5rem 0;
}

@media (min-width: 768px) {
  .section {
    padding: 4rem 0;
  }
}

.section-muted {
  background: hsla(210, 40%, 96%, 0.3);
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Section Headers */
.section-header {
  text-align: center;
  margin-bottom: 2rem;
}

.section-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--primary);
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
}

.section-title {
  font-size: 1.875rem;
  font-weight: 700;
  color: var(--foreground);
  margin-bottom: 1rem;
}

@media (min-width: 768px) {
  .section-title {
    font-size: 2.25rem;
  }
}

.section-description {
  font-size: 1.125rem;
  color: var(--muted-foreground);
  max-width: 42rem;
  margin: 0 auto;
  line-height: 1.6;
}

/* ============================================================================
   POPULAR CONVERSIONS GRID
   ============================================================================ */

.popular-conversions-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

@media (min-width: 640px) {
  .popular-conversions-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 768px) {
  .popular-conversions-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
  }
}

@media (min-width: 1024px) {
  .popular-conversions-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

@media (min-width: 1280px) {
  .popular-conversions-grid {
    grid-template-columns: repeat(6, 1fr);
  }
}

.conversion-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 1rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  text-decoration: none;
  transition: all 0.3s;
}

.conversion-card:hover {
  border-color: hsla(222, 47%, 50%, 0.3);
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.conversion-symbols {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.conversion-from {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--primary);
}

.conversion-arrow {
  color: var(--muted-foreground);
  transition: color 0.3s;
}

.conversion-card:hover .conversion-arrow {
  color: var(--primary);
}

.conversion-to {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--secondary);
}

.conversion-label {
  font-size: 0.75rem;
  color: var(--muted-foreground);
  transition: color 0.3s;
}

.conversion-card:hover .conversion-label {
  color: var(--foreground);
}

/* ============================================================================
   CATEGORIES GRID
   ============================================================================ */

.categories-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 640px) {
  .categories-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .categories-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1280px) {
  .categories-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.category-card {
  display: block;
  padding: 1.5rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  text-decoration: none;
  transition: all 0.3s;
}

.category-card:hover {
  border-color: hsla(222, 47%, 50%, 0.2);
  box-shadow: var(--shadow-lg);
}

.category-icon {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: var(--radius-xl);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  font-size: 1.75rem;
  transition: transform 0.3s;
}

.category-card:hover .category-icon {
  transform: scale(1.1);
}

.category-name {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--foreground);
  margin-bottom: 0.5rem;
  transition: color 0.3s;
}

.category-card:hover .category-name {
  color: var(--primary);
}

.category-description {
  font-size: 0.875rem;
  color: var(--muted-foreground);
  line-height: 1.5;
  margin-bottom: 1rem;
}

.category-units-count {
  font-size: 0.75rem;
  color: var(--primary);
  font-weight: 500;
  opacity: 0;
  transition: opacity 0.3s;
}

.category-card:hover .category-units-count {
  opacity: 1;
}

/* ============================================================================
   FEATURES GRID
   ============================================================================ */

.features-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 768px) {
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .features-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.feature-card {
  padding: 2rem;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-2xl);
  transition: all 0.3s;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.feature-card:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  transform: translateY(-4px);
}

.feature-icon-wrapper {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
  transition: transform 0.3s;
}

.feature-card:hover .feature-icon-wrapper {
  transform: scale(1.1);
}

.feature-icon {
  width: 1.75rem;
  height: 1.75rem;
  color: white;
}

.feature-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--foreground);
  margin-bottom: 0.75rem;
}

.feature-description {
  color: var(--muted-foreground);
  line-height: 1.6;
  font-size: 0.938rem;
}

/* ============================================================================
   FAQ ACCORDION
   ============================================================================ */

.faq-container {
  max-width: 56rem;
  margin: 0 auto;
}

.accordion-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  margin-bottom: 1rem;
  transition: all 0.3s;
}

.accordion-item.active {
  box-shadow: var(--shadow-lg);
}

.accordion-trigger {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  text-align: left;
  background: none;
  border: none;
  padding: 0;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--foreground);
  cursor: pointer;
  transition: color 0.3s;
}

.accordion-trigger:hover {
  color: var(--primary);
}

.accordion-icon {
  width: 1.5rem;
  height: 1.5rem;
  transition: transform 0.3s;
  flex-shrink: 0;
  margin-left: 1rem;
}

.accordion-item.active .accordion-icon {
  transform: rotate(180deg);
}

.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out;
}

.accordion-content-inner {
  padding-top: 1.25rem;
  color: var(--muted-foreground);
  line-height: 1.6;
}

/* ============================================================================
   UTILITY CLASSES
   ============================================================================ */

.text-center {
  text-align: center;
}

.flex {
  display: flex;
}

.flex-wrap {
  flex-wrap: wrap;
}

.justify-center {
  justify-content: center;
}

.gap-md {
  gap: 1rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 500;
  border-radius: var(--radius-lg);
  text-decoration: none;
  transition: all 0.2s;
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: var(--gradient-primary);
  color: var(--primary-foreground);
  box-shadow: var(--shadow-md);
}

.btn-primary:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--border);
  color: var(--foreground);
}

.btn-outline:hover {
  background: var(--muted);
  border-color: var(--primary);
}

.btn-lg {
  padding: 1rem 2rem;
  font-size: 1.125rem;
}