/* Text Tools - Text Analyzer Styling */

.text-analyzer {
  max-width: 800px !important; /* 텍스트 분석기는 넓은 레이아웃이 필요하므로 800px로 확장 */
  margin: 0 auto;
}

/* 텍스트 에디터 컨테이너 */
.text-editor-container {
  position: relative;
  width: 100%;
  margin-bottom: 20px;
}

#text-analyzer-input {
  width: 100%;
  height: 280px;
  padding: 16px;
  padding-right: 48px; /* Clear 버튼을 위한 여백 */
  border: 1px solid var(--border-color, #e9e9e6);
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text-primary, #37352f);
  background-color: var(--bg-primary, #ffffff);
  resize: vertical;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#text-analyzer-input:focus {
  border-color: var(--accent-blue, #2383e2);
  box-shadow: 0 0 0 3px rgba(35, 131, 226, 0.15);
}

/* 텍스트 지우기 버튼 */
.btn-clear-text {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background-color: var(--bg-secondary, #f1f1ef);
  color: var(--text-secondary, #787774);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s ease, background-color 0.2s ease;
}

.text-editor-container:hover .btn-clear-text,
#text-analyzer-input:focus + .btn-clear-text,
.btn-clear-text:focus {
  opacity: 1;
}

.btn-clear-text:hover {
  background-color: #e3e2e0;
  color: var(--text-primary, #37352f);
}

/* 분석 통계 그리드 */
.text-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.text-stats-grid .stat-card {
  background-color: var(--bg-secondary, #fbfbfa);
  border: 1px solid var(--border-color, #e9e9e6);
  border-radius: 8px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 84px;
  box-sizing: border-box;
}

.text-stats-grid .stat-label {
  font-size: 0.8rem;
  color: var(--text-secondary, #787774);
  font-weight: 500;
  margin-bottom: 8px;
}

.text-stats-grid .stat-value {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-primary, #37352f);
  font-family: var(--font-mono, monospace);
  line-height: 1.2;
}

/* 바이트 정보 카드 내부 복합 레이아웃 */
.stat-value-multiline {
  display: flex;
  flex-direction: column;
  gap: 4px;
  justify-content: flex-end;
}

.stat-value-multiline .byte-sub {
  font-size: 0.85rem;
  color: var(--text-secondary, #787774);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.stat-value-multiline .byte-lbl {
  font-weight: 500;
}

.stat-value-multiline strong {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary, #37352f);
  font-family: var(--font-mono, monospace);
}

/* 텍스트 툴바 */
.text-toolbar {
  background-color: var(--bg-secondary, #fbfbfa);
  border: 1px solid var(--border-color, #e9e9e6);
  border-radius: 8px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.toolbar-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toolbar-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary, #787774);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.toolbar-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.btn-toolbar-action {
  padding: 8px 14px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-primary, #37352f);
  background-color: var(--bg-primary, #ffffff);
  border: 1px solid var(--border-color, #e9e9e6);
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.1s ease;
}

.btn-toolbar-action:hover {
  background-color: var(--bg-secondary, #f1f1ef);
  border-color: #d3d2cf;
}

.btn-toolbar-action:active {
  transform: scale(0.98);
}

.toolbar-action-group {
  margin-top: 8px;
  border-top: 1px solid var(--border-color, #e9e9e6);
  padding-top: 16px;
  display: flex;
  justify-content: flex-end;
}

.toolbar-action-group .btn-calc.eq {
  min-width: 180px;
  padding: 10px 20px;
  font-size: 0.95rem;
}

/* Notion 스타일의 플로팅 토스트 팝업 */
.toast-notification {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background-color: var(--text-primary, #37352f);
  color: var(--bg-primary, #ffffff);
  padding: 10px 18px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 9999;
  opacity: 0;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s ease;
  pointer-events: none;
}

.toast-notification.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.toast-icon {
  font-size: 1rem;
}
