body {
  background: #050a1e;
  color: #ffffff;
  font-family: "Inter", sans-serif;
  margin: 0;
  padding: 0;
}

/* Header */
.glossary-header {
  text-align: center;
  padding: 40px 5%;
}

.glossary-title {
  font-size: 36px;
  font-weight: 800;
  color: #5ab0ff;
}

.glossary-subtitle {
  font-size: 16px;
  opacity: 0.85;
  margin-top: 8px;
}

/* Premium Back Button */
.glossary-home-btn {
  display: inline-block;
  margin-top: 25px;
  padding: 12px 22px;
  background: #5ab0ff;
  color: #050a1e;
  font-weight: 800;
  font-size: 15px;
  border-radius: 10px;
  text-decoration: none;
  box-shadow: 0 0 18px rgba(90,176,255,0.35);
  transition: 0.25s ease;
}

.glossary-home-btn:hover {
  background: #8ac8ff;
  box-shadow: 0 0 28px rgba(90,176,255,0.55);
  transform: translateY(-3px);
}

/* Search Bar */
.glossary-search-section {
  display: flex;
  justify-content: center;
  gap: 12px;
  padding: 20px 5%;
}

.glossary-search {
  width: 60%;
  max-width: 480px;
  padding: 12px 16px;
  border-radius: 8px;
  border: 1px solid rgba(90,176,255,0.4);
  background: #0a122e;
  color: #ffffff;
  font-size: 16px;
}

.glossary-search-btn {
  padding: 12px 20px;
  background: #5ab0ff;
  border: none;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
  color: #050a1e;
  transition: 0.25s ease;
}

.glossary-search-btn:hover {
  background: #8ac8ff;
}

/* Glossary Cards */
.glossary-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  padding: 30px 5%;
}

.glossary-card {
  background: #0a122e;
  border: 1px solid rgba(90,176,255,0.35);
  border-radius: 10px;
  padding: 20px;
  transition: 0.3s ease;
}

.glossary-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 0 22px rgba(90,176,255,0.45);
}

.glossary-term {
  font-size: 18px;
  font-weight: 700;
  color: #5ab0ff;
}

.glossary-definition {
  font-size: 15px;
  opacity: 0.85;
  margin-top: 6px;
  line-height: 1.6;
}

/* Thumbnail — ⭐ FIXED ALIGNMENT */
.glossary-thumbnail {
  width: 100%;
  height: 180px;          /* forces uniform height */
  object-fit: cover;      /* clean, modern, aligned grid */
  border-radius: 8px;
  margin-top: 12px;
  cursor: pointer;
  border: 1px solid rgba(90,176,255,0.3);
}

/* Modal */
.diagram-modal {
  display: none;
  position: fixed;
  z-index: 99999;
  left: 0; top: 0;
  width: 100%; height: 100%;
  background: rgba(5,10,30,0.9);
  justify-content: center;
  align-items: center;
  flex-direction: column;
}

/* ⭐ Corrected modal image size */
.modal-image {
  width: 600px;       /* controlled size */
  max-width: 90%;     /* responsive on mobile */
  height: auto;
  border-radius: 10px;
  border: 2px solid #5ab0ff;
  object-fit: contain;
}

.modal-caption {
  margin-top: 12px;
  font-size: 16px;
  opacity: 0.85;
}

.close-modal {
  position: absolute;
  top: 20px;
  right: 40px;
  font-size: 40px;
  cursor: pointer;
  color: #ffffff;
}

/* ================================
   GLOSSARY GRID ALIGNMENT FIX — PREMIUM
   ================================ */

.glossary-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    align-items: stretch;
}

.glossary-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    background: #0b1e39;
    border-radius: 12px;
    padding: 20px;

    /* ⭐ Subtle premium border */
    border: 1px solid rgba(255, 255, 255, 0.06);

    /* ⭐ High‑class faint shadow */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.glossary-card:hover {
    /* ⭐ Premium hover lift */
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
    transform: translateY(-4px);
}

.glossary-card img {
    width: 100%;
    height: 180px;
    object-fit: contain;
    display: block;
    margin-top: auto;
}



/* ================================
   GLOSSARY PERFECT GRID FIX — OPTION C (FORCED IMAGE CROP)
   ================================ */

/* 1. Equal title height */
.glossary-card .glossary-term {
    min-height: 40px;
    display: flex;
    align-items: center;
}

/* 2. Equal description height */
.glossary-card .glossary-definition {
    min-height: 80px;
    display: flex;
    align-items: center;
}

/* 3. FORCE images to align perfectly (cropping allowed) */
.glossary-card .glossary-thumbnail {
    width: 100%;
    height: 180px;          /* fixed height */
    object-fit: cover;      /* ⭐ forces uniform shape */
    object-position: center;
    display: block;
}

/* 4. Ensure cards stretch evenly */
.glossary-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    overflow: hidden;       /* ⭐ prevents overflow from cropping */
}

/* 5. Force grid rows to equal height */
.glossary-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    align-items: stretch;
    grid-auto-rows: 1fr;
}



