/* Root Color Variables - Updated to match logo colors */
:root {
  /* Primary Colors - Red from logo */
  --primary: #dc2626;
  --primary-dark: #b91c1c;
  --primary-light: #ef4444;
  --primary-foreground: #ffffff;

  /* Secondary Colors - Green from logo */
  --secondary: #16a34a;
  --secondary-dark: #15803d;
  --secondary-light: #22c55e;
  --secondary-foreground: #ffffff;

  /* Accent Colors */
  --accent: #16a34a;
  --accent-dark: #15803d;
  --accent-foreground: #ffffff;

  /* Background Colors */
  --background: #ffffff;
  --foreground: #111827;
  --muted: #f9fafb;
  --muted-foreground: #6b7280;

  /* Border and Input */
  --border: #e5e7eb;
  --input: #e5e7eb;
  --ring: #16a34a;

  /* Status Colors */
  --success: #16a34a;
  --error: #dc2626;
  --warning: #f59e0b;
  --info: #3b82f6;
}

/* Dark Mode Variables */
.dark {
  --primary: #ef4444;
  --primary-dark: #dc2626;
  --primary-light: #f87171;
  --primary-foreground: #ffffff;

  --secondary: #22c55e;
  --secondary-dark: #16a34a;
  --secondary-foreground: #ffffff;

  --accent: #109942;
  --accent-dark: #16a34a;
  --accent-foreground: #ffffff;

  --background: #111827;
  --foreground: #f9fafb;
  --muted: #1f2937;
  --muted-foreground: #9ca3af;

  --border: #374151;
  --input: #374151;
  --ring: #16a34a;

  --success: #22c55e;
  --error: #f87171;
  --warning: #fbbf24;
  --info: #60a5fa;
}

/* Apply CSS Variables to Elements */
* {
  border-color: var(--border);
}

body {
  background-color: var(--background);
  color: var(--foreground);
}

/* Utility Classes for CSS Variables */
.bg-primary {
  background-color: var(--primary) !important;
}
.bg-primary-dark {
  background-color: var(--primary-dark) !important;
}
.bg-secondary {
  background-color: var(--secondary) !important;
}
.bg-accent {
  background-color: var(--accent) !important;
}
.bg-background {
  background-color: var(--background) !important;
}
.bg-muted {
  background-color: var(--muted) !important;
}

.text-primary {
  color: var(--primary) !important;
}
.text-primary-dark {
  color: var(--primary-dark) !important;
}
.text-secondary {
  color: var(--secondary) !important;
}
.text-secondary-foreground {
  color: var(--secondary-foreground) !important;
}
.text-accent {
  color: var(--accent) !important;
}
.text-foreground {
  color: var(--foreground) !important;
}
.text-muted-foreground {
  color: var(--muted-foreground) !important;
}

.border-primary {
  border-color: var(--primary) !important;
}
.border-input {
  border-color: var(--input) !important;
}

/* Custom styles for additional functionality */
.transition-colors {
  transition: color 0.3s ease, background-color 0.3s ease, border-color 0.3s ease;
}

/* Form validation styles */
.form-error {
  border-color: var(--error);
}

.form-success {
  border-color: var(--success);
}

/* Loading state */
.loading {
  opacity: 0.7;
  pointer-events: none;
}

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .page-transition {
    transition: none;
  }

  .back-to-top {
    transition: opacity 0.3s ease;
  }
}

/* Focus styles for accessibility */
button:focus,
input:focus,
select:focus,
textarea:focus {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* Mobile menu animation */
#mobile-menu {
  transition: all 0.3s ease;
}

/* Theme transition */
* {
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* Navbar hover effects for links */
.navbar-link {
  transition: all 0.3s ease;
  color: var(--foreground);
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
}

.navbar-link:hover {
  /* Changed hover color from red to green */
  color: var(--secondary) !important;
  transform: scale(1.05);
  background-color: var(--muted);
}

/* Mobile navbar link styles */
.mobile-navbar-link {
  transition: all 0.3s ease;
  color: var(--foreground);
  text-decoration: none;
  padding: 0.75rem 1rem;
  border-radius: 0.375rem;
  display: block;
}

.mobile-navbar-link:hover {
  /* Changed mobile hover color from red to green */
  color: var(--secondary) !important;
  background-color: var(--muted);
  transform: translateX(0.25rem);
}

/* Logo hover effect */
.logo-link {
  transition: all 0.3s ease;
}

.logo-link:hover {
  transform: scale(1.05);
}

/* Card Component */
.card {
  background-color: var(--background);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.dark .card {
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.3);
}

/* Badge Component */
.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 9999px;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 500;
  background-color: var(--muted);
  color: var(--muted-foreground);
  transition: all 0.2s ease;
}

.badge-primary {
  background-color: var(--primary);
  color: var(--primary-foreground);
}

.badge:hover {
  background-color: var(--primary);
  color: var(--primary-foreground);
}

/* Button Component */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.5rem 1rem;
  transition: all 0.2s;
  cursor: pointer;
  border: none;
  text-decoration: none;
}

.btn-primary {
  background-color: var(--primary);
  color: var(--primary-foreground);
}

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

.btn-secondary {
  background-color: var(--muted);
  color: var(--muted-foreground);
}

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

.btn-ghost {
  background-color: transparent;
  color: var(--foreground);
}

.btn-ghost:hover {
  background-color: var(--muted);
}

/* Utility Classes */
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Theme Toggle Button */
.theme-toggle {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 50;
  background-color: var(--background);
  border: 1px solid var(--border);
  border-radius: 0.375rem;
  padding: 0.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.theme-toggle:hover {
  background-color: var(--muted);
}

/* Back to Top Button Styles */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 1000;
  background: linear-gradient(135deg, var(--secondary), var(--secondary-dark));
  color: white;
  border: none;
  border-radius: 50%;
  width: 56px;
  height: 56px;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 20px rgba(22, 163, 74, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
}

.back-to-top:hover {
  background: linear-gradient(135deg, var(--secondary-dark), var(--secondary));
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 8px 25px rgba(22, 163, 74, 0.4);
}

.back-to-top:active {
  transform: translateY(-1px) scale(1.02);
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  animation: slideInUp 0.3s ease-out;
}

.back-to-top svg {
  width: 24px;
  height: 24px;
  transition: transform 0.2s ease;
}

.back-to-top:hover svg {
  transform: translateY(-2px);
}

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

/* Page Transition Styles */
.page-transition {
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.5s ease;
}

.page-transition.loaded {
  opacity: 1;
  transform: translateY(0);
}

/* Custom translation select to match theme */
.translate-select {
  background-color: var(--background);
  color: var(--foreground);
  border: 1px solid var(--border);
  border-radius: 0.375rem;
  padding: 0.375rem 0.5rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.translate-select:hover {
  border-color: var(--secondary);
}

.translate-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 30%, transparent);
}

.dark .translate-select {
  background-color: var(--muted);
  color: var(--foreground);
}

/* ===========================
   Translator icon + dropdown styles
   =========================== */
.translate-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.translate-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  width: 36px;
  border-radius: 0.375rem;
  border: 1px solid var(--border);
  background-color: var(--background);
  color: var(--foreground);
  cursor: pointer;
}

.translate-button:hover {
  background-color: var(--muted);
}

.translate-menu {
  position: absolute;
  top: 110%;
  right: 0;
  z-index: 1000;
  width: 240px;
  max-height: 300px;
  overflow: auto;
  background-color: var(--background);
  color: var(--foreground);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
  padding: 6px;
  display: none;
}

.translate-menu.open {
  display: block;
  animation: slideInUp 0.18s ease-out;
}

.translate-search {
  width: 100%;
  border: 1px solid var(--input);
  border-radius: 0.375rem;
  background: var(--background);
  color: var(--foreground);
  font-size: 0.875rem;
  padding: 6px 8px;
  margin-bottom: 6px;
  outline: none;
}

.translate-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  border-radius: 0.375rem;
  cursor: pointer;
  font-size: 0.9rem;
}

.translate-item:hover,
.translate-item[aria-current="true"] {
  background-color: var(--muted);
}

.translate-divider {
  height: 1px;
  background: var(--border);
  margin: 6px 0;
}

/* Ensure language <select> is visible now that Google Translate is removed */
.language-select {
  display: inline-block !important;
}

/* Hide legacy selects when JS enhances */
.language-select {
  display: none !important;
}
.goog-te-banner-frame.skiptranslate,
.goog-te-banner-frame {
  display: none !important;
}
.goog-te-gadget,
.goog-te-gadget-simple,
.goog-te-combo {
  display: none !important;
}
#goog-gt-tt,
.goog-te-balloon-frame,
.goog-tooltip,
.goog-tooltip:hover {
  display: none !important;
  visibility: hidden !important;
}
.goog-text-highlight {
  background: transparent !important;
  box-shadow: none !important;
}
/* Google sets body { top: 40px } when banner is shown; force it back */
html body {
  top: 0 !important;
}
