/**
 * modal_unit_info.css - Truly Responsive Unit Info Modal Stylesheet
 * Scaled dynamically relative to #game-wrapper container query dimensions
 */

/* ==========================================================================
   SECTION 1: OVERLAY & BACKDROP LAYOUT
   ========================================================================== */

/* Base overlay container: Fills #game-wrapper bounds completely and centers modal content with 4cqw padding */
.unit-modal-overlay {
  position: absolute;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4cqw;
  box-sizing: border-box;
  opacity: 1;
  transition: opacity 0.2s ease-in-out;
}

/* Hidden state overrides: Hides overlay completely, sets zero opacity, and disables pointer interactions */
.unit-modal-overlay.hidden,
.unit-modal-overlay[hidden] {
  display: none !important;
  opacity: 0;
  pointer-events: none;
}

/* Active visibility override state: Forces flex display, full opacity, and interactive pointer events */
.unit-modal-overlay:not(.hidden):not([hidden]) {
  display: flex !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

/* Backdrop blur & dark overlay: Absolute layer with semi-transparent background and 0.8cqw backdrop blur */
.unit-modal-backdrop {
  position: absolute;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(0.8cqw);
  -webkit-backdrop-filter: blur(0.8cqw);
  z-index: 0;
}

/* ==========================================================================
   SECTION 2: MODAL CARD CONTAINER
   ========================================================================== */

/* Main modal card container: Central frame responsive scaling (cqw/cqh), double border, shadow, and scroll container */
.unit-modal-card {
  position: relative;
  z-index: 1;
  width: 88cqw;
  max-width: 92cqw;
  max-height: 88cqh;
  background: linear-gradient(180deg, #18110b 0%, #0e0a07 100%);
  border: 0.45cqw solid #c89d38;
  outline: 0.22cqw solid #4a3818;
  outline-offset: -0.9cqw;
  border-radius: 2.2cqw;
  padding: 4.5cqw 3.5cqw 3.5cqw;
  box-shadow: 0 1.5cqh 4cqw rgba(0, 0, 0, 0.9), 0 0 3cqw rgba(200, 157, 56, 0.2);
  display: flex;
  flex-direction: column;
  gap: 3cqw;
  box-sizing: border-box;
  overflow-y: auto;
}

/* ==========================================================================
   SECTION 3: HEADER SECTION & UNIT METADATA
   ========================================================================== */

/* Header container: Flex row wrapper aligning unit icon frame and metadata content with bottom divider */
.modal-header {
  display: flex;
  align-items: flex-start;
  gap: 3cqw;
  border-bottom: 0.2cqw solid rgba(200, 157, 56, 0.3);
  padding-bottom: 3cqw;
}

/* Unit icon container frame: Fixed 16cqw square box with radial gradient and gold border */
.unit-icon-frame {
  width: 16cqw;
  height: 16cqw;
  flex-shrink: 0;
  background: radial-gradient(circle, #2d2219 0%, #1a0f0a 100%);
  border: 0.35cqw solid #c89d38;
  border-radius: 2cqw;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 1.5cqw rgba(0, 0, 0, 0.8), 0 0.4cqh 1cqw rgba(0, 0, 0, 0.5);
}

/* Unit icon symbol: Scaled 8cqw graphic/emoji centered within frame featuring drop shadow */
.unit-icon-symbol {
  font-size: 8cqw;
  line-height: 1;
  filter: drop-shadow(0 0.4cqw 0.4cqw rgba(0, 0, 0, 0.7));
}

/* Header text layout: Flexible vertical column container holding title, role badge, and description */
.unit-header-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1cqw;
}

/* Unit title typography: Uppercase serif font at 4.8cqw with golden glow text shadow */
.unit-title {
  font-family: 'Cinzel', 'MedievalSharp', serif;
  font-size: 4.8cqw;
  font-weight: 700;
  color: #f3d078;
  text-shadow: 0 0.3cqw 0.6cqw rgba(0, 0, 0, 0.8), 0 0 1.5cqw rgba(243, 208, 120, 0.3);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin: 0;
  line-height: 1.2;
}

/* Unit role badge: Compact inline-block pill badge scaled to 2.2cqw with border highlight */
.unit-role {
  display: inline-block;
  align-self: flex-start;
  font-family: 'Inter', sans-serif;
  font-size: 2.2cqw;
  font-weight: 800;
  color: #e2b755;
  background-color: rgba(200, 157, 56, 0.15);
  border: 0.2cqw solid rgba(200, 157, 56, 0.4);
  border-radius: 0.8cqw;
  padding: 0.6cqw 1.8cqw;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* Unit description body: Descriptive text block scaled at 2.7cqw with comfortable line height */
.unit-description {
  font-family: 'Inter', sans-serif;
  font-size: 2.7cqw;
  line-height: 1.45;
  color: #d1c7bd;
  margin: 0.8cqw 0 0 0;
  max-height: 18.2cqw;
  height: 18.2cqw;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  padding-right: 1cqw;
  scrollbar-width: thin;
  scrollbar-color: #4a3818 #0e0a07;
}

/* ==========================================================================
   SECTION 4: DYNAMIC STATS GRID & CARDS
   ========================================================================== */

/* Stats grid container: Two-column grid wrapper for organizing individual stat boxes with 2cqw gap */
.unit-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2cqw;
  width: 100%;
}

/* Individual stat item container: Dark semi-transparent card with subtle border and inset shadow */
.stat-box {
  background: rgba(18, 10, 6, 0.75);
  border: 0.22cqw solid rgba(200, 157, 56, 0.35);
  border-radius: 1.5cqw;
  padding: 2cqw 2.5cqw;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.6cqw;
  box-shadow: inset 0 0 1cqw rgba(0, 0, 0, 0.6);
  transition: border-color 0.2s ease, transform 0.15s ease;
}

/* Interactive stat box hover state: Lifts card up by 0.2cqw and brightens golden border outline */
.stat-box:hover {
  border-color: rgba(243, 208, 120, 0.7);
  transform: translateY(-0.2cqw);
}

/* Stat label typography: Uppercase sans-serif label text scaling to 2.1cqw */
.stat-label {
  font-family: 'Inter', sans-serif;
  font-size: 2.1cqw;
  font-weight: 700;
  color: #9a8871;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Stat value base typography: Bold monospace numerical value text scaling to 3.6cqw */
.stat-value {
  font-family: 'Consolas', 'Monaco', 'Inter', monospace;
  font-size: 3.6cqw;
  font-weight: 800;
  line-height: 1.1;
}

/* ==========================================================================
   SECTION 5: STAT VALUE TEXT COLOR THEMES
   ========================================================================== */

/* Health text theme: Green text color theme with subtle glow effect for HP stats */
.stat-value.hp-text {
  color: #2ecc71;
  text-shadow: 0 0 0.8cqw rgba(46, 204, 113, 0.3);
}

/* Damage text theme: Red text color theme with subtle glow effect for damage/attack stats */
.stat-value.damage-text {
  color: #e74c3c;
  text-shadow: 0 0 0.8cqw rgba(231, 76, 60, 0.3);
}

/* Gold text theme: Golden yellow color theme with subtle glow effect for cost/currency stats */
.stat-value.gold-text {
  color: #f3d078;
  text-shadow: 0 0 0.8cqw rgba(243, 208, 120, 0.3);
}

/* White text theme: Neutral off-white color theme with soft white shadow for general stats */
.stat-value.white-text {
  color: #f5f5f5;
  text-shadow: 0 0 0.8cqw rgba(255, 255, 255, 0.2);
}

/* ==========================================================================
   SECTION 6: MODAL CONTROLS (CLOSE BUTTON)
   ========================================================================== */

/* Base close button styling: Absolute circular action button positioned in top-right corner, sized to 7.5cqw */
.unit-modal-card .modal-close-btn {
  position: absolute;
  top: 2cqw;
  right: 2cqw;
  width: 7.5cqw;
  height: 7.5cqw;
  border-radius: 50%;
  background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
  border: 0.3cqw solid #c89d38;
  color: #ffffff;
  font-size: 4cqw;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 0.5cqh 1cqw rgba(0, 0, 0, 0.6);
  transition: transform 0.15s ease, background-color 0.15s ease;
  line-height: 1;
  z-index: 10;
}

/* Interactive hover state: Brightens background red gradient and scales button to 1.08x */
.unit-modal-card .modal-close-btn:hover {
  background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
  transform: scale(1.08);
}

/* Accessibility focus state: Highlights close button with 0.4cqw gold outline during keyboard navigation */
.unit-modal-card .modal-close-btn:focus-visible {
  outline: 0.4cqw solid #f3d078;
  outline-offset: 0.4cqw;
}

/* ==========================================================================
   SECTION 7: CUSTOM SCROLLBAR STYLING
   ========================================================================== */

/* Webkit scrollbar width: Custom scrollbar width set to 1.2cqw for modal card container */
.unit-modal-card::-webkit-scrollbar {
  width: 1.2cqw;
}

/* Scrollbar track: Dark track background with rounded 0.6cqw corners */
.unit-modal-card::-webkit-scrollbar-track {
  background: #0e0a07;
  border-radius: 0.6cqw;
}

/* Scrollbar thumb & base state: Dark gold-bordered thumb styled with rounded corners */
.unit-modal-card::-webkit-scrollbar-thumb {
  background: #4a3818;
  border: 0.2cqw solid #c89d38;
  border-radius: 0.6cqw;
}

/* Scrollbar thumb hover state: Brightens scrollbar thumb background to gold on hover */
.unit-modal-card::-webkit-scrollbar-thumb:hover {
  background: #c89d38;
}

/* Unit description scrollbar width: Compact 0.8cqw scrollbar width for unit description text */
.unit-description::-webkit-scrollbar {
  width: 0.8cqw;
}

/* Unit description scrollbar track: Dark track background with rounded 0.4cqw corners */
.unit-description::-webkit-scrollbar-track {
  background: #0e0a07;
  border-radius: 0.4cqw;
}

/* Unit description scrollbar thumb: Dark gold-bordered thumb styled with rounded 0.4cqw corners */
.unit-description::-webkit-scrollbar-thumb {
  background: #4a3818;
  border: 0.15cqw solid #c89d38;
  border-radius: 0.4cqw;
}

/* Unit description scrollbar thumb hover state: Brightens scrollbar thumb background to gold on hover */
.unit-description::-webkit-scrollbar-thumb:hover {
  background: #c89d38;
}

/* ==========================================================================
   SECTION 8: UNIT ABILITY DESCRIPTION AREA
   ========================================================================== */

/* Full-width container placed below stats grid with border-top separator and vertical spacing */
.unit-ability-container {
  width: 100%;
  margin-top: 2.5cqw;
  border-top: 0.2cqw solid rgba(200, 157, 56, 0.3);
  padding-top: 2.5cqw;
  display: flex;
  flex-direction: column;
  gap: 2cqw;
}

/* Semi-transparent dark card container with gold border outline */
.unit-ability-item {
  background: rgba(18, 10, 6, 0.75);
  border: 0.22cqw solid rgba(200, 157, 56, 0.35);
  border-radius: 1.5cqw;
  padding: 2cqw 2.5cqw;
  display: flex;
  align-items: center;
  gap: 1.5cqw;
  flex-wrap: wrap;
}

/* Gold rectangle badge with dark brown text for ability title */
.ability-name-badge {
  background: linear-gradient(135deg, #f3d078 0%, #c89d38 100%);
  color: #2a1a08;
  font-family: 'Inter', sans-serif;
  font-weight: 800;
  text-transform: uppercase;
  font-size: 2.3cqw;
  padding: 0.5cqw 1.4cqw;
  border-radius: 0.6cqw;
  border: 0.15cqw solid #4a3818;
  box-shadow: 0 0.2cqh 0.6cqw rgba(0, 0, 0, 0.4);
}

/* Golden colon separator */
.ability-colon-separator {
  color: #f3d078;
  font-size: 2.5cqw;
  font-weight: 700;
}

/* Description text block scaling dynamically relative to container width */
.ability-description-text {
  font-family: 'Inter', sans-serif;
  font-size: 2.4cqw;
  line-height: 1.4;
  color: #d1c7bd;
  flex: 1;
}