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

:root {
  --primary-green: #008751;
  --primary-dark: #006B3F;
  --secondary-green: #10B981;
  --accent-orange: #F97316;
  --accent-blue: #3B82F6;
  --accent-indigo: #6366F1;
  --accent-purple: #8B5CF6;
  --accent-teal: #14B8A6;
  --bg-light: #F8FAFC;
  --bg-gradient: linear-gradient(to bottom, #F8FAFC 0%, #F1F5F9 100%);
  --bg-card: #FFFFFF;
  --text-dark: #0F172A;
  --text-muted: #64748B;
  --border-light: #E2E8F0;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
  --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.15);
  --transition-base: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  -webkit-tap-highlight-color: transparent;
}

body { 
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  background: var(--bg-gradient);
  color: var(--text-dark);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

.container { 
  max-width: 1200px; 
  margin-left: auto; 
  margin-right: auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

@media (min-width: 640px) {
  .container {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
}

@media (min-width: 1024px) {
  .container {
    padding-left: 2rem;
    padding-right: 2rem;
  }
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-green) 0%, var(--accent-teal) 100%);
  color: white;
  font-weight: 600;
  transition: var(--transition-base);
  box-shadow: var(--shadow-md);
  border: none;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, transparent 100%);
  opacity: 0;
  transition: var(--transition-base);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-xl);
}

.btn-primary:hover::before {
  opacity: 1;
}

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

@media (max-width: 640px) {
  .btn-primary {
    font-size: 0.9375rem;
    padding: 0.75rem 1.25rem;
  }
}

.question-card {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 1.5rem;
  transition: var(--transition-base);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  border-left: 4px solid var(--primary-green);
}

.question-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
  border-left-color: var(--accent-teal);
}

@media (max-width: 640px) {
  .question-card {
    padding: 1rem;
    border-radius: 12px;
  }
}

.category-badge {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(99, 102, 241, 0.1) 100%);
  color: var(--accent-indigo);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  border: 1px solid rgba(99, 102, 241, 0.2);
}

.hero-section {
  background: linear-gradient(135deg, var(--primary-green) 0%, var(--accent-teal) 50%, var(--accent-blue) 100%);
  color: white;
  padding: 3rem 1.5rem;
  border-radius: 20px;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-lg);
}

.nav-bar {
  background: rgba(255, 255, 255, 0.95);
  border-bottom: 1px solid var(--border-light);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(10px);
  transition: var(--transition-base);
}

.mobile-menu-btn {
  display: none;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  color: var(--primary-green);
  transition: var(--transition-fast);
}

.mobile-menu-btn:hover {
  background: rgba(0, 135, 81, 0.1);
  border-radius: 8px;
}

@media (max-width: 768px) {
  .mobile-menu-btn {
    display: block;
  }
  
  .nav-bar .hidden {
    display: none;
  }
}

.mobile-menu {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 100;
  animation: fadeIn 0.3s ease;
}

.mobile-menu.active {
  display: block;
}

.mobile-menu-content {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 80%;
  max-width: 320px;
  background: white;
  box-shadow: var(--shadow-xl);
  padding: 1.5rem;
  animation: slideInRight 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideInRight {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s ease-in-out infinite;
}

@keyframes loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--border-light);
  border-top-color: var(--primary-green);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

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

.animate-fade-in {
  animation: fade-in 0.6s ease-out forwards;
  opacity: 0;
}

.focus-visible:focus {
  outline: 2px solid var(--primary-green);
  outline-offset: 2px;
  border-radius: 4px;
}

input:focus, textarea:focus, select:focus, button:focus {
  outline: 2px solid var(--primary-green);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

.sidebar-card {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 1.25rem;
  border: 1px solid var(--border-light);
  margin-bottom: 1rem;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
}

.sidebar-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.points-badge {
  background: linear-gradient(135deg, var(--accent-orange) 0%, #FB923C 100%);
  color: white;
  font-weight: 700;
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  box-shadow: var(--shadow-md);
}

.answer-card {
  background: linear-gradient(135deg, #EEF2FF 0%, var(--bg-card) 100%);
  border-radius: 16px;
  padding: 1.5rem;
  border-left: 4px solid var(--accent-blue);
  transition: all 0.3s ease;
  box-shadow: var(--shadow-sm);
}

.answer-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateX(4px);
}

.answer-card.best-answer {
  border-left-color: var(--accent-orange);
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.1) 0%, var(--bg-card) 100%);
  box-shadow: 0 4px 16px rgba(249, 115, 22, 0.15);
}

.upvote-btn {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(99, 102, 241, 0.1) 100%);
  border: 2px solid rgba(99, 102, 241, 0.3);
  border-radius: 12px;
  padding: 0.5rem 1rem;
  font-weight: 600;
  transition: all 0.3s ease;
  color: var(--accent-indigo);
}

.upvote-btn:hover {
  border-color: var(--accent-indigo);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(139, 92, 246, 0.2) 100%);
  transform: scale(1.05);
}

.question-description {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.08) 0%, rgba(139, 92, 246, 0.08) 100%);
  border-left: 4px solid var(--accent-indigo);
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  color: var(--text-dark);
  font-size: 1.0625rem;
  line-height: 1.7;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.1);
}

.question-description p {
  color: #475569;
  font-weight: 400;
}

.search-autocomplete-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 1px solid var(--border-light);
  border-radius: 12px;
  margin-top: 0.5rem;
  box-shadow: var(--shadow-lg);
  max-height: 400px;
  overflow-y: auto;
  z-index: 50;
  display: none;
}

.search-result-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--border-light);
  transition: all 0.2s ease;
  cursor: pointer;
}

.search-result-item:last-child {
  border-bottom: none;
}

.search-result-item:hover {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, rgba(139, 92, 246, 0.05) 100%);
  padding-left: 1.25rem;
}

.search-result-content {
  flex: 1;
}

.search-result-title {
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 0.25rem;
  font-size: 0.9375rem;
}

.search-result-title mark {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(139, 92, 246, 0.2) 100%);
  color: var(--accent-indigo);
  padding: 0 0.25rem;
  border-radius: 4px;
  font-weight: 700;
}

.search-result-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.search-category {
  color: var(--accent-indigo);
  font-weight: 600;
}

.search-separator {
  color: var(--border-light);
}

.search-location {
  color: var(--text-muted);
}

.search-answers {
  color: var(--accent-teal);
  font-weight: 500;
}

.search-arrow {
  width: 1.25rem;
  height: 1.25rem;
  color: var(--text-muted);
  transition: all 0.2s ease;
}

.search-result-item:hover .search-arrow {
  color: var(--accent-indigo);
  transform: translateX(4px);
}

.search-no-results {
  padding: 1.5rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.credibility-card {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 1.5rem;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
}

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

.credibility-icon-orange {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.1) 0%, rgba(251, 146, 60, 0.1) 100%);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-orange);
}

.credibility-icon-indigo {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-indigo);
}

.credibility-icon-green {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, rgba(0, 135, 81, 0.1) 0%, rgba(16, 185, 129, 0.1) 100%);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-green);
}
