/* ============================================
   학점 GPA 계산기 전용 스타일
   ============================================ */

/* 만점 기준 토글 */
.scale-toggle-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.scale-label {
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--text-primary, #1e293b);
}

html.dark .scale-label { color: #e2e8f0; }

.scale-toggle {
  display: flex;
  border: 1px solid var(--glass-border, #E0DED6);
  border-radius: 0.5rem;
  overflow: hidden;
}

.scale-btn {
  padding: 0.375rem 1rem;
  background: transparent;
  border: none;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary, #64748b);
  cursor: pointer;
  transition: all 0.15s;
}

.scale-btn.active {
  background: #D97757;
  color: #fff;
}

.scale-btn:not(.active):hover {
  background: rgba(217,119,87,0.1);
  color: #D97757;
}

/* 과목 목록 헤더 */
.subjects-header {
  display: grid;
  grid-template-columns: 1fr 80px 130px 40px;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: rgba(0,0,0,0.04);
  border-radius: 0.5rem;
  margin-bottom: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary, #64748b);
}

html.dark .subjects-header { background: rgba(255,255,255,0.04); }

/* 과목 행 */
.subject-row {
  display: grid;
  grid-template-columns: 1fr 80px 130px 40px;
  gap: 0.5rem;
  align-items: center;
  padding: 0.375rem 0;
  border-bottom: 1px solid var(--glass-border, #E0DED6);
}

.subject-row:last-child { border-bottom: none; }

.subject-name-input {
  width: 100%;
  padding: 0.375rem 0.625rem;
  border: 1px solid var(--glass-border, #E0DED6);
  border-radius: 0.375rem;
  background: var(--glass-bg, #fff);
  color: var(--text-primary, #1e293b);
  font-size: 0.875rem;
}

html.dark .subject-name-input {
  background: rgba(15,23,42,0.8);
  border-color: #334155;
  color: #e2e8f0;
}

.subject-name-input:focus {
  outline: none;
  border-color: #D97757;
}

.subject-credit-select,
.subject-grade-select {
  width: 100%;
}

.remove-subject-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 0.375rem;
  border: 1px solid #fca5a5;
  background: #fff1f2;
  color: #dc2626;
  cursor: pointer;
  transition: all 0.15s;
  font-size: 0.875rem;
  flex-shrink: 0;
}

html.dark .remove-subject-btn {
  background: rgba(220,38,38,0.15);
  border-color: #991b1b;
  color: #fca5a5;
}

.remove-subject-btn:hover { background: #fecaca; }

/* 과목 추가/초기화 버튼 */
.subject-actions {
  display: flex;
  gap: 0.75rem;
  margin: 1rem 0;
  flex-wrap: wrap;
}

/* 결과 카드 */
.gpa-result-card {
  background: var(--glass-bg, rgba(255,255,255,0.9));
  border: 1px solid var(--glass-border, #E0DED6);
  border-radius: 1rem;
  padding: 2rem;
  margin-top: 1.5rem;
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
  align-items: center;
}

.gpa-display-area {
  text-align: center;
  flex-shrink: 0;
}

.gpa-main {
  display: flex;
  align-items: baseline;
  gap: 0.25rem;
  justify-content: center;
}

.gpa-value {
  font-size: 3.5rem;
  font-weight: 900;
  color: #D97757;
  line-height: 1;
}

.gpa-max {
  font-size: 1.25rem;
  color: var(--text-secondary, #94a3b8);
  font-weight: 600;
}

.gpa-label {
  font-size: 0.875rem;
  color: var(--text-secondary, #64748b);
  margin-top: 0.25rem;
}

.gpa-summary {
  flex: 1;
  min-width: 180px;
}

.gpa-summary-item {
  display: flex;
  justify-content: space-between;
  padding: 0.375rem 0;
  font-size: 0.9375rem;
  border-bottom: 1px solid var(--glass-border, #E0DED6);
  color: var(--text-primary, #1e293b);
}

html.dark .gpa-summary-item { color: #e2e8f0; }

.gpa-summary-item:last-child { border-bottom: none; }

.gpa-summary-item .summary-label { color: var(--text-secondary, #64748b); }

.gpa-summary-item .summary-value { font-weight: 700; }

/* 성적 분포 */
.gpa-distribution {
  margin-top: 1.25rem;
  background: var(--glass-bg, rgba(255,255,255,0.9));
  border: 1px solid var(--glass-border, #E0DED6);
  border-radius: 0.75rem;
  padding: 1.25rem;
}

.distribution-title {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text-primary, #1e293b);
  margin-bottom: 1rem;
}

html.dark .distribution-title { color: #e2e8f0; }

.dist-bar-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
}

.dist-bar-label {
  width: 36px;
  text-align: right;
  font-weight: 700;
  color: var(--text-secondary, #64748b);
  flex-shrink: 0;
}

.dist-bar-track {
  flex: 1;
  height: 8px;
  background: #e2e8f0;
  border-radius: 4px;
  overflow: hidden;
}

html.dark .dist-bar-track { background: #334155; }

.dist-bar-fill {
  height: 100%;
  border-radius: 4px;
  background: #D97757;
  transition: width 0.4s ease;
}

.dist-bar-count {
  width: 48px;
  font-size: 0.8125rem;
  color: var(--text-secondary, #64748b);
  flex-shrink: 0;
}

/* 목표 GPA 폼 */
.target-gpa-form {
  background: var(--glass-bg, rgba(255,255,255,0.9));
  border: 1px solid var(--glass-border, #E0DED6);
  border-radius: 0.75rem;
  padding: 1.5rem;
}

.tgpa-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.tgpa-field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.tgpa-field label {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text-primary, #1e293b);
}

html.dark .tgpa-field label { color: #e2e8f0; }

.score-input-wrap {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.score-input-wrap .form-input { flex: 1; }

.input-suffix {
  font-weight: 600;
  color: var(--text-secondary, #64748b);
  white-space: nowrap;
  font-size: 0.875rem;
}

.target-gpa-result {
  margin-top: 1.25rem;
  background: rgba(217,119,87,0.1);
  border: 1px solid rgba(217,119,87,0.3);
  border-radius: 0.5rem;
  padding: 1rem 1.25rem;
  font-size: 0.9375rem;
  color: var(--text-primary, #1e293b);
  line-height: 1.7;
}

html.dark .target-gpa-result { color: #e2e8f0; }

.target-gpa-result strong { color: #D97757; }

/* 반응형 */
@media (max-width: 768px) {
  .subjects-header { display: none; }

  .subject-row {
    grid-template-columns: 1fr 70px 120px 36px;
    gap: 0.375rem;
  }

  .gpa-result-card {
    flex-direction: column;
    gap: 1rem;
    padding: 1.25rem;
  }

  .gpa-value { font-size: 2.75rem; }

  .tgpa-row { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 400px) {
  .subject-row {
    grid-template-columns: 1fr 60px 100px 32px;
  }
}
