/* =============================
   Modern Achievements Page CSS
   (Final Responsive Version)
   ============================= */

/* ========== 1. GLOBAL STYLES & VARIABLES ========== */
:root {
  --color-primary: #2d2e83;
  --color-secondary: #4a90e2;
  --color-accent: #6B5DD3;
  --color-text: #1F2A63;
  --color-light: #f3f4f6;
  --color-white: #ffffff;

  /* Fluid Title Font Size */
  --font-size-hero: clamp(2rem, 6vw, 2.8rem);
  --font-size-section: clamp(1.8rem, 5vw, 2.2rem);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
body {
  font-family: 'Poppins', 'Inter', 'DM Sans', Arial, sans-serif;
  background: var(--color-light);
  color: var(--color-text);
  min-height: 100vh;
}


/* ========== 2. HEADER / NAVBAR ========== */
#header {
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  background: rgba(31, 42, 99, 0.92);
  box-shadow: 0 2px 12px rgba(31, 42, 99, 0.07);
  backdrop-filter: blur(5px);
}
.nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 1300px;
  margin: 0 auto;
  padding: 0 1rem;
  min-height: 4.5rem; /* Base height for header */
  position: relative;
}
.brand a {
  color: var(--color-light);
  font-size: 1.25rem;
  font-weight: 600;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2rem;
}
.jmd-logo {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--color-accent);
}
.club-name {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-light);
  opacity: 0.9;
}
/* Mobile menu is default */
.nav-list ul {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: var(--color-text);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    list-style: none;
    transform: translateY(-100%);
    opacity: 0;
    transition: transform 0.4s ease, opacity 0.4s ease;
    pointer-events: none;
    z-index: 1100;
}
.nav-list ul.active {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}
.nav-list ul a {
    font-size: 1.5rem;
    color: var(--color-light);
    font-weight: 500;
    text-transform: uppercase;
    text-decoration: none;
    padding: 1rem 2rem;
    display: block;
    border-bottom: 2.5px solid transparent;
    transition: color 0.2s, border-bottom-color 0.2s;
}
.hamburger {
  display: flex; /* Display hamburger on mobile by default */
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  background: none;
  border: none;
  cursor: pointer;
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1200;
}
.hamburger .bar {
  width: 1.8rem; height: 0.2rem; background-color: var(--color-light);
  border-radius: 2px; position: relative; transition: background-color 0.3s;
}
.hamburger .bar::before, .hamburger .bar::after {
  content: ''; position: absolute; left: 0; width: 100%; height: 100%;
  background-color: var(--color-light); border-radius: 2px;
  transition: transform 0.3s, top 0.3s;
}
.hamburger .bar::before { top: -0.6rem; }
.hamburger .bar::after { top: 0.6rem; }
.hamburger.active .bar { background-color: transparent; }
.hamburger.active .bar::before { transform: rotate(45deg); top: 0; }
.hamburger.active .bar::after { transform: rotate(-45deg); top: 0; }


/* ========== 3. HERO & STATS SECTION ========== */
.achievements-hero {
  padding: 6.5rem 1rem 2rem 1rem; /* Padding-top to clear fixed navbar */
  text-align: center;
}
.achievements-title {
  font-size: var(--font-size-hero);
  font-weight: 800;
  color: var(--color-text);
  margin-bottom: 0.5rem;
  border-bottom: 4px solid var(--color-accent);
  display: inline-block;
  padding-bottom: 0.2rem;
}
.hero-tagline {
  font-size: clamp(1rem, 3vw, 1.2rem);
  color: var(--color-accent);
  font-weight: 500;
  margin-bottom: 2.5rem;
}
.achievements-stats {
  display: flex;
  gap: 1rem;
  align-items: stretch; /* Make stats same height */
  justify-content: center;
  flex-wrap: wrap;
}
.stat {
  background: var(--color-white);
  box-shadow: 0 2px 12px rgba(31, 42, 99, 0.07);
  border-radius: 1.25rem;
  padding: 1rem 1.5rem;
  flex: 1 1 140px; /* Flex properties for better wrapping */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: box-shadow 0.2s, transform 0.2s;
}
.stat:hover {
  box-shadow: 0 6px 24px rgba(107, 93, 211, 0.13);
  transform: translateY(-4px);
}
.stat-number { font-size: clamp(1.8rem, 5vw, 2.2rem); font-weight: 700; }
.stat-label { font-size: clamp(0.85rem, 2vw, 1rem); color: var(--color-accent); font-weight: 500; }


/* ========== 4. TABS & MAIN CONTENT ========== */
.achievement-tabs {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin: 2rem 1rem;
  flex-wrap: wrap;
}
.tab-btn {
  background: var(--color-white);
  color: var(--color-primary);
  border: 1px solid #e0e0e0;
  border-radius: 2rem;
  padding: 0.7rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(44, 83, 100, 0.08);
  transition: all 0.2s ease-in-out;
}
.tab-btn.active, .tab-btn:focus {
  background: linear-gradient(90deg, var(--color-primary) 0%, var(--color-secondary) 100%);
  color: var(--color-white);
  transform: scale(1.05);
  border-color: transparent;
  box-shadow: 0 4px 16px rgba(45, 46, 131, 0.2);
}

/* ✅ CORRECTED RULE: Applied padding to <main> tag */
main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem; /* This creates the side margins on mobile */
}

.section-title {
  font-size: var(--font-size-section);
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 2rem;
  text-align: left;
}
.achievements-grid {
  display: grid;
  /* This one line makes the grid perfectly responsive */
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
}


/* ========== 5. ACHIEVEMENT CARD ========== */
.achievement-card {
  background: var(--color-white);
  border-radius: 1.5rem;
  box-shadow: 0 4px 32px rgba(45, 46, 131, 0.1);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s, box-shadow 0.2s;
}
.achievement-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 40px rgba(45, 46, 131, 0.15);
}
.blurred-bg-image-container {
  width: 100%;
  height: 200px;
  overflow: hidden;
  background-color: #e3e8f0;
}
.blurred-bg-image-container img {
  width: 100%; height: 100%; object-fit: cover; object-position: center; display: block;
}
.card-body { padding: 1.25rem; display: flex; flex-direction: column; flex-grow: 1; }
.card-body h3 { font-size: 1.2rem; font-weight: 700; line-height: 1.4; margin-bottom: 1rem; }
.card-details { list-style: none; margin-bottom: 1rem; }
.card-details li {
  font-size: 0.9rem; font-weight: 500; color: var(--color-secondary);
  margin-bottom: 0.5rem; display: flex; align-items: center; gap: 0.75rem;
}
.card-details .icon { width: 1.2rem; height: 1.2rem; color: var(--color-primary); flex-shrink: 0; }
.medals { display: flex; flex-direction: column; gap: 0.7rem; margin: 0.5rem 0 1rem 0; }
.medals span {
  font-size: 1rem; font-weight: 600; border-radius: 1rem;
  padding: 0.25rem 0.8rem; display: inline-flex; align-items: center; gap: 0.5rem;
}
.medals span img { height: 1.5rem; width: 1.5rem; }
.gold { background: linear-gradient(90deg, #ffe259, #ffa751); color: #7c5a00; }
.silver { background: linear-gradient(90deg, #e0eafc, #cfdef3); color: #5a6a7a; }
.bronze { background: linear-gradient(90deg, #f7b267, #e7745b); color: #7a3e00; }
.summary { font-size: 0.95rem; line-height: 1.6; margin-top: auto; opacity: 0.9; }


/* ========== 6. TAB LOGIC & FOOTER ========== */
.tab-content { display: none; animation: fadeIn 0.5s ease-in-out; }
.tab-content.active { display: block; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(15px); }
  to { opacity: 1; transform: translateY(0); }
}
/* ========== 7. IMAGE MODAL ========== */
.image-modal {
  display: none;
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(5px);
  animation: fadeIn 0.3s ease-in-out;
}

.modal-content {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 2rem;
}

.close-modal {
  position: absolute;
  top: 1rem;
  right: 2rem;
  color: var(--color-white);
  font-size: 3rem;
  font-weight: bold;
  cursor: pointer;
  z-index: 2001;
  transition: color 0.2s ease;
  background: rgba(0, 0, 0, 0.5);
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.close-modal:hover {
  color: var(--color-accent);
  background: rgba(0, 0, 0, 0.7);
}

.modal-image {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
  border-radius: 1rem;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  animation: zoomIn 0.3s ease-in-out;
  transition: opacity 0.3s ease;
  background-color: #f5f5f5;
}

@keyframes zoomIn {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Make card images clickable */
.blurred-bg-image-container {
  cursor: pointer;
  transition: transform 0.2s ease;
}

.blurred-bg-image-container:hover {
  transform: scale(1.02);
}

.blurred-bg-image-container img {
  pointer-events: none; /* Prevent double-click issues */
}

.footer {
  background: var(--color-primary);
  color: var(--color-white);
  text-align: center;
  padding: 2rem 1rem;
  margin-top: 3rem;
  border-radius: 2rem 2rem 0 0;
}

/*
==========================================================
   ✅ 7. RESPONSIVE MEDIA QUERIES (MOBILE-FIRST) ✅
==========================================================
*/

/* ========== TABLETS & SMALL LAPTOPS ========== */
@media (min-width: 768px) {
  .nav-bar {
    padding: 0 2.5rem;
    min-height: 5rem;
  }
  .achievements-hero {
    padding: 8rem 2.5rem 3rem 2.5rem;
  }
  /* ✅ CORRECTED RULE: Larger padding for bigger screens */
  main {
    padding: 0 2.5rem;
  }
  .hamburger {
    display: none; /* Hide hamburger on tablets and larger */
    position: static;
    right: auto;
    top: auto;
    transform: none;
  }
  /* Show desktop nav menu */
  .nav-list ul {
    position: static;
    flex-direction: row;
    align-items: center;
    gap: 2.2rem;
    width: auto;
    height: auto;
    background: transparent;
    transform: none;
    opacity: 1;
    pointer-events: auto;
    transition: none;
  }
  .nav-list ul a {
    font-size: 1rem;
    padding: 0.5rem 0;
  }
  .brand a {
    font-size: 1.5rem;
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
  }
  .jmd-logo {
    font-size: 2rem;
  }
  .club-name {
    font-size: 1.2rem;
  }
}

/* ========== LARGER DESKTOPS ========== */
@media (min-width: 1200px) {
  .achievements-grid {
    gap: 2rem;
  }
}