/* ═══════════════════════════════════════════════
   Token Counter Tool — Styles
   ═══════════════════════════════════════════════ */

.tc-field-label {
  font-family: var(--mono, monospace);
  font-size: 0.65rem;
  color: var(--muted, #888);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tc-field-hint {
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.68rem;
  opacity: .7;
}

/* Quick Samples Bar */
.tc-samples-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed var(--border, #222);
}

.tc-samples-title {
  font-family: var(--mono, monospace);
  font-size: 0.65rem;
  color: var(--muted, #888);
  text-transform: uppercase;
  margin-right: 4px;
}

.tc-sample-chip {
  background: #111;
  border: 1px solid var(--border, #222);
  color: var(--text, #ccc);
  font-family: var(--mono, monospace);
  font-size: 0.7rem;
  padding: 4px 10px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.tc-sample-chip:hover {
  border-color: var(--yellow, #e5b300);
  color: var(--yellow, #e5b300);
  background: rgba(229, 179, 0, 0.05);
}

/* Input Area */
.tc-input-wrap {
  position: relative;
  margin-bottom: 20px;
}

.tc-textarea {
  width: 100%;
  padding: 18px;
  background: #0a0a0a;
  border: 1px solid var(--border, #222);
  font-family: var(--mono, monospace);
  font-size: 0.92rem;
  color: var(--white, #fff);
  line-height: 1.6;
  resize: vertical;
  min-height: 190px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.tc-textarea:focus {
  border-color: var(--yellow, #e5b300);
  box-shadow: 0 0 12px rgba(229, 179, 0, 0.08);
}

/* Primary Model Selector Grid */
.tc-model-grid {
  margin-bottom: 24px;
}

/* Metrics Dashboard Grid */
.tc-metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}

.tc-metric-card {
  padding: 18px 16px;
  background: #0a0a0a;
  border: 1px solid var(--border, #222);
  display: flex;
  flex-direction: column;
  justify-content: center;
  transition: border-color 0.15s, transform 0.15s;
}

.tc-metric-card.primary {
  border-color: rgba(229, 179, 0, 0.35);
  background: linear-gradient(180deg, rgba(229, 179, 0, 0.04) 0%, #0a0a0a 100%);
}

.tc-metric-card:hover {
  border-color: var(--yellow, #e5b300);
  transform: translateY(-2px);
}

.tc-metric-label {
  font-family: var(--mono, monospace);
  font-size: 0.6rem;
  color: var(--muted, #888);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.tc-metric-val {
  font-family: var(--cond, sans-serif);
  font-size: 2.1rem;
  font-weight: 900;
  line-height: 1.1;
  color: var(--yellow, #e5b300);
  word-break: break-all;
}

.tc-metric-sub {
  font-family: var(--mono, monospace);
  font-size: 0.65rem;
  color: var(--muted, #888);
  margin-top: 6px;
}

/* Context Progress Bar Card */
.tc-context-bar-card {
  background: #0a0a0a;
  border: 1px solid var(--border, #222);
  padding: 14px 18px;
  margin-bottom: 24px;
}

.tc-context-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.tc-context-title {
  font-family: var(--mono, monospace);
  font-size: 0.65rem;
  color: var(--muted, #888);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.tc-context-stats {
  font-family: var(--mono, monospace);
  font-size: 0.75rem;
  color: var(--white, #fff);
}

.tc-progress-bg {
  width: 100%;
  height: 8px;
  background: #181818;
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.tc-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--green, #00c875) 0%, var(--yellow, #e5b300) 80%, #ff4d4f 100%);
  border-radius: 4px;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.tc-context-note {
  font-family: var(--mono, monospace);
  font-size: 0.68rem;
  color: var(--muted, #888);
  margin-top: 8px;
}

/* Cross-Model Cost Table */
.tc-table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--border, #222);
  margin-bottom: 24px;
  background: #0a0a0a;
}

.tc-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--mono, monospace);
  font-size: 0.78rem;
  text-align: left;
}

.tc-table th {
  background: #111;
  padding: 12px 14px;
  color: var(--muted, #888);
  font-weight: normal;
  text-transform: uppercase;
  font-size: 0.65rem;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--border, #222);
}

.tc-table td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--text, #ddd);
}

.tc-table tr:last-child td {
  border-bottom: none;
}

.tc-table tr.active-row {
  background: rgba(229, 179, 0, 0.05);
}

.tc-table tr.active-row td {
  color: #fff;
  font-weight: bold;
}

.tc-badge-model {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 2px;
  font-size: 0.65rem;
  background: #1c1c1c;
  color: var(--yellow, #e5b300);
}

/* Token Visualizer Section */
.tc-visual-section {
  border: 1px solid var(--border, #222);
  background: #0a0a0a;
  padding: 16px;
  margin-bottom: 20px;
}

.tc-visual-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border, #222);
}

.tc-visual-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.tc-token-legend-item {
  font-family: var(--mono, monospace);
  font-size: 0.65rem;
  color: var(--muted, #888);
  display: flex;
  align-items: center;
  gap: 5px;
}

.tc-legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  display: inline-block;
}

.color-1 { background: rgba(59, 130, 246, 0.35); border: 1px solid #3b82f6; }
.color-2 { background: rgba(16, 185, 129, 0.35); border: 1px solid #10b981; }
.color-3 { background: rgba(245, 158, 11, 0.35); border: 1px solid #f59e0b; }
.color-4 { background: rgba(236, 72, 153, 0.35); border: 1px solid #ec4899; }

.tc-visual-box {
  min-height: 100px;
  max-height: 280px;
  overflow-y: auto;
  font-family: var(--mono, monospace);
  font-size: 0.85rem;
  line-height: 1.8;
  padding: 10px;
  background: #050505;
  border: 1px solid rgba(255, 255, 255, 0.05);
  word-break: break-word;
  white-space: pre-wrap;
}

.tc-token-chunk {
  display: inline;
  padding: 2px 2px;
  margin: 0;
  border-radius: 2px;
  transition: all 0.12s ease;
}

.tc-token-chunk:hover {
  filter: brightness(1.3);
  text-decoration: underline;
}

.tc-chunk-0 { background: rgba(59, 130, 246, 0.22); color: #93c5fd; }
.tc-chunk-1 { background: rgba(16, 185, 129, 0.22); color: #6ee7b7; }
.tc-chunk-2 { background: rgba(245, 158, 11, 0.22); color: #fde68a; }
.tc-chunk-3 { background: rgba(236, 72, 153, 0.22); color: #fbcfe8; }

.tc-empty-notice {
  color: var(--muted, #666);
  font-style: italic;
  font-size: 0.78rem;
}

/* Composition Analysis Panel */
.tc-analysis-panel {
  border: 1px solid var(--border, #222);
  background: #0a0a0a;
  padding: 16px 20px;
  margin-bottom: 24px;
}

.tc-analysis-title {
  font-family: var(--mono, monospace);
  font-size: 0.65rem;
  color: var(--muted, #888);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.tc-analysis-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px 24px;
}

.tc-analysis-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--mono, monospace);
  font-size: 0.75rem;
  padding-bottom: 6px;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.06);
}

.tc-a-label {
  color: var(--muted, #888);
}

.tc-a-val {
  color: var(--yellow, #e5b300);
  font-weight: bold;
}

/* Tips Grid */
.tc-tips-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.tc-tip-card {
  background: #0a0a0a;
  border: 1px solid var(--border, #222);
  padding: 18px;
}

.tc-tip-card h4 {
  font-family: var(--mono, monospace);
  font-size: 0.85rem;
  color: var(--yellow, #e5b300);
  margin: 0 0 8px 0;
}

.tc-tip-card p {
  font-size: 0.8rem;
  color: var(--muted, #999);
  line-height: 1.5;
  margin: 0;
}

/* FAQ Items */
.tc-faq-item {
  border-bottom: 1px solid var(--border, #222);
}

.tc-faq-q {
  width: 100%;
  padding: 16px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: none;
  border: none;
  color: var(--white, #fff);
  font-family: var(--mono, monospace);
  font-size: 0.82rem;
  text-align: left;
  cursor: pointer;
  outline: none;
}

.tc-faq-q:hover {
  color: var(--yellow, #e5b300);
}

.tc-faq-icon {
  color: var(--yellow, #e5b300);
  font-weight: bold;
  font-size: 1rem;
  transition: transform 0.2s ease;
}

.tc-faq-a {
  padding: 0 0 16px 0;
  font-size: 0.8rem;
  color: var(--muted, #999);
  line-height: 1.6;
  display: none;
}

.tc-faq-a.open {
  display: block;
}

/* Responsive queries */
@media (max-width: 900px) {
  .tc-metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .tc-analysis-grid,
  .tc-tips-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 580px) {
  .tc-metrics-grid {
    grid-template-columns: 1fr;
  }
}
