/* Modern CSS Reset and Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: #333;
  background: linear-gradient(135deg, #2c5530, #3d6b47);
  overflow-x: hidden;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.2;
  margin-bottom: 1rem;
}

h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  color: white;
}

h2 {
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  color: white;
}

h3 {
  font-size: clamp(1.25rem, 3vw, 2rem);
  color: white;
}

h4 {
  font-size: clamp(1.1rem, 2.5vw, 1.5rem);
  color: white;
}

p {
  font-size: clamp(1rem, 2vw, 1.1rem);
  margin-bottom: 1rem;
  color: rgba(255,255,255,0.9);
}

/* Navigation */
.navbar {
  background: linear-gradient(135deg, #1a3d1f, #2c5530) !important;
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
  padding: 1rem 0;
}

.navbar-brand {
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff !important;
}

.nav-link {
  color: #fff !important;
  font-weight: 500;
  padding: 0.5rem 1rem !important;
  transition: all 0.3s ease;
  border-radius: 5px;
  margin: 0 0.25rem;
}

.nav-link:hover {
  background-color: rgba(255,255,255,0.1);
  transform: translateY(-2px);
}

/* Hero Section */
.hero {
  background: linear-gradient(135deg, #2c5530, #3d6b47);
  padding: 3rem 0;
  display: flex;
  align-items: center;
}

.hero-content {
  text-align: center;
  color: white;
}

.hero h1 {
  color: white;
  margin-bottom: 2rem;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
  font-weight: 700;
}

.hero h4 {
  color: white;
  font-weight: 300;
  line-height: 1.8;
  max-width: 900px;
  margin: 0 auto;
  text-shadow: 1px 1px 3px rgba(0,0,0,0.5);
  font-size: 1.2rem;
}

/* Carousel Improvements */
.carousel {
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
  margin: 1rem 0;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.carousel-item img {
  object-fit: cover;
  height: 400px;
  width: 100%;
}

.carousel-control-prev,
.carousel-control-next {
  width: 5%;
  background: rgba(0,0,0,0.3);
  border-radius: 50%;
  margin: 0 1rem;
}

.carousel-control-prev:hover,
.carousel-control-next:hover {
  background: rgba(0,0,0,0.5);
}

/* Content Sections */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

section {
  padding: 2rem 0;
}

/* About Me Page Specific */
.hero-image img {
  border-radius: 15px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
  max-width: 100%;
  height: auto;
  margin: 1rem 0;
}

/* Gallery Grid */
.gallery-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin: 2rem 0;
  padding: 0 1rem;
  justify-content: center;
  max-width: 1000px;
  margin-left: auto;
  margin-right: auto;
}

.gallery-item {
  flex: 0 0 calc(33.333% - 1rem);
  max-width: 300px;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 8px 25px rgba(0,0,0,0.3);
  transition: all 0.4s ease;
  background: linear-gradient(135deg, #1a3d1f, #2c5530);
  position: relative;
  display: inline-block;
  max-height: 300px;
}

/* For the last row with 2 items, center them */
.gallery-item:nth-child(6),
.gallery-item:nth-child(7) {
  flex: 0 0 calc(25% - 1rem);
}

.gallery-item:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 20px 40px rgba(0,0,0,0.4);
}

.gallery-item img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.4s ease;
}

.gallery-item:hover img {
  transform: scale(1.05);
}

/* Make only the second image taller */
.gallery-item:nth-child(2) {
  flex: 0 0 calc(33.333% - 1rem);
  max-width: 200px;
  max-height: 350px;
}

.gallery-item:nth-child(2) img {
  height: 300px;
  object-fit:  cover;
  object-position: top ;
}

/* Cards */
.card {
  border: none;
  border-radius: 15px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.3);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  margin-bottom: 2rem;
  background: linear-gradient(135deg, #1a3d1f, #2c5530);
  color: white;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 30px rgba(0,0,0,0.4);
}

.card-body {
  padding: 2rem;
  color: white;
}

.card-title {
  color: white !important;
}

.card-text {
  color: rgba(255,255,255,0.9) !important;
}

/* Buttons */
.btn {
  border-radius: 25px;
  padding: 0.75rem 2rem;
  font-weight: 600;
  transition: all 0.3s ease;
  border: none;
}

.btn-primary {
  background: linear-gradient(135deg, #4a7c59, #5a8a6a);
  color: white;
  border: 2px solid rgba(255,255,255,0.3);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #3d6b47, #4a7c59);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0,0,0,0.3);
  border: 2px solid rgba(255,255,255,0.5);
}

/* Footer */
footer {
  background: linear-gradient(135deg, #1a3d1f, #2c5530);
  color: white;
  text-align: center;
  padding: 2rem 0;
  margin-top: 2rem;
}

footer p {
  color: rgba(255,255,255,0.9);
  margin-bottom: 0.5rem;
}

/* Responsive Design */
@media (max-width: 768px) {
  .hero {
    padding: 2rem 0;
    min-height: 50vh;
  }
  
  .hero h1 {
    font-size: 2.2rem;
  }
  
  .hero h4 {
    font-size: 1.1rem;
    padding: 0 1rem;
  }
  
  .carousel-item img {
    height: 250px;
  }
  
  .carousel {
    margin: 1rem;
    max-width: calc(100% - 2rem);
  }
  
  .navbar-nav {
    text-align: center;
    margin-top: 1rem;
  }
  
  .nav-link {
    margin: 0.25rem 0;
  }
  
  section {
    padding: 2rem 0;
  }
  
  .gallery-grid {
    gap: 1rem;
    padding: 0 0.5rem;
    max-width: 100%;
  }
  
  .gallery-item {
    flex: 0 0 calc(50% - 0.5rem);
    max-width: 250px;
    max-height: 250px;
  }
  
  .gallery-item:nth-child(6),
  .gallery-item:nth-child(7) {
    flex: 0 0 calc(50% - 0.5rem);
  }
}

@media (max-width: 576px) {
  .container {
    padding: 0 0.5rem;
  }
  
  .hero {
    padding: 1.5rem 0;
  }
  
  .hero h1 {
    font-size: 1.8rem;
  }
  
  .hero h4 {
    font-size: 1rem;
    padding: 0 0.5rem;
  }
  
  .carousel-item img {
    height: 200px;
  }
  
  .carousel {
    margin: 0.5rem;
    max-width: calc(100% - 1rem);
  }
  
  .card-body {
    padding: 1rem;
  }
}

/* Utility Classes */
.text-center {
  text-align: center;
}

.mb-4 {
  margin-bottom: 2rem;
}

.mt-4 {
  margin-top: 2rem;
}

.py-5 {
  padding: 3rem 0;
}

/* Animation */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in-up {
  animation: fadeInUp 0.6s ease-out;
}

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

/* Focus states for accessibility */
.nav-link:focus,
.btn:focus {
  outline: 2px solid #fff;
  outline-offset: 2px;
}
