/* =========================
   Achievements Page CSS - Mobile Fixed
   ========================= */

* { box-sizing: border-box; }

/* ===== Hero ===== */
.achievements-hero {
  position: relative;
  background: linear-gradient(135deg, #062141 0%, #0a4d4d 100%);
  color: white;
  padding: 140px 25px 80px;
  text-align: center;
  overflow: hidden;
}

.hero-shapes { position: absolute; inset: 0; overflow: hidden; z-index: 0; }

.shape {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,0.05);
  animation: float 20s infinite ease-in-out;
}
.shape-1 { width:300px; height:300px; top:-100px; right:-60px; animation-delay:0s; }
.shape-2 { width:200px; height:200px; bottom:-50px; left:10%; animation-delay:6s; }
.shape-3 { width:150px; height:150px; top:50%; left:-30px; animation-delay:12s; }

@keyframes float {
  0%,100% { transform:translateY(0) rotate(0deg); opacity:0.3; }
  50%      { transform:translateY(-30px) rotate(180deg); opacity:0.6; }
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 900px;
  margin: 0 auto;
}

.hero-icon {
  font-size: 70px;
  margin-bottom: 22px;
  animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
  0%,100% { transform:translateY(0) scale(1); }
  50%     { transform:translateY(-15px) scale(1.1); }
}

.achievements-hero h1 {
  font-size: 48px;
  font-weight: 800;
  margin-bottom: 18px;
  text-shadow: 0 2px 12px rgba(0,0,0,0.25);
  letter-spacing: -0.5px;
}

.achievements-hero p {
  font-size: 19px;
  line-height: 1.8;
  opacity: 0.92;
  max-width: 750px;
  margin: 0 auto;
}

/* ===== Stats ===== */
.stats-overview {
  padding: 60px 20px;
  background: #f8f9fa;
  margin-top: -40px;
  position: relative;
  z-index: 2;
}

.stats-container {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 25px;
}

.stat-box {
  background: white;
  padding: 35px 25px;
  border-radius: 18px;
  text-align: center;
  box-shadow: 0 8px 25px rgba(0,0,0,0.08);
  transition: transform 0.3s ease, box-shadow 0.3s ease, opacity 0.5s ease;
  border: 1px solid rgba(6,33,65,0.08);
  opacity: 0;
  transform: translateY(30px);
}

.stat-box.visible {
  opacity: 1;
  transform: translateY(0);
}

.stat-box:hover {
  transform: translateY(-8px);
  box-shadow: 0 15px 40px rgba(6,33,65,0.15);
}

.stat-icon {
  width: 70px; height: 70px;
  background: linear-gradient(135deg, rgba(6,33,65,0.1), rgba(10,58,92,0.15));
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 20px;
  transition: transform 0.3s ease;
}

.stat-box:hover .stat-icon { transform: scale(1.1) rotate(5deg); }
.stat-icon i { font-size: 32px; color: #062141; }
.stat-number { font-size: 42px; font-weight: 800; color: #062141; margin-bottom: 10px; }
.stat-label  { font-size: 16px; color: #666; font-weight: 600; }

/* ===== Achievements Section ===== */
.achievements-section { padding: 80px 20px; background: white; }

.achievements-container { max-width: 1300px; margin: 0 auto; }

.section-header { text-align: center; margin-bottom: 60px; }

.section-header h2 {
  font-size: 42px; font-weight: 800; color: #062141;
  margin-bottom: 15px; position: relative; display: inline-block;
}

.section-header h2::after {
  content: '';
  position: absolute; bottom: -10px; left: 50%; transform: translateX(-50%);
  width: 100px; height: 4px;
  background: linear-gradient(to right, #062141, #0a3a5c);
  border-radius: 2px;
}

.section-header p {
  font-size: 17px; color: #666; margin-top: 25px;
  max-width: 700px; margin-left: auto; margin-right: auto; line-height: 1.7;
}

/* ===== Achievements Grid ===== */
.achievements-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 350px), 1fr));
  gap: 35px;
  margin-top: 50px;
}

/* ===== Achievement Card =====
   CRITICAL: Use animation for enter effect, NOT opacity:0 + JS class toggle.
   Cards must always be in the document flow on mobile.
   The inline style="animation-delay:Xs" from PHP drives staggering. */
.achievement-card {
  display: block;
  background: white;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,0.08);
  transition: transform 0.4s ease, box-shadow 0.4s ease, border-color 0.4s ease;
  border: 1px solid rgba(6,33,65,0.08);
  text-decoration: none;
  color: inherit;
  position: relative;
  cursor: pointer;
  /* Entry animation */
  opacity: 0;
  animation: cardFadeIn 0.6s ease forwards;
}

@keyframes cardFadeIn {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}

.achievement-card:hover {
  transform: translateY(-12px);
  box-shadow: 0 25px 50px rgba(6,33,65,0.2);
  border-color: rgba(6,33,65,0.2);
}

/* ===== Category Badge ===== */
.category-badge {
  position: absolute;
  top: 18px; right: 18px;
  padding: 8px 18px;
  border-radius: 50px;
  font-size: 13px; font-weight: 800;
  z-index: 15;
  box-shadow: 0 4px 15px rgba(0,0,0,0.25);
  color: white;
  backdrop-filter: blur(10px);
}

.badge-partnership  { background: linear-gradient(135deg, #10b981, #059669); }
.badge-conference   { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.badge-event        { background: linear-gradient(135deg, #f59e0b, #d97706); }
.badge-workshop     { background: linear-gradient(135deg, #8b5cf6, #7c3aed); }
.badge-grant        { background: linear-gradient(135deg, #f59e0b, #ea580c); }
.badge-participation{ background: linear-gradient(135deg, #ec4899, #db2777); }

/* ===== Image ===== */
.achievement-image {
  position: relative;
  height: 250px;
  overflow: hidden;
  background: linear-gradient(135deg, #f0f8f9, #e6f1f4);
}

.achievement-image img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
  display: block;
}

.achievement-card:hover .achievement-image img { transform: scale(1.1); }

.image-overlay {
  position: absolute; inset: 0;
  background: rgba(6,33,65,0.85);
  display: flex; align-items: center; justify-content: center;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.achievement-card:hover .image-overlay { opacity: 1; }

.category-icon {
  width: 90px; height: 90px;
  background: white; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transform: scale(0.8);
  transition: transform 0.4s cubic-bezier(0.68,-0.55,0.265,1.55);
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.achievement-card:hover .category-icon { transform: scale(1); }
.category-icon i { font-size: 40px; }

/* Category icon colors */
.achievement-card[data-category="partnership"]   .category-icon i { color: #10b981; }
.achievement-card[data-category="conference"]    .category-icon i { color: #3b82f6; }
.achievement-card[data-category="event"]         .category-icon i { color: #f59e0b; }
.achievement-card[data-category="workshop"]      .category-icon i { color: #8b5cf6; }
.achievement-card[data-category="grant"]         .category-icon i { color: #f59e0b; }
.achievement-card[data-category="participation"] .category-icon i { color: #ec4899; }

/* ===== Card Content ===== */
.achievement-content { padding: 28px; }

.achievement-date {
  display: flex; align-items: center; gap: 8px;
  font-size: 14px; color: #666; font-weight: 600; margin-bottom: 15px;
}

.achievement-date i { color: #009a88; }

.achievement-card h3 {
  font-size: 22px; font-weight: 800; color: #062141;
  margin-bottom: 14px; line-height: 1.5;
  transition: color 0.3s ease;
}

.achievement-card:hover h3 { color: #0c5b4fd3; }

.achievement-card p {
  font-size: 15px; line-height: 1.8; color: #666; margin-bottom: 20px;
}

.twitter-btn {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px;
  background: linear-gradient(135deg, rgba(22,59,46,0.9), rgba(9,55,50,0.9));
  color: white; border-radius: 12px;
  font-size: 15px; font-weight: 700;
  transition: all 0.3s ease; gap: 10px;
}

.twitter-btn i:first-child { font-size: 18px; }
.twitter-btn i:last-child  { font-size: 14px; transition: transform 0.3s ease; }

.achievement-card:hover .twitter-btn {
  background: linear-gradient(135deg, #476760, #055b4e);
  transform: translateX(-5px);
}

.achievement-card:hover .twitter-btn i:last-child { transform: translateX(-3px); }

/* ===== No Achievements ===== */
.no-achievements {
  grid-column: 1 / -1; text-align: center; padding: 80px 20px; color: #999;
}

.no-achievements i { font-size: 70px; margin-bottom: 25px; display: block; opacity: 0.5; color: #062141; }
.no-achievements p { font-size: 19px; font-weight: 600; }

/* ===== CTA Section ===== */
.cta-section {
  padding: 60px 20px 80px;
  background: #f8f9fa;
  display: flex; justify-content: center; align-items: center;
}

.cta-card {
  background: linear-gradient(135deg, #062141 0%, #0a4d4d 100%);
  border-radius: 28px; padding: 60px 50px;
  max-width: 720px; width: 100%;
  text-align: center; position: relative; overflow: hidden;
  box-shadow: 0 20px 60px rgba(6,33,65,0.3);
}

.cta-card::before {
  content: '';
  position: absolute; inset: 0;
  background: url('data:image/svg+xml,<svg width="40" height="40" xmlns="http://www.w3.org/2000/svg"><circle cx="20" cy="20" r="1" fill="rgba(255,255,255,0.08)"/></svg>');
  pointer-events: none;
}

.cta-card::after {
  content: '';
  position: absolute; top:-80px; right:-80px;
  width: 250px; height: 250px;
  background: radial-gradient(circle, rgba(255,255,255,0.07) 0%, transparent 70%);
  border-radius: 50%; pointer-events: none;
}

.cta-content { position: relative; z-index: 1; }

.cta-icon {
  font-size: 52px; margin-bottom: 20px; display: block;
  animation: ctaBounce 2.5s ease-in-out infinite;
}

@keyframes ctaBounce {
  0%,100% { transform:translateY(0) scale(1); }
  50%     { transform:translateY(-8px) scale(1.05); }
}

.cta-content h2 { font-size: 34px; font-weight: 800; color: white; margin-bottom: 14px; line-height: 1.3; }
.cta-content p  { font-size: 17px; color: rgba(255,255,255,0.88); margin-bottom: 36px; line-height: 1.7; max-width: 500px; margin-left: auto; margin-right: auto; }

.cta-buttons { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

.cta-btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 30px; border-radius: 50px;
  font-size: 16px; font-weight: 700;
  text-decoration: none; transition: all 0.3s ease;
  box-shadow: 0 6px 18px rgba(0,0,0,0.2);
  font-family: 'Tajawal', sans-serif;
}

.cta-btn.primary  { background: white; color: #062141; }
.cta-btn.primary:hover  { transform: translateY(-3px); box-shadow: 0 12px 30px rgba(0,0,0,0.25); background: #f0f8f9; }
.cta-btn.secondary{ background: linear-gradient(135deg, rgba(55,125,101,0.845), rgba(39,147,137,0.863)); color: white; }
.cta-btn.secondary:hover{ background: #1f9079; transform: translateY(-3px); }

/* ============================================================
   RESPONSIVE - Mobile Cards Must Always Show
============================================================ */

/* ≤1200px */
@media (max-width: 1200px) {
  .achievements-grid {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  }
}

/* ≤768px */
@media (max-width: 768px) {
  .achievements-hero { padding: 130px 20px 90px; }
  .achievements-hero h1 { font-size: 34px; }
  .achievements-hero p  { font-size: 17px; }
  .hero-icon { font-size: 60px; }

  .stats-container { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
  .section-header h2 { font-size: 32px; }
  .achievements-section { padding: 60px 15px; }

  /* Mobile: two columns minimum */
  .achievements-grid {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 25px !important;
    width: 100% !important;
    margin-top: 30px;
  }

  /* CRITICAL: Cards must be fully visible blocks */
  .achievement-card {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
  }

  .cta-section { padding: 50px 20px 60px; }
  .cta-card { padding: 45px 30px; border-radius: 22px; }
  .cta-content h2 { font-size: 28px; }
  .cta-content p  { font-size: 16px; }
  .cta-buttons { flex-direction: column; align-items: stretch; }
  .cta-btn { justify-content: center; }
}

/* ≤480px */
@media (max-width: 480px) {
  .achievements-hero h1 { font-size: 28px; }
  .section-header h2 { font-size: 28px; }

  .achievements-section { padding: 50px 12px; }

  /* CRITICAL: Force single column, fully visible */
  .achievements-grid {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 18px !important;
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
  }

  .achievement-card {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    border-radius: 16px !important;
    margin: 0 auto !important;
    box-sizing: border-box !important;
  }

  .achievement-image { height: 200px; }
  .achievement-content { padding: 20px; }
  .achievement-card h3 { font-size: 19px; }
  .achievement-card p  { font-size: 14px; }
  .twitter-btn { font-size: 14px; padding: 12px 16px; }

  .category-badge { font-size: 11px; padding: 6px 12px; top: 12px; right: 12px; }
  .category-icon { width: 70px; height: 70px; }
  .category-icon i { font-size: 32px; }

  .stats-container { grid-template-columns: 1fr; gap: 15px; }

  .cta-section { padding: 40px 15px 50px; }
  .cta-card { padding: 36px 22px; border-radius: 20px; }
  .cta-icon { font-size: 42px; }
  .cta-content h2 { font-size: 24px; }
  .cta-content p  { font-size: 15px; margin-bottom: 28px; }
  .cta-btn { font-size: 15px; padding: 13px 24px; }
}

/* ≤360px */
@media (max-width: 360px) {
  .achievements-grid {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }
  .achievement-card { border-radius: 14px !important; }
  .achievement-image { height: 180px; }
  .achievement-content { padding: 16px; }
  .cta-card { padding: 28px 16px; }
  .cta-content h2 { font-size: 22px; }
}