@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap");

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  /* Restored previous background gradient with radial patterns for better visual depth */
  background: radial-gradient(circle at 20% 80%, rgba(255, 153, 51, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(0, 63, 136, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 40% 40%, rgba(255, 255, 255, 0.2) 0%, transparent 50%),
    linear-gradient(
      135deg,
      rgba(255, 245, 245, 0.8) 0%,
      rgba(255, 255, 255, 0.6) 25%,
      rgba(235, 245, 255, 0.8) 50%,
      rgba(255, 255, 255, 0.6) 75%,
      rgba(245, 255, 245, 0.8) 100%
    );
  color: #1a202c;
  line-height: 1.6;
  min-height: 100vh;
  position: relative;
}


/* Back Button */
.back-btn {
  position: fixed;
  top: 20px;
  left: 20px;
  /* Reduced backdrop-filter blur from 25px to 12px for better performance */
  background: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  padding: 12px 20px;
  border-radius: 20px;
  color: #003f88;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s ease;
  /* Simplified shadow for better performance */
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  font-size: 14px;
  /* Added hardware acceleration */
  transform: translateZ(0);
  will-change: transform;
}

.back-btn:hover {
  /* Optimized hover by removing backdrop-filter change and using only transform */
  background: rgba(255, 255, 255, 0.35);
  transform: translateY(-2px) scale(1.02) translateZ(0);
  box-shadow: 0 12px 35px rgba(0, 63, 136, 0.2);
  border-color: rgba(0, 63, 136, 0.4);
}

.back-btn i {
  font-size: 16px;
}

.rank-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 80px 20px 60px;
  min-height: 100vh;
}

.rank-header {
  text-align: center;
  margin-bottom: 60px;
}

.rank-header h1 {
  /* Updated header styling for light theme */
  font-size: 3.5rem;
  font-weight: 700;
  color: #1a202c;
  margin-bottom: 16px;
  letter-spacing: -0.025em;
}

.rank-header p {
  /* Updated subtitle for light theme */
  font-size: 1.25rem;
  color: #4a5568;
  font-weight: 400;
  max-width: 600px;
  margin: 0 auto;
}

.section-toggle {
  display: flex;
  justify-content: center;
  margin-bottom: 60px;
  gap: 4px;
  /* Reduced backdrop-filter blur for better performance */
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  padding: 6px;
  border-radius: 20px;
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
  border: 1px solid rgba(255, 255, 255, 0.6);
  /* Simplified shadow */
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.toggle-btn {
  padding: 14px 28px;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: #718096;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 600;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  position: relative;
  overflow: hidden;
}

.toggle-btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.1), transparent);
  transition: left 0.5s;
}

.toggle-btn:hover::before {
  left: 100%;
}

.toggle-btn.active {
  /* Updated active toggle with NCC blue */
  background: #003f88;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(0, 63, 136, 0.3), inset 0 0 15px rgba(255, 153, 51, 0.1);
  transform: translateY(-1px);
}

.toggle-btn:hover:not(.active) {
  color: #003f88;
  background: rgba(255, 255, 255, 0.3);
}

.rank-section {
  display: none;
  animation: fadeInUp 0.6s ease-out;
}

.rank-section.active {
  display: block;
}

.rank-hierarchy {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 50px;
}

.rank-level {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 30px;
  width: 100%;
  flex-wrap: wrap;
  position: relative;
  /* Added CSS containment for better performance */
  contain: layout style;
}

.rank-level.single {
  justify-content: center;
}

/* Completely redesigned officer cards to match reference image */
.officer-card {
  /* Reduced backdrop-filter blur from 25px to 15px and simplified effects */
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(15px);
  border-radius: 24px;
  padding: 32px 24px;
  text-align: center;
  /* Simplified shadow for better performance */
  box-shadow: 0 10px 35px rgba(0, 0, 0, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.6);
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  border: 1px solid rgba(255, 255, 255, 0.6);
  width: 300px;
  position: relative;
  overflow: hidden;
  opacity: 0;
  transform: translateY(30px);
  /* Added hardware acceleration and performance hints */
  transform-style: preserve-3d;
  will-change: transform;
}

.officer-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(135deg, #fc0d0d 0%, #05c0ff 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.officer-photo {
  width: 120px;
  height: 120px;
  margin: 0 auto 20px;
  border-radius: 20px;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.6);
  transition: all 0.4s ease;
  position: relative;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
  /* Added hardware acceleration */
  transform: translateZ(0);
}

.officer-photo::before {
  content: "";
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(135deg, #c91313, #017aae);
  border-radius: 20px;
  z-index: -1;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.officer-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.officer-card:hover {
  /* Optimized hover effect with reduced blur and simplified shadows */
  transform: translateY(-8px) scale(1.02) translateZ(0);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15), inset 0 0 25px rgba(0, 63, 136, 0.1);
  border-color: rgba(0, 63, 136, 0.4);
  background: rgba(255, 255, 255, 0.2);
}

.officer-card:hover::before {
  opacity: 1;
}

.officer-card:hover .officer-photo {
  transform: scale(1.05) translateZ(0);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
}

.officer-card:hover .officer-photo::before {
  opacity: 1;
}

.officer-card:hover .officer-photo img {
  transform: scale(1.02);
}

.officer-name {
  font-size: 1.25rem;
  font-weight: 600;
  color: #1a202c;
  margin-bottom: 12px;
  line-height: 1.3;
  transition: color 0.3s ease;
}

.officer-card:hover .officer-name {
  color: #2d3748;
}

.officer-rank {
  display: inline-block;
  background: #003f88;
  color: #ffffff;
  padding: 6px 16px;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
  text-transform: uppercase;
  transition: all 0.3s ease;
}

.officer-card:hover .officer-rank {
  background: #0075af;
  transform: scale(1.05) translateZ(0);
  box-shadow: 0 4px 15px rgba(87, 87, 87, 0.3);
}

.officer-year {
  color: #718096;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 20px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.social-links {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 16px;
}

.social-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: #ffffff;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.social-btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 8px;
  transform: scale(0);
  transition: transform 0.3s ease;
  z-index: -1;
}

.social-btn.linkedin {
  background: #0077b5;
}

.social-btn.linkedin::before {
  background: #005885;
}

.social-btn.instagram {
  background: #e4405f;
}

.social-btn.instagram::before {
  background: #c13584;
}

.social-btn.email {
  background: #d44638;
}

.social-btn.email::before {
  background: #a33227;
}

.social-btn:hover {
  transform: translateY(-2px) scale(1.1);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.social-btn:hover::before {
  transform: scale(1);
}

.social-btn i {
  font-size: 14px;
  z-index: 1;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.officer-card.aos-animate {
  opacity: 1;
  transform: translateY(0) translateZ(0);
}

@media (max-width: 1200px) {
  .officer-card {
    width: 280px;
  }

  .rank-level {
    gap: 25px;
  }
}

@media (max-width: 992px) {
  .officer-card {
    width: 260px;
  }

  .rank-level {
    gap: 20px;
  }

  .rank-header h1 {
    font-size: 3rem;
  }
}

@media (max-width: 768px) {
  .rank-container {
    padding: 60px 16px 40px;
  }

  .rank-header h1 {
    font-size: 2.5rem;
  }

  .rank-header p {
    font-size: 1.125rem;
  }

  .officer-card {
    width: 100%;
    max-width: 320px;
  }

  .rank-level {
    flex-direction: column;
    align-items: center;
    gap: 25px;
  }

  .section-toggle {
    flex-direction: column;
    width: 100%;
    max-width: 300px;
  }

  .toggle-btn {
    padding: 16px 24px;
    font-size: 0.8rem;
  }

  .back-btn {
    top: 15px;
    left: 15px;
    padding: 10px 16px;
    font-size: 13px;
  }
}

@media (max-width: 480px) {
  .rank-header h1 {
    font-size: 2rem;
  }

  .officer-photo {
    width: 100px;
    height: 100px;
  }

  .officer-name {
    font-size: 1.125rem;
  }

  .officer-card {
    padding: 28px 20px;
  }

  .rank-container {
    padding: 50px 12px 30px;
  }
}

@media print {
  .section-toggle,
  .back-btn {
    display: none;
  }

  .rank-section {
    display: block !important;
  }

  .officer-card {
    break-inside: avoid;
    box-shadow: none;
    border: 1px solid #e2e8f0;
  }

  body {
    background: white;
  }
}

/* === FOOTER === */
.footer {
  background: linear-gradient(135deg, #0b1f4b 0%, #111827 100%);
  display: absolute;
  color: white;
}

.footer-bottom {
  border-top: 1px solid #374151;
  padding: 32px 20px;
  max-width: 1200px; 
  margin: 0 auto;     
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}


.footer-bottom p {
  color: #9ca3af;
  font-size: 14px;
}

.footer-bottom-links {
  display: flex;
  gap: 24px;
}

.footer-bottom-links a {
  color: #9ca3af;
  text-decoration: none;
  font-size: 14px;
  transition: color 0.3s ease;
}

.footer-bottom-links a:hover {
  color: white;
}