/* ============================================
   BMI Calculator International - Styles
   Modern, Mobile-First, Clean Design
   ============================================ */

/* CSS Custom Properties */
:root {
  /* Colors */
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --primary-light: #818cf8;
  --secondary: #0ea5e9;

  /* BMI Category Colors */
  --underweight: #3b82f6;
  --normal: #10b981;
  --overweight: #f59e0b;
  --obesity: #ef4444;

  /* Neutrals */
  --white: #ffffff;
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;

  /* Typography */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --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;
  --font-size-5xl: 3rem;

  /* 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;

  /* Border Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-2xl: 1.5rem;
  --radius-full: 9999px;

  /* 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);
  --shadow-glow: 0 0 40px rgba(99, 102, 241, 0.15);

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 300ms ease;
  --transition-slow: 500ms ease;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  line-height: 1.6;
  color: var(--gray-700);
  background: linear-gradient(135deg, var(--gray-50) 0%, var(--white) 50%, var(--gray-100) 100%);
  min-height: 100vh;
}

/* RTL Support */
[dir="rtl"] {
  text-align: right;
}

[dir="rtl"] .lang-switcher {
  left: var(--space-4);
  right: auto;
}

[dir="rtl"] .input-group input {
  text-align: right;
}

/* ============================================
   Header & Language Switcher
   ============================================ */

header {
  position: relative;
  padding: var(--space-4);
  display: flex;
  justify-content: center;
  align-items: center;
}

.lang-switcher {
  position: absolute;
  right: var(--space-4);
  top: 50%;
  transform: translateY(-50%);
}

.lang-switcher select {
  appearance: none;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: var(--space-2) var(--space-8) var(--space-2) var(--space-3);
  font-size: var(--font-size-sm);
  font-family: var(--font-family);
  color: var(--gray-700);
  cursor: pointer;
  transition: all var(--transition-fast);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 16px;
}

[dir="rtl"] .lang-switcher select {
  padding: var(--space-2) var(--space-3) var(--space-2) var(--space-8);
  background-position: left 8px center;
}

.lang-switcher select:hover {
  border-color: var(--primary-light);
}

.lang-switcher select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.logo {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-weight: 700;
  font-size: var(--font-size-lg);
  color: var(--gray-800);
}

.logo-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-size: var(--font-size-lg);
}

/* ============================================
   Main Container
   ============================================ */

main {
  max-width: 600px;
  margin: 0 auto;
  padding: var(--space-4);
  padding-bottom: var(--space-16);
}

/* ============================================
   Hero Section
   ============================================ */

.hero {
  text-align: center;
  margin-bottom: var(--space-8);
  animation: fadeInUp 0.6s ease;
}

.hero h1 {
  font-size: var(--font-size-3xl);
  font-weight: 800;
  color: var(--gray-900);
  margin-bottom: var(--space-3);
  background: linear-gradient(135deg, var(--gray-900) 0%, var(--primary-dark) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero .subtitle {
  font-size: var(--font-size-lg);
  color: var(--gray-500);
  font-weight: 400;
}

/* ============================================
   Calculator Card
   ============================================ */

.calculator-card {
  background: var(--white);
  border-radius: var(--radius-2xl);
  padding: var(--space-8);
  box-shadow: var(--shadow-xl), var(--shadow-glow);
  margin-bottom: var(--space-8);
  animation: fadeInUp 0.6s ease 0.1s both;
}

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

.input-group label {
  display: block;
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: var(--space-2);
}

.input-group input {
  width: 100%;
  padding: var(--space-4);
  font-size: var(--font-size-lg);
  font-family: var(--font-family);
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-xl);
  transition: all var(--transition-fast);
  background: var(--gray-50);
}

.input-group input:hover {
  border-color: var(--gray-300);
}

.input-group input:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--white);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.input-group input::placeholder {
  color: var(--gray-400);
}

.btn-primary {
  width: 100%;
  padding: var(--space-4) var(--space-6);
  font-size: var(--font-size-lg);
  font-weight: 600;
  font-family: var(--font-family);
  color: var(--white);
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border: none;
  border-radius: var(--radius-xl);
  cursor: pointer;
  transition: all var(--transition-base);
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
}

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

/* ============================================
   Result Card
   ============================================ */

.result-card {
  display: none;
  background: var(--white);
  border-radius: var(--radius-2xl);
  padding: var(--space-8);
  box-shadow: var(--shadow-xl);
  margin-bottom: var(--space-8);
  text-align: center;
  animation: scaleIn 0.4s ease;
}

.result-card.visible {
  display: block;
}

.result-label {
  font-size: var(--font-size-sm);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--gray-500);
  margin-bottom: var(--space-2);
}

.bmi-value {
  font-size: var(--font-size-5xl);
  font-weight: 800;
  margin-bottom: var(--space-2);
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.bmi-category {
  display: inline-block;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-full);
  font-size: var(--font-size-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-4);
}

.bmi-category.underweight {
  background: rgba(59, 130, 246, 0.1);
  color: var(--underweight);
}

.bmi-category.normal {
  background: rgba(16, 185, 129, 0.1);
  color: var(--normal);
}

.bmi-category.overweight {
  background: rgba(245, 158, 11, 0.1);
  color: var(--overweight);
}

.bmi-category.obesity {
  background: rgba(239, 68, 68, 0.1);
  color: var(--obesity);
}

.result-tip {
  font-size: var(--font-size-base);
  color: var(--gray-600);
  line-height: 1.7;
  padding: var(--space-4);
  background: var(--gray-50);
  border-radius: var(--radius-lg);
  border-left: 4px solid var(--primary);
}

.healthy-range {
  font-size: var(--font-size-base);
  font-weight: 600;
  color: var(--normal);
  padding: var(--space-3) var(--space-4);
  background: rgba(16, 185, 129, 0.1);
  border-radius: var(--radius-lg);
  margin: var(--space-4) 0;
  text-align: center;
}

[dir="rtl"] .result-tip {
  border-left: none;
  border-right: 4px solid var(--primary);
}

/* BMI Scale Visual */
.bmi-scale {
  margin: var(--space-6) 0;
  padding: var(--space-4);
  background: var(--gray-50);
  border-radius: var(--radius-lg);
}

.scale-bar {
  height: 8px;
  border-radius: var(--radius-full);
  background: linear-gradient(to right,
      var(--underweight) 0%,
      var(--underweight) 18.5%,
      var(--normal) 18.5%,
      var(--normal) 50%,
      var(--overweight) 50%,
      var(--overweight) 75%,
      var(--obesity) 75%,
      var(--obesity) 100%);
  position: relative;
  margin-bottom: var(--space-3);
}

.scale-marker {
  position: absolute;
  top: -6px;
  width: 20px;
  height: 20px;
  background: var(--white);
  border: 3px solid var(--gray-800);
  border-radius: 50%;
  transform: translateX(-50%);
  box-shadow: var(--shadow-md);
  transition: left var(--transition-base);
}

.scale-labels {
  display: flex;
  justify-content: space-between;
  font-size: var(--font-size-xs);
  color: var(--gray-500);
}

/* ============================================
   CTA Section
   ============================================ */

.cta-section {
  display: none;
  margin-bottom: var(--space-8);
  animation: fadeInUp 0.6s ease;
}

.cta-section.visible {
  display: block;
}

.btn-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  width: 100%;
  padding: var(--space-5) var(--space-6);
  font-size: var(--font-size-lg);
  font-weight: 600;
  font-family: var(--font-family);
  color: var(--white);
  background: linear-gradient(135deg, var(--normal) 0%, #059669 100%);
  border: none;
  border-radius: var(--radius-xl);
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition-base);
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.4);
  margin-bottom: var(--space-4);
}

.btn-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5);
}

.btn-cta .icon {
  font-size: var(--font-size-xl);
}

.other-stores {
  text-align: center;
}

.other-stores-toggle {
  background: none;
  border: none;
  color: var(--gray-500);
  font-size: var(--font-size-sm);
  cursor: pointer;
  text-decoration: underline;
  font-family: var(--font-family);
  transition: color var(--transition-fast);
}

.other-stores-toggle:hover {
  color: var(--primary);
}

.other-stores-list {
  display: none;
  margin-top: var(--space-4);
  gap: var(--space-3);
  flex-direction: column;
}

.other-stores-list.visible {
  display: flex;
}

.btn-secondary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  font-size: var(--font-size-base);
  font-weight: 500;
  font-family: var(--font-family);
  color: var(--gray-700);
  background: var(--white);
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-lg);
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition-fast);
}

.btn-secondary:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(99, 102, 241, 0.05);
}

/* ============================================
   Why BMI Section
   ============================================ */

.why-section {
  background: var(--white);
  border-radius: var(--radius-2xl);
  padding: var(--space-8);
  margin-bottom: var(--space-8);
  box-shadow: var(--shadow-lg);
  animation: fadeInUp 0.6s ease 0.2s both;
}

.why-section h2 {
  font-size: var(--font-size-xl);
  font-weight: 700;
  color: var(--gray-800);
  margin-bottom: var(--space-6);
  text-align: center;
}

.why-list {
  list-style: none;
}

.why-list li {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-4) 0;
  border-bottom: 1px solid var(--gray-100);
}

.why-list li:last-child {
  border-bottom: none;
}

.why-list .icon {
  width: 24px;
  height: 24px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-size: var(--font-size-sm);
  flex-shrink: 0;
}

.why-list .text {
  color: var(--gray-600);
  line-height: 1.5;
}

/* ============================================
   Share Section
   ============================================ */

.share-section {
  background: var(--gray-50);
  border-radius: var(--radius-2xl);
  padding: var(--space-6);
  margin-bottom: var(--space-8);
  text-align: center;
  animation: fadeInUp 0.6s ease 0.3s both;
}

.share-section h3 {
  font-size: var(--font-size-base);
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: var(--space-4);
}

.share-buttons {
  display: flex;
  justify-content: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.share-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-lg);
  border: none;
  cursor: pointer;
  font-size: var(--font-size-xl);
  transition: all var(--transition-fast);
}

.share-btn.whatsapp {
  background: #25D366;
  color: var(--white);
}

.share-btn.facebook {
  background: #1877F2;
  color: var(--white);
}

.share-btn.copy {
  background: var(--white);
  border: 2px solid var(--gray-200);
  color: var(--gray-600);
}

.share-btn:hover {
  transform: scale(1.1);
}

.share-btn svg {
  width: 24px;
  height: 24px;
}

.share-btn.copy:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.copy-feedback {
  display: none;
  font-size: var(--font-size-sm);
  color: var(--normal);
  margin-top: var(--space-2);
}

.copy-feedback.visible {
  display: block;
  animation: fadeIn 0.3s ease;
}

/* ============================================
   Floating WhatsApp Contact Button
   ============================================ */

.whatsapp-float {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  background: #25D366;
  color: var(--white);
  border-radius: var(--radius-full);
  text-decoration: none;
  font-family: var(--font-family);
  font-weight: 600;
  font-size: var(--font-size-base);
  box-shadow: 0 4px 16px rgba(37, 211, 102, 0.4);
  transition: all var(--transition-base);
  z-index: 1000;
  animation: pulse 2s infinite;
}

.whatsapp-float:hover {
  transform: translateY(-4px) scale(1.05);
  box-shadow: 0 8px 24px rgba(37, 211, 102, 0.6);
  animation: none;
}

.whatsapp-float svg {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.whatsapp-float-text {
  white-space: nowrap;
}

/* RTL Support */
[dir="rtl"] .whatsapp-float {
  right: auto;
  left: 24px;
}

/* Mobile: Icon only */
@media (max-width: 640px) {
  .whatsapp-float {
    padding: var(--space-4);
    width: 56px;
    height: 56px;
    justify-content: center;
  }

  .whatsapp-float-text {
    display: none;
  }

  .whatsapp-float svg {
    width: 28px;
    height: 28px;
  }
}

@keyframes pulse {

  0%,
  100% {
    box-shadow: 0 4px 16px rgba(37, 211, 102, 0.4);
  }

  50% {
    box-shadow: 0 4px 24px rgba(37, 211, 102, 0.7);
  }
}


/* ============================================
   Footer
   ============================================ */

footer {
  background: var(--gray-800);
  color: var(--gray-300);
  padding: var(--space-8) var(--space-4);
  text-align: center;
}

.trust-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: var(--radius-full);
  margin-bottom: var(--space-6);
  color: var(--normal);
  font-size: var(--font-size-sm);
  font-weight: 600;
}

.trust-badge svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.disclaimer {
  max-width: 600px;
  margin: 0 auto var(--space-4);
  font-size: var(--font-size-sm);
  line-height: 1.7;
  padding: var(--space-4);
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.disclaimer::before {
  content: '⚠️ ';
}

.copyright {
  font-size: var(--font-size-xs);
  color: var(--gray-500);
}

/* ============================================
   Animations
   ============================================ */

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

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

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

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

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

/* ============================================
   Responsive Design
   ============================================ */

@media (min-width: 640px) {
  .hero h1 {
    font-size: var(--font-size-4xl);
  }

  .calculator-card,
  .result-card,
  .why-section {
    padding: var(--space-10);
  }

  .bmi-value {
    font-size: 4rem;
  }
}

@media (min-width: 768px) {
  main {
    padding: var(--space-8);
  }

  .hero h1 {
    font-size: var(--font-size-5xl);
  }
}

/* ============================================
   Utility Classes
   ============================================ */

.hidden {
  display: none !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;
}