/**
 * @file breakthroughModal.css
 * @description 선협 돌파 처방전 및 위험 고지 모달 스타일
 */

.bt-dialog {
  max-width: 580px;
  width: 94%;
  height: 610px;
  max-height: 90vh;
  background: #111827;
  border: 1px solid #374151;
  border-radius: 12px;
  box-shadow: 0 20px 40px -5px rgba(0, 0, 0, 0.85);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* 1. 상단 고정 헤더 */
.bt-header {
  flex-shrink: 0;
  background: linear-gradient(180deg, #1f2937, #111827);
  border-bottom: 1px solid #374151;
  padding: 0.75rem 1.1rem;
}

.bt-header-main { display: flex; flex-direction: column; gap: 0.35rem; }
.bt-header-title-row { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.bt-title-heading { margin: 0; font-size: 1.05rem; font-weight: 700; color: #f8fafc; flex: 1; }

.bt-type-badge {
  font-size: 0.72rem; font-weight: 700; padding: 0.15rem 0.5rem; border-radius: 4px; white-space: nowrap;
}
.bt-type-badge.type-sub { background: rgba(234, 179, 8, 0.2); border: 1px solid #eab308; color: #fde047; }
.bt-type-badge.type-major { background: rgba(239, 68, 68, 0.2); border: 1px solid #ef4444; color: #fca5a5; }
.bt-type-badge.type-layer { background: rgba(14, 165, 233, 0.2); border: 1px solid #0ea5e9; color: #7dd3fc; }

/* 경지 도약 시인성 극대화 */
.bt-realm-flow { display: inline-flex; align-items: center; gap: 0.45rem; flex-wrap: wrap; }
.bt-realm-chip { font-size: 0.9rem; padding: 0.2rem 0.6rem; border-radius: 5px; font-weight: 700; }
.bt-realm-chip.current { background: #1e293b; color: #cbd5e1; border: 1px solid #334155; }
.bt-realm-arrow { color: #fbbf24; font-weight: 800; font-size: 1rem; }
.bt-realm-chip.target { background: rgba(212, 175, 55, 0.2); color: #fbbf24; border: 1px solid #d4af37; font-weight: 800; }
.bt-realm-badge {
  font-size: 0.72rem; color: #38bdf8; background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.4); padding: 0.15rem 0.4rem; border-radius: 4px; font-weight: 700;
}

/* 2. 모달 바디 (고정 높이 내 Flex 레이아웃) */
.bt-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 0.75rem 1rem;
  gap: 0.55rem;
  overflow: hidden;
}

/* 2-1. 돌파 성공률 대시보드 (눈에 확 들어오는 고대비) */
.bt-rate-box {
  flex-shrink: 0;
  padding: 0.65rem 0.9rem; border-radius: 8px; background: #0f172a; border: 1px solid #1e293b;
}
.bt-rate-box.safe { border-color: #059669; }
.bt-rate-box.warning { border-color: #d97706; }
.bt-rate-box.danger { border-color: #dc2626; }
.bt-rate-header { display: flex; justify-content: space-between; align-items: center; }
.bt-rate-label { font-size: 0.92rem; font-weight: 700; color: #e2e8f0; }
.bt-rate-val-wrap { display: inline-flex; align-items: center; gap: 0.35rem; }
.bt-rate-icon { font-size: 1.25rem; line-height: 1; cursor: help; }
.bt-rate-val { font-size: 1.7rem; font-weight: 800; color: #fbbf24; letter-spacing: -0.5px; }
.bt-rate-box.safe .bt-rate-val { color: #34d399; }
.bt-rate-box.danger .bt-rate-val { color: #f87171; }
.bt-progress-bg { width: 100%; height: 9px; background: #1e293b; border-radius: 999px; overflow: hidden; margin-top: 0.4rem; }
.bt-progress-bar { height: 100%; background: linear-gradient(90deg, #f59e0b, #10b981); transition: width 0.3s ease; }
.bt-rate-box.danger .bt-progress-bar { background: linear-gradient(90deg, #dc2626, #f97316); }

/* 2-2. 처방전 목록 컨테이너 (내부 독립 스크롤) */
.bt-prescription-container {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.bt-section-header {
  flex-shrink: 0; display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.35rem;
}
.bt-section-title { font-size: 0.82rem; font-weight: 700; color: #cbd5e1; }
.bt-section-sub { font-size: 0.7rem; color: #64748b; }

.bt-prescription-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.4rem;
  padding-right: 4px;
}
@media (max-width: 480px) { .bt-prescription-list { grid-template-columns: 1fr; } }

/* 처방 카드 스타일 */
.bt-prescription-card {
  padding: 0.45rem 0.6rem; border-radius: 6px; background: #1e293b; border: 1px solid #334155;
  display: flex; flex-direction: column; gap: 0.2rem; transition: all 0.15s ease;
}
.bt-prescription-card.base.ready { border-color: #059669; background: rgba(6, 78, 59, 0.2); }
.bt-prescription-card.support { cursor: pointer; }
.bt-prescription-card.support:hover:not(.disabled) { border-color: #64748b; background: rgba(30, 41, 59, 0.8); }
.bt-prescription-card.support.selected { border-color: #d4af37; background: rgba(212, 175, 55, 0.12); }
.bt-prescription-card.disabled { opacity: 0.45; cursor: not-allowed; }

.p-top { display: flex; align-items: center; gap: 0.45rem; width: 100%; }
.p-icon { font-size: 1rem; flex-shrink: 0; color: #10b981; }
.bt-prescription-card.support .p-icon { color: #fbbf24; }
.p-name-group { flex: 1; min-width: 0; }
.p-name { font-size: 0.8rem; font-weight: 700; color: #f1f5f9; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-bonus { font-size: 0.76rem; color: #fbbf24; font-weight: 700; }
.p-status { font-size: 0.68rem; color: #94a3b8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-badge { font-size: 0.68rem; padding: 0.12rem 0.4rem; border-radius: 4px; font-weight: 700; white-space: nowrap; }
.p-badge.ok { background: #065f46; color: #6ee7b7; }

/* 보조품 인라인 토글 버튼 */
.btn-support-toggle {
  padding: 0.2rem 0.55rem; font-size: 0.72rem; font-weight: 700; border-radius: 4px;
  border: 1px solid #475569; background: #0f172a; color: #cbd5e1; cursor: pointer;
  white-space: nowrap; transition: all 0.15s ease;
}
.btn-support-toggle:hover:not(:disabled) { border-color: #d4af37; color: #fbbf24; }
.btn-support-toggle.active {
  border-color: #d4af37; background: rgba(212, 175, 55, 0.25); color: #fbbf24;
  box-shadow: 0 0 6px rgba(251, 191, 36, 0.35);
}
.btn-support-toggle:disabled { opacity: 0.5; cursor: not-allowed; }

/* 2-3. 하단 고정 영역 (패널티 스트립 + 액션 버튼) */
.bt-bottom-fixed {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-top: auto;
  padding-top: 0.45rem;
  border-top: 1px solid #1e293b;
}

.bt-risk-strip {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.35rem 0.65rem; border-radius: 6px; font-size: 0.76rem; position: relative;
}
.bt-risk-strip.minor { background: rgba(217, 119, 6, 0.12); border: 1px solid #d97706; color: #fde68a; }
.bt-risk-strip.major { background: rgba(220, 38, 38, 0.15); border: 1px solid #ef4444; color: #fecaca; }
.bt-risk-left { display: flex; align-items: center; gap: 0.4rem; font-weight: 600; }
.risk-summary { font-size: 0.75rem; }
.risk-icon { font-size: 1rem; flex-shrink: 0; }
.bt-risk-tag-wrap { position: relative; display: inline-flex; align-items: center; outline: none; }
.bt-risk-tag {
  display: inline-flex; align-items: center; gap: 0.25rem; padding: 0.15rem 0.45rem;
  border-radius: 4px; font-size: 0.72rem; font-weight: 700; cursor: pointer;
  background: rgba(251, 191, 36, 0.15); border: 1px solid #fbbf24; color: #fbbf24;
  transition: all 0.15s ease; user-select: none; box-shadow: 0 0 6px rgba(251, 191, 36, 0.25);
}
.bt-risk-strip.major .bt-risk-tag { background: rgba(239, 68, 68, 0.18); border-color: #ef4444; color: #fca5a5; box-shadow: 0 0 6px rgba(239, 68, 68, 0.3); }
.bt-risk-tag:hover, .bt-risk-tag-wrap:focus .bt-risk-tag, .bt-risk-tag-wrap:hover .bt-risk-tag { background: #fbbf24; color: #0f172a; }
.bt-risk-strip.major .bt-risk-tag:hover, .bt-risk-strip.major .bt-risk-tag-wrap:focus .bt-risk-tag, .bt-risk-strip.major .bt-risk-tag-wrap:hover .bt-risk-tag { background: #ef4444; color: #fff; }

/* 마우스 오버 팝오버 */
.bt-risk-popover {
  position: absolute; right: 0; bottom: calc(100% + 6px); width: 280px; padding: 0.55rem 0.75rem;
  border-radius: 8px; background: #0f172a; border: 1px solid #d97706; box-shadow: 0 10px 25px rgba(0, 0, 0, 0.85);
  font-size: 0.74rem; line-height: 1.4; color: #e2e8f0; opacity: 0; pointer-events: none; visibility: hidden;
  transition: opacity 0.15s ease, transform 0.15s ease; transform: translateY(4px); z-index: 100;
}
.bt-risk-strip.major .bt-risk-popover { border-color: #ef4444; }
.bt-risk-tag-wrap:hover .bt-risk-popover, .bt-risk-tag-wrap:focus .bt-risk-popover, .bt-risk-tag-wrap:focus-within .bt-risk-popover {
  opacity: 1; pointer-events: auto; visibility: visible; transform: translateY(0);
}
.bt-risk-popover-title { font-weight: 700; color: #fbbf24; margin-bottom: 0.25rem; }
.bt-risk-strip.major .bt-risk-popover-title { color: #f87171; }
.bt-risk-popover-body { color: #cbd5e1; }

/* 최하단 고정 버튼 */
.bt-footer { display: flex; gap: 0.6rem; }
.bt-footer .btn { flex: 1; padding: 0.6rem 0.75rem; font-size: 0.88rem; font-weight: 700; text-align: center; border-radius: 6px; }
.btn-risky {
  background: linear-gradient(180deg, #b91c1c, #991b1b) !important;
  border-color: #ef4444 !important;
  color: #fef2f2 !important;
}
