/* ===== BADGE SYSTEM - REDESIGNED & FIXED ===== */

/* ===== Container for all badges ===== */
.badge-container {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  justify-content: flex-start;
  margin: 30px 0;
  padding: 0;
}

/* ===== Category Section Layout ===== */
.award-category {
  margin-bottom: 3rem;
}

.category-header {
  color: white;
  padding: 1.8rem 2rem;
  border-radius: 16px 16px 0 0;
  margin-bottom: 0;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.category-title {
  font-size: 1.9rem;
  font-weight: 700;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  transition: all 0.3s ease;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3);
  font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
}

.category-title:hover {
  transform: scale(1.02);
}

.category-subtitle {
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.95);
  margin: 0.5rem 0 0 0;
  font-weight: 400;
  font-style: italic;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.25);
}

/* Simple bounce emoji animation */
.category-title::before {
  content: attr(data-emoji);
  display: inline-block;
  animation: simpleBounce 2s infinite;
  font-size: 1.9rem;
}

@keyframes simpleBounce {
  0%, 20%, 50%, 80%, 100% { 
    transform: translateY(0); 
  }
  40% { 
    transform: translateY(-4px); 
  }
  60% { 
    transform: translateY(-2px); 
  }
}

/* ===== Unified Category Container ===== */
.category-badges {
  background: #ffffff;
  border-radius: 0 0 16px 16px;
  border-top: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  border: 2px solid var(--category-border);
  overflow: hidden;
}

/* ===== Individual Badge Cards - Fixed Layout ===== */
.badge-item {
  width: 100%;
  background: #ffffff;
  padding: 2rem;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto 1fr auto;
  gap: 1rem 2rem;
  transition: all 0.3s ease;
  min-height: 180px;
  position: relative;
  border-bottom: 1px solid var(--category-light-border);
}

.badge-item:last-child {
  border-bottom: none;
}

.badge-item:hover {
  background: var(--category-hover-bg);
  transform: translateX(4px);
}

/* ===== Grid Layout for Badge Content ===== */
.badge {
  grid-column: 1;
  grid-row: 1;
  display: inline-block;
  padding: 8px 20px;
  font-size: 1.25rem;
  font-weight: 600;
  border-radius: 12px;
  white-space: nowrap;
  transition: all 0.3s ease;
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  border: 1px solid transparent;
  margin: 0;
  line-height: 1.3;
  justify-self: start;
}

.badge:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  text-decoration: none;
}

.badge-description {
  grid-column: 1;
  grid-row: 2 / 4;
  color: #444;
  line-height: 1.6;
  font-size: 1.1rem;
  font-weight: 400;
  margin: 0;
  align-self: start;
}

.badge-description br {
  margin-bottom: 6px;
}

.badge-description em {
  font-style: normal;
  color: #555;
  margin-top: 0.8rem;
  font-size: 0.95rem;
  font-weight: 600;
  display: inline-block;
  padding: 8px 12px;
  background: var(--org-background);
  border-radius: 8px;
  border-left: 1px solid #e5e5e5;
  box-shadow: 0 0.5px 1px rgba(0, 0, 0, 0.03);
  opacity: 0.9;
  max-width: 100%;
}

/* ===== Logo Positioning - Fixed ===== */
.badge-logo {
  grid-column: 2;
  grid-row: 1 / 4;
  width: 180px;
  height: 120px;
  object-fit: contain;
  object-position: center;
  justify-self: center;
  align-self: center;
  padding: 12px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 12px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
}

.badge-logo:hover {
  transform: scale(1.03);
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.12);
}

/* ===== Read More Button - Fixed Position ===== */
.badge-read-more {
  grid-column: 1 / -1;
  grid-row: 4;
  justify-self: end;
  align-self: end;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  font-size: 0.9rem;
  font-weight: 500;
  color: #666;
  background: linear-gradient(135deg, #f8f9fa, #ffffff);
  border: 1px solid #dee2e6;
  border-radius: 25px;
  text-decoration: none;
  transition: all 0.3s ease;
  margin-top: 1rem;
}

.badge-read-more:hover {
  color: #495057;
  background: linear-gradient(135deg, #e9ecef, #f8f9fa);
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.badge-read-more i {
  font-size: 0.8rem;
  margin: 0;
  transition: transform 0.3s ease;
}

.badge-read-more:hover i {
  transform: translateX(2px);
}

/* ===== Mobile Responsive ===== */
@media (max-width: 768px) {
  .badge-item {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto auto auto;
    text-align: center;
    padding: 1.5rem;
  }
  
  .badge {
    grid-column: 1;
    grid-row: 1;
    justify-self: center;
    font-size: 1.1rem;
  }
  
  .badge-description {
    grid-column: 1;
    grid-row: 3;
    text-align: center;
  }
  
  .badge-logo {
    grid-column: 1;
    grid-row: 2;
    width: 160px;
    height: 100px;
    margin: 1rem auto;
  }
  
  .badge-read-more {
    grid-column: 1;
    grid-row: 4;
    justify-self: center;
    margin-top: 1.5rem;
  }
}

/* ===== CATEGORY COLOR SYSTEM ===== */

/* Leadership Category */
.category-header.leadership {
  background: linear-gradient(135deg, #ff9a56, #ff6b6b);
}

.category-badges.leadership {
  --category-border: rgba(255, 107, 107, 0.3);
  --category-light-border: rgba(255, 107, 107, 0.15);
  --category-hover-bg: rgba(255, 154, 86, 0.03);
  --org-background: linear-gradient(135deg, #fff3e0, #ffecb3);
  --org-accent-color: #e65100;
}

.badge-leadership { 
  background-color: #fff3e0; 
  color: #e65100; 
}

.badge-read-more.leadership { 
  background: linear-gradient(135deg, #fff3e0, #ffffff);
  color: #e65100; 
  border-color: #ffcc02; 
}

/* Research Category */
.category-header.research {
  background: linear-gradient(135deg, #667eea, #764ba2);
}

.category-badges.research {
  --category-border: rgba(102, 126, 234, 0.3);
  --category-light-border: rgba(102, 126, 234, 0.15);
  --category-hover-bg: rgba(118, 75, 162, 0.03);
  --org-background: linear-gradient(135deg, #f3e5f5, #e8eaf6);
  --org-accent-color: #4a148c;
}

.badge-research { 
  background-color: #ede7f6; 
  color: #4a148c; 
}

.badge-read-more.research { 
  background: linear-gradient(135deg, #ede7f6, #ffffff);
  color: #4a148c; 
  border-color: #d1c4e9; 
}

/* Publication Category */
.category-header.publication {
  background: linear-gradient(135deg, #00d2d3, #54a0ff);
}

.category-badges.publication {
  --category-border: rgba(0, 210, 211, 0.3);
  --category-light-border: rgba(0, 210, 211, 0.15);
  --category-hover-bg: rgba(46, 213, 115, 0.03);
  --org-background: linear-gradient(135deg, #e8f5e9, #f1f8e9);
  --org-accent-color: #1b5e20;
}

.badge-publication { 
  background-color: #e8f5e9; 
  color: #1b5e20; 
}

.badge-read-more.publication { 
  background: linear-gradient(135deg, #e8f5e9, #ffffff);
  color: #1b5e20; 
  border-color: #c8e6c9; 
}

/* Student Category */
.category-header.student {
  background: linear-gradient(135deg, #42a5f5, #1976d2);
}

.category-badges.student {
  --category-border: rgba(33, 150, 243, 0.3);
  --category-light-border: rgba(33, 150, 243, 0.15);
  --category-hover-bg: rgba(66, 165, 245, 0.03);
  --org-background: linear-gradient(135deg, #e3f2fd, #e8f4fd);
  --org-accent-color: #0d47a1;
}

.badge-student { 
  background-color: #e3f2fd; 
  color: #0d47a1; 
}

.badge-read-more.student { 
  background: linear-gradient(135deg, #e3f2fd, #ffffff);
  color: #0d47a1; 
  border-color: #bbdefb; 
}

/* Award Category */
.category-header.award {
  background: linear-gradient(135deg, #ec407a, #ad1457);
}

.category-badges.award {
  --category-border: rgba(233, 30, 99, 0.3);
  --category-light-border: rgba(233, 30, 99, 0.15);
  --category-hover-bg: rgba(236, 64, 122, 0.03);
  --org-background: linear-gradient(135deg, #fce4ec, #f8bbd9);
  --org-accent-color: #880e4f;
}

.badge-award { 
  background-color: #fce4ec; 
  color: #880e4f; 
}

.badge-read-more.award { 
  background: linear-gradient(135deg, #fce4ec, #ffffff);
  color: #880e4f; 
  border-color: #f8bbd9; 
}

/* Honor Category */
.category-header.honor {
  background: linear-gradient(135deg, #f44336, #c62828);
}

.category-badges.honor {
  --category-border: rgba(244, 67, 54, 0.3);
  --category-light-border: rgba(244, 67, 54, 0.15);
  --category-hover-bg: rgba(198, 40, 40, 0.03);
  --org-background: linear-gradient(135deg, #ffebee, #ffcdd2);
  --org-accent-color: #b71c1c;
}

.badge-honor { 
  background-color: #ffebee; 
  color: #b71c1c; 
}

.badge-read-more.honor { 
  background: linear-gradient(135deg, #ffebee, #ffffff);
  color: #b71c1c; 
  border-color: #ffcdd2; 
}

/* Talk Category */
.category-header.talk {
  background: linear-gradient(135deg, #9c27b0, #6a1b9a);
}

.category-badges.talk {
  --category-border: rgba(156, 39, 176, 0.3);
  --category-light-border: rgba(156, 39, 176, 0.15);
  --category-hover-bg: rgba(106, 27, 154, 0.03);
  --org-background: linear-gradient(135deg, #f3e5f5, #e1bee7);
  --org-accent-color: #6a1b9a;
}

.badge-talk { 
  background-color: #f3e5f5; 
  color: #6a1b9a; 
}

.badge-read-more.talk { 
  background: linear-gradient(135deg, #f3e5f5, #ffffff);
  color: #6a1b9a; 
  border-color: #e1bee7; 
}