/*
 * THE IMG PATH — Verified College Badge Styles
 * /badge-system/badge-styles.css
 *
 * SAFE: Fully isolated. All classes are prefixed with .imgpath-badge-
 * No global overrides. No changes to existing card layout.
 * No layout shift when a badge is absent (inline-flex, zero margin default).
 *
 * Load this file on any page that uses badge-component.js.
 * Do NOT import into style.css or any existing project stylesheet.
 */


/* ===========================================================
   Base badge pill
   =========================================================== */

.imgpath-badge {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px 3px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.02em;
  white-space: nowrap;
  cursor: default;
  vertical-align: middle;
  margin-left: 7px;

  /* Smooth appearance — no layout shift */
  transition: opacity 0.2s ease, transform 0.2s ease;

  /* Fallback color — overridden per tier below */
  background: #2563eb;
  color: #ffffff;

  /* Subtle shadow so badge doesn't float */
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.14);
}


/* ===========================================================
   Tier-specific colors
   (Also overridden by inline style from badge_color in DB)
   =========================================================== */

.imgpath-badge-verified {
  background: #2563eb;
  color: #ffffff;
}

.imgpath-badge-featured {
  background: #7c3aed;
  color: #ffffff;
}

.imgpath-badge-premium {
  background: #b45309;
  color: #ffffff;
}


/* ===========================================================
   Icon and label inside badge
   =========================================================== */

.imgpath-badge-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  line-height: 1;
  flex-shrink: 0;
}

.imgpath-badge-label {
  display: inline;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}


/* ===========================================================
   Tooltip
   Shows on hover above the badge.
   Hidden by default — no layout impact.
   =========================================================== */

.imgpath-badge-tooltip {
  pointer-events: none;
  position: absolute;
  bottom: calc(100% + 7px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;

  min-width: 200px;
  max-width: 260px;
  padding: 8px 12px;
  border-radius: 10px;
  background: #0f172a;
  color: #f1f5f9;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
  text-align: center;
  white-space: normal;
  letter-spacing: 0;

  opacity: 0;
  visibility: hidden;
  transition: opacity 0.18s ease, visibility 0.18s ease;

  /* Arrow pointing down */
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.22);
}

.imgpath-badge-tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: #0f172a;
}

.imgpath-badge:hover .imgpath-badge-tooltip,
.imgpath-badge:focus-within .imgpath-badge-tooltip {
  opacity: 1;
  visibility: visible;
}


/* ===========================================================
   Disclaimer line
   "AI scores are not influenced by badge tier."
   =========================================================== */

.imgpath-badge-disclaimer {
  display: block;
  margin: 10px 0 0;
  padding: 0;
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  line-height: 1.5;
  letter-spacing: 0;

  /* Ensure it never inherits loud parent styles */
  font-style: normal;
  text-decoration: none;
  text-transform: none;
}


/* ===========================================================
   Mobile — keep badge readable on small screens
   =========================================================== */

@media (max-width: 600px) {
  .imgpath-badge {
    font-size: 10px;
    padding: 3px 7px 3px 6px;
    margin-left: 5px;
  }

  .imgpath-badge-label {
    /* Hide label text on very small screens — icon only */
    display: none;
  }

  .imgpath-badge-icon {
    font-size: 11px;
  }

  .imgpath-badge-tooltip {
    /* On mobile, shift tooltip left so it doesn't clip viewport edge */
    left: 0;
    transform: translateX(0);
    min-width: 180px;
    max-width: 220px;
  }

  .imgpath-badge-tooltip::after {
    left: 18px;
    transform: none;
  }
}


/* ===========================================================
   Print — hide badges in PDF/print output
   =========================================================== */

@media print {
  .imgpath-badge,
  .imgpath-badge-tooltip,
  .imgpath-badge-disclaimer {
    display: none !important;
  }
}
