/* Updated CSS for NCC Website */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Arial', sans-serif;
  line-height: 1.6;
  color: #333;
  background: #f5f5f5;
}

/* Header Styles */
header {
  background: linear-gradient(135deg, rgba(15, 52, 96, 0.95), rgba(25, 42, 86, 0.95));
  color: white;
  padding: 15px 0;
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 1000;
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}

.header-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
}

.logo-section {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-img {
  height: 50px !important;
}

.logo {
  width: 50px;
  height: 50px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 16px;
  color: white;
}

.logo-text h1 {
  font-size: 1.4rem;
  margin-bottom: 2px;
  font-weight: 600;
}

.logo-text p {
  font-size: 0.75rem;
  opacity: 0.9;
  color: #ffd700;
}

/* Navigation Styles */
nav {
  display: flex;
  gap: 8px;
}

nav a {
  color: white;
  text-decoration: none;
  font-weight: 500;
  padding: 10px 18px;
  border-radius: 6px;
  transition: all 0.3s ease;
  position: relative;
  font-size: 0.9rem;
}

nav a:hover, nav a.active {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-1px);
}

/* Mobile Menu */
.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 5px;
}

.mobile-nav {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  background: rgba(15, 52, 96, 0.98);
  padding: 20px;
  backdrop-filter: blur(15px);
}

.mobile-nav.active {
  display: block;
}

.mobile-nav a {
  display: block;
  padding: 12px 0;
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  color: white;
}

/* Main Content */
main {
  margin-top: 0; /* Remove margin to make carousel full viewport */
}

/* Hero Section */
.hero {
  position: relative;
  height: 100vh; /* Full viewport height */
  width: 100vw; /* Full viewport width */
  margin-left: calc(50% - 50vw); /* Center and expand beyond container */
  padding-top: 80px; /* Reduced padding since we're centering content */
  overflow: hidden;
  background: linear-gradient(rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.4)), 
              url('images/hero_section/1.JPG');
  background-size: cover;
  background-position: center center;
  background-attachment: scroll;
  background-repeat: no-repeat;
  display: flex;
  align-items: center; /* Changed back to center for vertical centering */
  justify-content: center;
  text-align: center;
  color: white;
  box-sizing: border-box; /* Ensure padding is included in height calculation */
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(15, 52, 96, 0.5), rgba(25, 42, 86, 0.4));
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 900px;
  margin: 0 auto; /* Removed top margin since content is now centered */
  padding: 0 20px;
}

.hero-content h2 {
  font-size: 3.5rem;
  margin-bottom: 20px;
  font-weight: 700;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
  letter-spacing: 2px;
  line-height: 1.2;
}

.hero-content p {
  font-size: 1.3rem;
  opacity: 0.95;
  line-height: 1.6;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.7);
}

/* Mobile responsiveness for hero section */
@media (max-width: 768px) {
  main {
    margin-top: 0; /* Keep consistent with desktop */
  }
  
  .hero {
    height: 70vh; /* Reduced height on mobile */
    width: 100vw;
    margin-left: calc(50% - 50vw); /* Keep full width */
    padding-top: 70px; /* Reduced padding for mobile */
    min-height: 400px;
    background-attachment: scroll !important;
    background-size: cover !important;
    background-position: center center !important;
    background-repeat: no-repeat !important;
    align-items: center; /* Ensure mobile also centers content */
  }
  
  .hero-content {
    padding: 0 15px;
    margin: 0 auto; /* Center content on mobile */
  }
  
  .hero-content h2 {
    font-size: 2.2rem;
    line-height: 1.1;
    margin-bottom: 15px;
  }
  
  .hero-content p {
    font-size: 1rem;
    line-height: 1.4;
  }
}

/* Page Header */
.page-header {
  background: linear-gradient(135deg, #1e293b, #334155);
  color: white;
  text-align: center;
  padding: 40px 20px;
  margin-top: 80px; /* Add margin to account for fixed navbar */
}

.page-header h1 {
  font-size: 2.5rem;
  margin-bottom: 10px;
  font-weight: 700;
}

.page-header p {
  font-size: 1.1rem;
  opacity: 0.9;
}

/* Content Sections */
.content-section {
  padding: 60px 20px;
  background: #f8fafc;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
}

.section-header {
  text-align: center;
  margin-bottom: 50px;
}

.section-header h3 {
  font-size: 2.2rem;
  color: #1e293b;
  margin-bottom: 15px;
  font-weight: 700;
}

.section-header::after {
  content: '';
  display: block;
  width: 80px;
  height: 4px;
  background: linear-gradient(45deg, #ff6b35, #f7931e);
  margin: 20px auto;
  border-radius: 2px;
}

.section-header p {
  font-size: 1.1rem;
  color: #64748b;
  max-width: 600px;
  margin: 0 auto;
}

/* About Content */
.about-content {
  max-width: 900px;
  margin: 0 auto;
}

.about-text {
  background: white;
  padding: 40px;
  border-radius: 12px;
  box-shadow: 0 5px 25px rgba(0, 0, 0, 0.08);
  border: 1px solid #e2e8f0;
}

.about-text p {
  font-size: 1.1rem;
  line-height: 1.7;
  color: #374151;
  margin-bottom: 20px;
  text-align: justify;
}

.about-text p:last-child {
  margin-bottom: 0;
}

/* Officers Grid */
.officers-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr); /* Exactly 3 cards per row */
  gap: 30px;
  max-width: 900px; /* Increased to accommodate 3 cards */
  margin: 0 auto; /* Same centering as cadets */
  margin-top: 40px;
}

.officer-card {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 5px 25px rgba(0, 0, 0, 0.08);
  border: 1px solid #e2e8f0;
  transition: all 0.3s ease;
  height: 350px; /* Same as cadet cards */
  width: 100%;
  max-width: 280px; /* Same as cadet cards */
  margin: 0 auto; /* Same centering */
}

.officer-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

.officer-photo {
  position: relative;
  height: 100%; /* Full height like cadets */
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Same photo sizing as cadets - fill entire card without white spaces */
.officer-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover; /* Same as cadets - fill entire card */
  object-position: center top; /* Same as cadets - focus on upper body/face */
}

.photo-placeholder {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: none;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 1rem;
}

/* Overlay for officer details - same as cadets */
.officer-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 75%; /* Same as cadets */
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.85) 0%,
    rgba(0, 0, 0, 0.6) 50%,
    rgba(0, 0, 0, 0.3) 80%,
    rgba(0, 0, 0, 0) 100%
  );
  transform: translateY(100%);
  transition: transform 0.4s ease;
  display: flex;
  align-items: flex-end;
  padding: 20px;
}

.officer-card:hover .officer-overlay {
  transform: translateY(0);
}

.officer-details {
  color: white;
  text-align: left;
  width: 100%;
}

.officer-details h4 {
  font-size: 1.3rem;
  margin-bottom: 8px;
  font-weight: 700;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.officer-details .officer-name {
  color: #ff6b35;
  font-weight: 600;
  margin-bottom: 5px;
  font-size: 1rem;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.officer-details .officer-rank {
  color: #e2e8f0;
  font-size: 0.9rem;
  margin-bottom: 8px;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.officer-details .officer-description {
  color: #cbd5e1;
  font-size: 0.85rem;
  font-style: italic;
  line-height: 1.4;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

/* Remove the old officer-info styling since we're using overlay now */
.officer-info {
  display: none;
}

/* Cadets Grid */
.cadets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); /* Slightly wider for officer photos */
  gap: 30px;
  max-width: 700px; /* Adjusted for better layout */
  margin: 0 auto;
}

.cadet-card {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 5px 25px rgba(0, 0, 0, 0.08);
  border: 1px solid #e2e8f0;
  transition: all 0.3s ease;
  height: 350px; /* Taller for officer photos (head to stomach) */
  width: 100%;
  max-width: 280px; /* Adjusted width for officer photos */
  margin: 0 auto; /* Center the cards */
}

.cadet-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

.cadet-photo {
  position: relative;
  height: 100%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Passport photo sizing - fill entire card without white spaces */
.cadet-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover; /* Fill entire card, slight cropping if needed to avoid white spaces */
  object-position: center top; /* Focus on upper body/face area for officer photos */
}

/* Remove the complex aspect-ratio and fallback code */

/* Photo placeholder styling for cadets */
.cadet-photo .photo-placeholder {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: none;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 1rem;
}

/* Overlay for cadet details */
.cadet-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 75%; /* Covers 75% of the photo */
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.85) 0%,
    rgba(0, 0, 0, 0.6) 50%,
    rgba(0, 0, 0, 0.3) 80%,
    rgba(0, 0, 0, 0) 100%
  );
  transform: translateY(100%);
  transition: transform 0.4s ease;
  display: flex;
  align-items: flex-end;
  padding: 20px;
}

.cadet-card:hover .cadet-overlay {
  transform: translateY(0);
}

.cadet-details {
  color: white;
  text-align: left;
  width: 100%;
}

.cadet-details h4 {
  font-size: 1.3rem;
  margin-bottom: 8px;
  font-weight: 700;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.cadet-details .cadet-rank {
  color: #ff6b35;
  font-weight: 600;
  margin-bottom: 5px;
  font-size: 1rem;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.cadet-details .cadet-branch {
  color:  #ff6b35;
  font-size: 0.9rem;
  margin-bottom: 8px;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.cadet-details .cadet-description {
  color: #cbd5e1;
  font-size: 0.85rem;
  font-style: italic;
  line-height: 1.4;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

/* Remove the old cadet-info styling since we're using overlay now */
.cadet-info {
  display: none;
}

/* Training Grid */
.training-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 30px;
  margin-top: 40px;
}

.training-category {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 5px 25px rgba(0, 0, 0, 0.08);
  border: 1px solid #e2e8f0;
  transition: all 0.3s ease;
  cursor: pointer;
}

.training-category:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

.training-photo {
  position: relative;
  height: 200px;
  overflow: hidden;
}

.training-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Click overlay for training cards */
.click-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  color: white;
  font-weight: 600;
  font-size: 1rem;
}

.training-category:hover .click-overlay {
  opacity: 1;
}

.training-info {
  padding: 25px;
}

.training-info h4 {
  font-size: 1.3rem;
  color: #1e293b;
  margin-bottom: 15px;
  font-weight: 600;
}

.training-info p {
  color: #64748b;
  line-height: 1.6;
}

/* Mobile Gallery Button */
.mobile-gallery-btn {
  display: none; /* Hidden on desktop */
  width: 100%;
  padding: 12px 20px;
  margin-top: 15px;
  background: #4f46e5;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.mobile-gallery-btn:hover {
  background: #4338ca;
  transform: translateY(-1px);
}

.mobile-gallery-btn:active {
  transform: translateY(0);
}

/* Schedule Grid */
.schedule-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 25px;
  margin-top: 40px;
}

.schedule-card {
  background: white;
  padding: 25px;
  border-radius: 12px;
  box-shadow: 0 5px 25px rgba(0, 0, 0, 0.08);
  border: 1px solid #e2e8f0;
  text-align: center;
  transition: all 0.3s ease;
}

.schedule-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
}

.schedule-card.special {
  border-left: 5px solid #ff6b35;
}

.schedule-day {
  font-size: 1.3rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 10px;
}

.schedule-time {
  font-size: 1.1rem;
  color: #ff6b35;
  font-weight: 600;
  margin-bottom: 10px;
}

.schedule-activity {
  font-size: 1rem;
  color: #374151;
  margin-bottom: 8px;
}

.schedule-venue {
  font-size: 0.9rem;
  color: #64748b;
  font-style: italic;
}

/* Events Timeline */
.events-timeline {
  margin-top: 40px;
}

.event-item {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 5px 25px rgba(0, 0, 0, 0.08);
  border: 1px solid #e2e8f0;
  margin-bottom: 30px;
  display: flex;
  flex-direction: row;
  transition: all 0.3s ease;
}

.event-item:hover {
  transform: translateX(5px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
}

.event-photo {
  width: 200px;
  height: 150px;
  flex-shrink: 0;
}

.event-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.event-info {
  padding: 25px;
  flex-grow: 1;
}

.event-date {
  color: #ff6b35;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 8px;
}

.event-info h4 {
  font-size: 1.3rem;
  color: #1e293b;
  margin-bottom: 10px;
  font-weight: 600;
}

.event-info p {
  color: #64748b;
  line-height: 1.6;
}

/* Achievers Page Styles */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 25px;
  margin-top: 40px;
}

.stat-card {
  background: white;
  padding: 30px 20px;
  border-radius: 12px;
  text-align: center;
  box-shadow: 0 5px 25px rgba(0, 0, 0, 0.08);
  border: 1px solid #e2e8f0;
  transition: all 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

.stat-number {
  font-size: 3rem;
  font-weight: 700;
  color: #ff6b35;
  margin-bottom: 10px;
}

.stat-label {
  font-size: 1rem;
  color: #64748b;
  font-weight: 500;
}

.achievers-grid {
  margin-top: 40px;
}

.service-section {
  margin-bottom: 50px;
}

.service-title {
  font-size: 1.5rem;
  color: #1e293b;
  margin-bottom: 25px;
  padding: 15px 0;
  border-bottom: 3px solid #ff6b35;
  display: flex;
  align-items: center;
  gap: 10px;
}

.service-icon {
  font-size: 1.8rem;
}

.achiever-card {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 5px 25px rgba(0, 0, 0, 0.08);
  border: 1px solid #e2e8f0;
  margin-bottom: 20px;
  display: flex;
  flex-direction: row;
  transition: all 0.3s ease;
}

.achiever-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
}

.achiever-photo {
  width: 120px;
  height: 120px;
  flex-shrink: 0;
}

.achiever-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.achiever-info {
  padding: 20px;
  flex-grow: 1;
}

.achiever-info h5 {
  font-size: 1.2rem;
  color: #1e293b;
  margin-bottom: 8px;
  font-weight: 600;
}

.achiever-rank {
  color: #ff6b35;
  font-weight: 600;
  margin-bottom: 5px;
}

.achiever-batch {
  color: #64748b;
  font-size: 0.9rem;
  margin-bottom: 5px;
}

.achiever-branch {
  color: #64748b;
  font-size: 0.9rem;
}

/* Success Stories */
.success-stories {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 30px;
  margin-top: 40px;
}

.story-card {
  background: white;
  padding: 30px;
  border-radius: 12px;
  box-shadow: 0 5px 25px rgba(0, 0, 0, 0.08);
  border: 1px solid #e2e8f0;
  position: relative;
  transition: all 0.3s ease;
}

.story-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

.quote-mark {
  font-size: 4rem;
  color: #ff6b35;
  opacity: 0.3;
  position: absolute;
  top: 10px;
  left: 20px;
  font-family: serif;
}

.story-content p {
  color: #374151;
  line-height: 1.7;
  font-style: italic;
  margin-bottom: 20px;
  position: relative;
  z-index: 2;
}

.story-author {
  text-align: right;
  color: #64748b;
}

.story-author strong {
  color: #1e293b;
}

/* Message Section */
.message-section {
  max-width: 900px;
  margin: 0 auto;
}

.message-content {
  background: white;
  padding: 40px;
  border-radius: 12px;
  box-shadow: 0 5px 25px rgba(0, 0, 0, 0.08);
  border: 1px solid #e2e8f0;
}

.message-content p {
  font-size: 1.1rem;
  line-height: 1.7;
  color: #374151;
  margin-bottom: 20px;
}

.contact-info {
  margin-top: 30px;
  padding-top: 20px;
  border-top: 2px solid #f1f5f9;
}

.contact-info h4 {
  color: #1e293b;
  margin-bottom: 10px;
}

.contact-info p {
  color: #64748b;
  margin-bottom: 0;
}

/* Footer */
footer {
  background: #1e293b;
  color: #94a3b8;
  padding: 60px 20px 30px;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
}

.footer-nav {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 40px;
  margin-bottom: 40px;
}

.footer-nav a {
  color: #94a3b8;
  text-decoration: none;
  font-size: 1rem;
  font-weight: 500;
  transition: color 0.3s ease;
  position: relative;
}

.footer-nav a:hover {
  color: #f1f5f9;
}

.footer-social {
  display: flex;
  justify-content: center;
  gap: 30px;
  margin-bottom: 20px;
}

.social-link {
  color: #94a3b8;
  transition: all 0.3s ease;
  padding: 10px;
  border-radius: 8px;
}

.social-link:hover {
  color: #f1f5f9;
  background: rgba(148, 163, 184, 0.1);
  transform: translateY(-2px);
}

.footer-copyright {
  border-top: 1px solid #334155;
  padding-top: 30px;
}

.footer-copyright p {
  margin: 0;
  font-size: 0.95rem;
  color: #64748b;
}

/* Join NCC Button */
.join-ncc-btn {
  background: linear-gradient(90deg, #ff416c 0%, #ff4b2b 100%);
  color: #fff;
  border: none;
  border-radius: 40px;
  padding: 18px 40px;
  font-size: 1.1rem;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(255,65,108,0.15);
  transition: background 0.3s, transform 0.2s;
  margin-top: 30px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.join-ncc-btn:hover {
  background: linear-gradient(90deg, #ff4b2b 0%, #ff416c 100%);
  transform: scale(1.05);
}

/* Responsive Design */
@media (max-width: 768px) {
  header {
    padding: 10px 0;
  }

  .header-content {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    padding: 0 20px;
  }

  .logo {
    width: 40px;
    height: 40px;
  }
  
  .logo-img {
    height: 40px !important;
  }
  
  .logo-section {
    justify-content: center;
    flex: 1;
  }
  
  nav {
    display: none;
  }

  .mobile-menu-btn {
    display: block;
    position: relative;
    top: auto;
    right: auto;
    margin-left: 10px;
    flex-shrink: 0;
  }

  /* Main margin is handled by hero carousel mobile section */

  .hero {
    padding: 60px 20px 40px;
    background-attachment: scroll;
  }

  .hero h2 {
    font-size: 2.2rem;
  }

  .hero p {
    font-size: 1.1rem;
  }

  .page-header {
    margin-top: 70px; /* Adjust for mobile navbar height */
  }

  .page-header h1 {
    font-size: 2rem;
  }

  .section-header h3 {
    font-size: 1.8rem;
  }

  .officers-grid,
  .training-grid,
  .schedule-grid,
  .stats-grid,
  .success-stories {
    grid-template-columns: 1fr;
  }

  /* Show mobile gallery buttons on mobile */
  .mobile-gallery-btn {
    display: block !important;
  }

  /* Hide click overlay on mobile */
  .click-overlay {
    display: none !important;
  }

  .officer-card {
    height: auto; /* Auto height to accommodate info below */
    max-width: 260px; /* Same as cadet mobile width */
  }

  .officer-overlay {
    padding: 15px; /* Same as cadet mobile padding */
  }

  .officer-details h4 {
    font-size: 1.1rem;
  }

  .officer-details .officer-name {
    font-size: 0.9rem;
  }

  .officer-details .officer-rank {
    font-size: 0.8rem;
  }

  .officer-details .officer-description {
    font-size: 0.8rem;
  }

  .cadets-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .cadet-card {
    height: auto; /* Auto height to accommodate info below */
    max-width: 260px; /* Adjusted mobile width */
  }

  .cadet-overlay {
    padding: 15px;
  }

  .cadet-details h4 {
    font-size: 1.1rem;
  }

  .cadet-details .cadet-rank {
    font-size: 0.9rem;
  }

  .cadet-details .cadet-branch {
    font-size: 0.8rem;
  }

  .cadet-details .cadet-description {
    font-size: 0.8rem;
  }

  /* Photo Placeholder Mobile Styling */
  .photo-placeholder {
    font-size: 0.9rem;
    font-weight: 600;
  }

  .cadet-photo .photo-placeholder,
  .officer-photo .photo-placeholder,
  .achiever-photo .photo-placeholder {
    font-size: 0.9rem;
    font-weight: 600;
  }

  .blog-photo .photo-placeholder {
    font-size: 1rem;
    font-weight: 600;
  }

  /* Ensure photo placeholders are properly positioned on mobile */
  .officer-photo,
  .cadet-photo,
  .achiever-photo,
  .blog-photo {
    position: relative;
  }

  .officer-photo .photo-placeholder,
  .cadet-photo .photo-placeholder,
  .achiever-photo .photo-placeholder {
    display: flex !important;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
  }

  /* Hide overlay animations on mobile, show names below */
  .officer-overlay,
  .cadet-overlay {
    display: none !important;
  }

  /* Officer info below photo for mobile */
  .officer-info {
    display: block !important;
    text-align: center;
    margin-top: 15px;
    padding: 0 10px;
  }

  .officer-photo {
    height: 320px; /* Fixed height for photo section */
  }

  .officer-info h4 {
    font-size: 1.1rem;
    margin-bottom: 5px;
    font-weight: 700;
    color: #1e293b;
  }

  .officer-info .officer-rank {
    color: #ff6b35;
    font-weight: 600;
    font-size: 0.9rem;
    margin: 0;
  }

  /* Cadet info below photo for mobile */
  .cadet-info {
    display: block !important;
    text-align: center;
    margin-top: 15px;
    padding: 0 10px;
  }

  .cadet-photo {
    height: 320px; /* Fixed height for photo section */
  }

  .cadet-info h4 {
    font-size: 1.1rem;
    margin-bottom: 5px;
    font-weight: 700;
    color: #1e293b;
  }

  .cadet-info .cadet-rank {
    color: #ff6b35;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 3px;
  }

  .cadet-info .cadet-branch {
    color: #ff6b35;
    font-size: 0.85rem;
    margin: 0;
  }

  .event-item,
  .achiever-card {
    flex-direction: column;
  }

  .event-photo,
  .achiever-photo {
    width: 100%;
    height: 200px;
  }

  .footer-nav {
    flex-direction: column;
    gap: 25px;
    margin-bottom: 30px;
  }
  
  .footer-social {
    gap: 25px;
    margin-bottom: 30px;
  }
  
  .footer-copyright {
    padding-top: 20px;
  }

  .about-text {
    padding: 25px;
  }

  .message-content {
    padding: 25px;
  }
}

@media (max-width: 480px) {
  .hero h2 {
    font-size: 1.8rem;
  }

  .page-header h1 {
    font-size: 1.6rem;
  }

  .section-header h3 {
    font-size: 1.6rem;
  }

  .content-section {
    padding: 40px 15px;
  }

  .about-text,
  .message-content {
    padding: 20px;
  }

  .officer-info,
  .training-info {
    padding: 20px;
  }

  .story-card {
    padding: 20px;
  }

  .logo-text h1 {
    font-size: 1.2rem;
  }
}

/* Animation Classes */
.fade-in {
  animation: fadeIn 0.8s ease-in;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.slide-up {
  animation: slideUp 0.6s ease-out;
}

/* Training Photo Carousel */
.carousel-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(5px);
}

.carousel-container {
  background: white;
  border-radius: 15px;
  width: 90%;
  max-width: 900px;
  max-height: 90%;
  overflow: hidden;
  position: relative;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
}

.carousel-header {
  background: #1e293b;
  color: white;
  padding: 20px 25px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.carousel-header h3 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
}

.close-carousel {
  background: none;
  border: none;
  color: white;
  font-size: 2rem;
  cursor: pointer;
  padding: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.3s ease;
}

.close-carousel:hover {
  background: rgba(255, 255, 255, 0.2);
}

.carousel-content {
  padding: 0;
}

.carousel-slide-container {
  position: relative;
  height: 600px; /* balanced height for photos */
  overflow: hidden;
}

.carousel-slides {
  display: flex;
  transition: transform 0.5s ease;
  height: 100%;
}

.carousel-slide {
  min-width: 100%;
  height: 100%;
  display: flex;
  /* align to top so image uses available vertical space without centering gap */
  align-items:center;
  justify-content: center;
  background: #f8f9fa;
  padding: 0; /* no padding to maximize image area */
}

.carousel-slide img {
  /* prefer filling the slide vertically to avoid top/bottom gaps */
  height: 100%;
  width: auto; /* preserve aspect ratio */
  max-width: 100%;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.carousel-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.6);
  color: white;
  border: none;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  z-index: 10;
}

.carousel-nav:hover {
  background: rgba(0, 0, 0, 0.8);
  transform: translateY(-50%) scale(1.1);
}

.carousel-prev {
  left: 15px;
}

.carousel-next {
  right: 15px;
}

.carousel-indicators {
  display: flex;
  justify-content: center;
  padding: 20px;
  gap: 10px;
  background: white;
}

.carousel-indicator {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #cbd5e1;
  cursor: pointer;
  transition: all 0.3s ease;
}

.carousel-indicator.active {
  background: #667eea;
  transform: scale(1.2);
}

.carousel-indicator:hover {
  background: #94a3b8;
}

/* Carousel placeholder for missing images */
.carousel-slide .image-placeholder {
  width: 90%; /* Increased to match image sizing */
  height: 80%; /* Large but not overwhelming */
  max-width: 800px; /* Increased maximum */
  max-height: 550px; /* Increased maximum */
  background: #1e293b;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  border-radius: 8px;
  text-align: center;
  padding: 30px;
  font-size: 1.1rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

/* Mobile responsive */
@media (max-width: 768px) {
  .carousel-container {
    width: 95%;
    max-height: 85%;
  }
  
  .carousel-header {
    padding: 15px 20px;
  }
  
  .carousel-header h3 {
    font-size: 1.2rem;
  }
  
  .carousel-slide-container {
    height: 420px; /* mobile height tuned for phones */
  }

  .carousel-slide {
    padding: 0; /* no padding on mobile */
    align-items: center; /* keep consistent top alignment */
  }

  .carousel-slide img {
    height: 100%;
    width: auto;
    max-width: 100%;
  }

  .carousel-slide .image-placeholder {
    width: 90%;
    height: 80%;
    max-width: 420px;
    max-height: 340px;
    font-size: 1rem;
    padding: 18px;
  }
  
  .carousel-nav {
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
  }
  
  .carousel-prev {
    left: 10px;
  }
  
  .carousel-next {
    right: 10px;
  }
  
  .carousel-indicators {
    padding: 15px;
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Scroll animations */
.scroll-fade {
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.6s ease;
}

.scroll-fade.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Blog Card Styles */
.blog-card {
  display: flex;
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  border: 1px solid #e2e8f0;
  max-width: 1000px;
  margin: 0 auto;
}

.blog-photo-section {
  width: 280px;
  flex-shrink: 0;
  padding: 20px;
  display: flex;
  flex-direction: column;
}

.blog-photo {
  width: 100%;
  height: 300px;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 15px;
}

.blog-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: relative;
}

.blog-photo .photo-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: none;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 1rem;
  position: relative;
}

.blog-photo-section .officer-info {
  text-align: center;
  display: block !important;
}

.blog-photo-section .officer-info h4 {
  font-size: 1.1rem;
  margin-bottom: 5px;
  font-weight: 700;
  color: #1e293b;
}

.blog-photo-section .officer-info .officer-rank {
  color: #ff6b35;
  font-weight: 600;
  font-size: 0.9rem;
  margin: 0;
}

.blog-content {
  flex: 1;
  padding: 30px;
  display: flex;
  flex-direction: column;
}

.blog-meta {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 15px;
}

.blog-date {
  color: #64748b;
  font-size: 0.9rem;
  font-weight: 500;
}

.blog-category {
  background: #e2e8f0;
  color: #475569;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
}

.blog-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 15px;
  line-height: 1.3;
}

.blog-excerpt {
  font-size: 1rem;
  line-height: 1.6;
  color: #475569;
  margin-bottom: 15px;
  text-align: justify;
}

.blog-text {
  font-size: 1rem;
  line-height: 1.6;
  color: #64748b;
  margin-bottom: 20px;
  text-align: justify
}

.blog-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  padding-top: 15px;
  border-top: 1px solid #e2e8f0;
}

.read-time {
  color: #64748b;
  font-size: 0.9rem;
}

.source-attribution {
  color: #64748b;
  font-size: 0.85rem;
  font-style: italic;
}

.read-more {
  color: #4f46e5;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  transition: color 0.3s ease;
}

.read-more:hover {
  color: #4338ca;
}

/* Read More Button Styles */
.read-more-btn {
  background: linear-gradient(135deg, #4f46e5, #4338ca);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 10px 20px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 15px;
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.2);
  display: none; /* Hidden by default on desktop */
}

.read-more-btn:hover {
  background: linear-gradient(135deg, #4338ca, #3730a3);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.read-more-btn:active {
  transform: translateY(0);
}

.blog-text-preview {
  margin-bottom: 0;
}

.blog-text-full {
  animation: fadeIn 0.3s ease-in-out;
}

/* Desktop: Show all content, hide preview and button */
@media (min-width: 769px) {
  .blog-text-preview {
    display: none !important;
  }
  
  .blog-text-full {
    display: block !important;
  }
  
  .read-more-btn {
    display: none !important;
  }

  /* Hide officer and cadet info on desktop - use overlays instead */
  .officer-info,
  .cadet-info {
    display: none !important;
  }

  /* About sections: show full content on desktop */
  .about-text-preview {
    display: none !important;
  }
  
  .about-text-full {
    display: block !important;
  }
  
  .about-text-container .read-more-btn {
    display: none !important;
  }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Mobile Responsive for Blog Card */
@media (max-width: 768px) {
  .blog-card {
    flex-direction: column;
    margin: 0 20px;
    max-width: calc(100vw - 40px);
  }
  
  .blog-photo-section {
    width: 100%;
    align-items: center;
    padding: 20px;
    display: flex;
    flex-direction: column;
  }
  
  .blog-photo {
    width: 280px;
    height: 320px;
    max-width: 260px;
    border-radius: 12px;
    overflow: hidden;
    margin: 0 auto;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .blog-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
  }
  
  .blog-photo .photo-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 600;
    font-size: 1rem;
  }
  
  .officer-info {
    margin-top: 15px;
    text-align: center;
  }
  
  .blog-content {
    padding: 20px;
  }
  
  .blog-title {
    font-size: 1.4rem;
  }
  
  .blog-footer {
    flex-direction: column;
    gap: 10px;
    align-items: flex-start;
  }

  /* Read More functionality only on mobile */
  .read-more-btn {
    display: block;
  }

  /* About sections read more functionality on mobile */
  .about-text-container .read-more-btn {
    display: block;
  }

  .about-text-preview {
    margin-bottom: 0;
  }

  .about-text-full {
    animation: fadeIn 0.3s ease-in-out;
  }
}

@media (max-width: 480px) {
  .blog-card {
    margin: 0 15px;
    max-width: calc(100vw - 30px);
  }
  
  .blog-photo-section {
    padding: 15px;
  }
  
  .blog-photo {
    width: 260px;
    height: 320px;
    max-width: 240px;
  }
  
  .officer-info {
    margin-top: 10px;
  }
  
  .officer-info h4 {
    font-size: 1.1rem;
  }
  
  .officer-info .officer-rank {
    font-size: 0.9rem;
  }
  
  .blog-content {
    padding: 15px;
  }
  
  .blog-title {
    font-size: 1.3rem;
  }
}
