@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
  --background: oklch(1 0 0);
  --foreground: oklch(0.15 0 0);
  --card: oklch(0.99 0 0);
  --card-foreground: oklch(0.15 0 0);
  --secondary: oklch(0.96 0 0);
  --secondary-foreground: oklch(0.15 0 0);
  --muted: oklch(0.96 0 0);
  --muted-foreground: oklch(0.5 0 0);
  --border: oklch(0.9 0 0);
  --input: oklch(0.95 0 0);
  --ring: oklch(0.15 0 0);
}

/* Dark mode colors - Optimized for better contrast and readability */
[data-theme="dark"] {
  --background: oklch(0.12 0 0);
  --foreground: oklch(0.98 0 0);
  --card: oklch(0.16 0 0);
  --card-foreground: oklch(0.98 0 0);
  --secondary: oklch(0.20 0 0);
  --secondary-foreground: oklch(0.98 0 0);
  --muted: oklch(0.20 0 0);
  --muted-foreground: oklch(0.72 0 0);
  --border: oklch(0.30 0 0);
  --input: oklch(0.20 0 0);
  --ring: oklch(0.88 0 0);
}

/* Smooth theme transition */
html {
  transition: background-color 0.3s ease, color 0.3s ease;
}

html.no-transition,
html.no-transition * {
  transition: none !important;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Display', system-ui, sans-serif;
  background: var(--background);
  color: var(--foreground);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.6;
}

html {
  scroll-behavior: smooth;
}

main {
  min-height: 100vh;
}

.container {
  max-width: 1152px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

footer {
  padding: 6rem 1.5rem 8rem;
  border-top: 1px solid var(--border);
}

/* Navigation styles */
nav.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

[data-theme="dark"] nav.navbar {
  background: rgba(26, 26, 26, 0.8);
}

.nav-content {
  max-width: 1152px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 3rem;
}

.brand {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: var(--foreground);
  transition: opacity 0.3s;
}

.brand:hover {
  opacity: 0.7;
}

.nav-links {
  display: none;
  gap: 2rem;
}

@media (min-width: 768px) {
  .nav-links {
    display: flex;
  }
}

.nav-link {
  font-size: 15px;
  font-weight: 400;
  color: var(--muted-foreground);
  text-decoration: none;
  transition: color 0.2s;
}

.nav-link:hover {
  color: var(--foreground);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  height: 32px;
  padding: 0 0.75rem;
  border: none;
  background: transparent;
  color: var(--foreground);
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.2s;
}

.lang-btn:hover {
  background: var(--secondary);
}

.lang-dropdown {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  min-width: 200px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  padding: 0.5rem;
  display: none;
  z-index: 100;
}

.lang-dropdown.show {
  display: block;
}

.lang-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.2s;
}

.lang-item:hover {
  background: var(--secondary);
}

.lang-item-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  height: 40px;
  padding: 0 1.5rem;
  background: var(--foreground);
  color: white;
  font-size: 15px;
  font-weight: 500;
  font-family: inherit;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.btn-primary:hover {
  transform: scale(1.02);
}

.btn-primary:active {
  transform: scale(0.98);
}

/* Theme Toggle Button with Label */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: 40px;
  padding: 0 1rem;
  border: none;
  background: var(--secondary);
  color: var(--foreground);
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  white-space: nowrap;
}

.theme-toggle:hover {
  background: var(--muted);
  transform: scale(1.02);
}

.theme-toggle:active {
  transform: scale(0.98);
}

.theme-toggle-icon {
  position: relative;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.theme-toggle .sun-icon,
.theme-toggle .moon-icon {
  position: absolute;
  top: 0;
  left: 0;
  transition: all 0.3s;
}

.theme-toggle .sun-icon {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

.theme-toggle .moon-icon {
  opacity: 0;
  transform: rotate(90deg) scale(0);
}

[data-theme="dark"] .theme-toggle .sun-icon {
  opacity: 0;
  transform: rotate(-90deg) scale(0);
}

[data-theme="dark"] .theme-toggle .moon-icon {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

.theme-toggle-text {
  display: none;
}

@media (min-width: 640px) {
  .theme-toggle-text {
    display: inline;
  }
}

/* Mobile responsive */
@media (max-width: 768px) {
  .nav-content {
    flex-direction: row;
    flex-wrap: wrap;
    height: auto;
    padding: 0.75rem 1rem;
    gap: 0.5rem;
  }

  .nav-left {
    flex: 1;
    min-width: 0;
  }

  .nav-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }

  .nav-right .btn-primary {
    padding: 0 1rem;
    height: 36px;
    font-size: 14px;
  }

  .theme-toggle {
    height: 36px;
    padding: 0 0.75rem;
  }

  .lang-btn {
    height: 32px;
    padding: 0 0.5rem;
  }

  .lang-btn .lang-name {
    display: none;
  }
}

@media (max-width: 480px) {
  .nav-content {
    padding: 0.5rem 0.75rem;
  }

  .nav-right .btn-primary {
    padding: 0 0.75rem;
    height: 32px;
    font-size: 13px;
  }

  .theme-toggle {
    height: 32px;
    padding: 0 0.5rem;
  }

  .brand svg {
    height: 28px;
  }
}

/* Dark mode button fixes */
[data-theme="dark"] .btn-primary {
  background: var(--foreground);
  color: var(--background);
}

[data-theme="dark"] .lang-dropdown {
  background: var(--card);
}
