:root {
  --primary-color: #0d6efd;
  --secondary-color: #6c757d;
  --dark-bg: #212529;
  --light-bg: #f8f9fa;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
}

/* Hero Section */
.hero-section {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  min-height: 500px;
  display: flex;
  align-items: center;
}

.hero-section h1 {
  text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.hero-section .btn-primary {
  background-color: white;
  color: #667eea;
  border: none;
  font-weight: 600;
}

.hero-section .btn-primary:hover {
  background-color: #f8f9fa;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.hero-section .btn-outline-primary {
  border-color: white;
  color: white;
  font-weight: 600;
}

.hero-section .btn-outline-primary:hover {
  background-color: white;
  color: #667eea;
}

/* Responsive hero image with lazy loading support */
.hero-section img {
  max-width: 100%;
  height: auto;
  width: 100%;
  display: block;
}

/* Feature Cards */
.feature-icon {
  font-size: 3rem;
  line-height: 1;
}

.card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.1) !important;
}

/* Community Post Cards */
.community-post-card .card-body {
  display: flex;
  flex-direction: column;
}

.comments-section {
  margin-top: auto;
}

.comment-icon {
  font-size: 1.1rem;
}

.comments-list {
  max-height: 200px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #ccc #f8f9fa;
}

.comments-list::-webkit-scrollbar {
  width: 6px;
}

.comments-list::-webkit-scrollbar-track {
  background: #f8f9fa;
  border-radius: 3px;
}

.comments-list::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 3px;
}

.comments-list::-webkit-scrollbar-thumb:hover {
  background: #999;
}

.comment-item {
  border-left: 3px solid #0d6efd;
  transition: background-color 0.2s ease;
}

.comment-item:hover {
  background-color: #e9ecef !important;
}

.comment-form {
  background-color: #fff;
  padding: 0.75rem;
  border-radius: 0.375rem;
  border: 1px solid #dee2e6;
}

.comment-form .form-control {
  font-size: 0.875rem;
}

.comment-form .btn-primary {
  position: relative;
  font-size: 0.875rem;
}

.alert-sm {
  font-size: 0.875rem;
  padding: 0.5rem;
}

/* Newsletter Section */
#newsletter .form-control {
  border: 2px solid rgba(255,255,255,0.3);
  background-color: rgba(255,255,255,0.1);
  color: white;
}

#newsletter .form-control::placeholder {
  color: rgba(255,255,255,0.7);
}

#newsletter .form-control:focus {
  border-color: white;
  background-color: rgba(255,255,255,0.2);
  color: white;
  box-shadow: 0 0 0 0.2rem rgba(255,255,255,0.25);
}

#newsletter .btn-light {
  font-weight: 600;
  transition: all 0.3s ease;
}

#newsletter .btn-light:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

/* Responsive Images with lazy loading */
img {
  max-width: 100%;
  height: auto;
}

img[loading="lazy"] {
  opacity: 0;
  transition: opacity 0.3s ease-in;
}

img[loading="lazy"].loaded {
  opacity: 1;
}

/* Accessibility Improvements */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* Focus styles for keyboard navigation */
a:focus,
button:focus,
input:focus,
textarea:focus,
select:focus {
  outline: 3px solid #0d6efd;
  outline-offset: 2px;
}

.comment-form input:focus,
.comment-form textarea:focus {
  border-color: #0d6efd;
  box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

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

/* Loading state */
.spinner-border-sm {
  width: 1rem;
  height: 1rem;
  border-width: 0.15em;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .hero-section {
    min-height: 400px;
    text-align: center;
  }
  
  .display-3 {
    font-size: 2.5rem;
  }
  
  .feature-icon {
    font-size: 2.5rem;
  }
  
  .comments-list {
    max-height: 150px;
  }
}

/* Animation for new comments */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.comment-item {
  animation: fadeIn 0.3s ease;
}