@charset "UTF-8";

.text-counter-page {
  max-width: 1180px;
  margin: 0 auto;
  padding: 8px 0 40px;
}

/* 상단 */
.text-counter-page .utility-top {
  text-align: center;
  padding: 30px 20px 28px;
}

.text-counter-page .utility-label {
  display: inline-flex;
  margin-bottom: 12px;
  padding: 6px 13px;
  border-radius: 999px;
  background: #ecfeff;
  color: #155e75;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.text-counter-page .utility-title {
  margin: 0;
  font-size: clamp(32px, 4vw, 44px);
  font-weight: 900;
  letter-spacing: -0.04em;
  color: #0f172a;
}

.text-counter-page .utility-desc {
  max-width: 820px;
  margin: 16px auto 0;
  color: #64748b;
  font-size: 15px;
  line-height: 1.8;
}

/* 요약 카드 */
.text-counter-summary-card {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.text-counter-summary-item {
  padding: 20px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 20px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.06);
}

.text-counter-summary-item::before {
  content: "";
  display: block;
  width: 34px;
  height: 4px;
  margin-bottom: 14px;
  border-radius: 999px;
  background: linear-gradient(90deg, #06b6d4, #2563eb);
}

.text-counter-summary-item strong {
  display: block;
  margin-bottom: 7px;
  font-size: 15px;
  font-weight: 900;
  color: #0f172a;
}

.text-counter-summary-item span {
  font-size: 13px;
  color: #64748b;
  line-height: 1.6;
}

/* 카드 */
.text-counter-editor-card,
.text-counter-result-card {
  padding: 28px;
  margin-bottom: 24px;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 24px;
  background: #ffffff;
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.08);
}

.text-counter-card-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 24px;
}

.text-counter-card-head h2 {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -0.03em;
  color: #0f172a;
}

.text-counter-card-head p {
  margin: 0;
  font-size: 14px;
  color: #64748b;
  line-height: 1.6;
}

.text-counter-head-actions {
  display: flex;
  flex-wrap: nowrap;
  justify-content: flex-end;
  gap: 10px;
  min-width: 320px;
}

.text-counter-page .utility-field-label {
  display: block;
  margin-bottom: 10px;
  font-weight: 900;
  color: #0f172a;
}

/* 입력창 */
.text-counter-textarea {
  width: 100%;
  min-height: 300px;
  resize: vertical;
  border-radius: 22px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: #ffffff;
  padding: 20px 18px;
  font-size: 16px;
  line-height: 1.75;
  color: #0f172a;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.03);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.text-counter-textarea::placeholder {
  color: #94a3b8;
}

.text-counter-textarea:focus {
  outline: none;
  border-color: #38bdf8;
  background: #ffffff;
  box-shadow:
    0 0 0 4px rgba(6, 182, 212, 0.1),
    inset 0 1px 2px rgba(15, 23, 42, 0.03);
}

/* 버튼 */
.text-counter-page .utility-btn {
  min-height: 46px;
  padding: 0 20px;
  border-radius: 14px;
  font-weight: 800;
}

.text-counter-page .utility-btn-primary {
  background: linear-gradient(135deg, #0f172a, #164e63);
  color: #ffffff;
  border-color: #0f172a;
}

.text-counter-page .utility-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.18);
}

/* 상태 배지 */
.text-counter-status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 82px;
  padding: 8px 13px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

/* 결과 카드 */
.counter-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.counter-box {
  position: relative;
  overflow: hidden;
  min-height: 132px;
  padding: 22px 20px;
  border-radius: 22px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  box-shadow:
    0 12px 28px rgba(15, 23, 42, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.counter-box::after {
  content: "";
  position: absolute;
  right: -20px;
  bottom: -40px;
  width: 110px;
  height: 110px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(6, 182, 212, 0.08) 0%, rgba(6, 182, 212, 0) 72%);
  pointer-events: none;
}

.counter-box-full {
  grid-column: span 4;
}

.counter-label {
  margin: 0 0 14px;
  font-size: 14px;
  font-weight: 800;
  color: #475569;
  letter-spacing: -0.01em;
}

.counter-value {
  display: block;
  font-size: clamp(34px, 4vw, 52px);
  line-height: 1;
  font-weight: 900;
  color: #0f172a;
  letter-spacing: -0.05em;
}

.text-counter-result-box {
  min-height: 100px;
  margin-top: 20px;
  padding: 20px;
  border-radius: 18px;
  border: 1px solid rgba(6, 182, 212, 0.2);
  background: linear-gradient(135deg, #ecfeff, #eff6ff);
  color: #155e75;
  line-height: 1.8;
  white-space: pre-wrap;
  box-shadow: none;
}

/* 도움말 */
.text-counter-page .help-panel {
  margin-top: 30px;
}

.text-counter-page .help-panel > h2 {
  margin: 0 0 18px;
  font-size: 28px;
  font-weight: 900;
  letter-spacing: -0.03em;
  color: #0f172a;
}

.text-counter-page .help-box {
  border-radius: 22px;
}

.text-counter-page .help-toggle-box summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  list-style: none;
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.5;
  color: #0f172a;
}

.text-counter-page .help-toggle-box summary::-webkit-details-marker {
  display: none;
}

.text-counter-page .help-toggle-box summary::after {
  content: "+";
  font-size: 1.2rem;
  font-weight: 700;
  color: #64748b;
}

.text-counter-page .help-toggle-box[open] summary::after {
  content: "−";
}

.text-counter-page .help-toggle-content {
  margin-top: 14px;
}

.text-counter-page .help-toggle-content p {
  margin: 0;
  line-height: 1.8;
  color: #334155;
}

/* 반응형 */
@media (max-width: 960px) {
  .counter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .counter-box-full {
    grid-column: span 2;
  }
}

@media (max-width: 900px) {
  .text-counter-card-head {
    grid-template-columns: 1fr;
  }

  .text-counter-head-actions {
    min-width: 0;
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }
}

@media (max-width: 768px) {
  .text-counter-page {
    padding: 0 0 28px;
  }

  .text-counter-page .utility-top {
    padding: 24px 14px 22px;
  }

  .text-counter-summary-card {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .text-counter-editor-card,
  .text-counter-result-card {
    padding: 22px;
    border-radius: 20px;
  }

  .text-counter-head-actions,
  .text-counter-head-actions .utility-btn {
    width: 100%;
  }

  .text-counter-textarea {
    min-height: 230px;
    padding: 16px 14px;
    border-radius: 18px;
    font-size: 15px;
  }

  .counter-grid {
    grid-template-columns: 1fr;
  }

  .counter-box-full {
    grid-column: auto;
  }

  .counter-box {
    min-height: 108px;
    padding: 20px 18px;
    border-radius: 18px;
  }

  .text-counter-page .utility-title {
    font-size: 32px;
  }
}