/* Case Converter Styles */
.case-tool-wrap {
  /* Dynamic integration with site-wide CSS variables */
  --color-text-primary: var(--text, #000000);
  --color-text-secondary: var(--text-muted, #585859);
  --color-text-tertiary: var(--text-muted, #585859);
  --color-border-primary: var(--navy, #000000);
  --color-border-secondary: var(--border, #e2e2e3);
  --color-border-tertiary: var(--border, #e2e2e3);
  --color-border-subtle: rgba(0, 0, 0, 0.05);
  --color-background-primary: var(--white, #ffffff);
  --color-background-secondary: var(--gray-50, #f8f8f8);
  --font-sans: var(--font-body, 'Google Sans Flex', sans-serif);
  
  --border-radius-md: 8px;
  --border-radius-lg: 12px;

  /* Local color overrides and theme fallbacks */
  --color-border-success: #a0dca0;
  --color-background-success: #eef7ee;
  --color-text-success: #2e6930;

  --color-border-info: #a0c0f0;
  --color-background-info: #ebf3fe;
  --color-text-info: #2b6cb0;

  max-width: 600px;
  margin: 0 auto;
  padding: 0 0 24px;
  font-family: var(--font-sans);
}

.case-input-section {
  margin-bottom: 0.75rem;
}

.lbl {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--color-text-tertiary);
  margin-bottom: 6px;
}

textarea {
  width: 100%;
  font-size: 13px;
  line-height: 1.5;
  resize: vertical;
  min-height: 80px;
  padding: 8px 10px;
  border: 0.5px solid var(--color-border-tertiary);
  border-radius: var(--border-radius-md);
  background: var(--color-background-secondary);
  color: var(--color-text-primary);
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

textarea:focus {
  border-color: var(--color-border-primary);
  box-shadow: 0 0 0 2px var(--color-border-subtle);
}

.stats-row {
  display: flex;
  gap: 6px;
  margin-top: 6px;
  flex-wrap: wrap;
}

.stat-pill {
  font-size: 11px;
  color: var(--color-text-tertiary);
  background: var(--color-background-secondary);
  border-radius: 99px;
  padding: 2px 8px;
  border: 0.5px solid var(--color-border-tertiary);
}

.stat-pill b {
  color: var(--color-text-primary);
  font-weight: 500;
}

.case-divider {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-tertiary);
  margin: 12px 0 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.case-divider::after {
  content: '';
  flex: 1;
  height: 0.5px;
  background: var(--color-border-tertiary);
}

.case-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.case-card {
  background: var(--color-background-primary);
  border: 0.5px solid var(--color-border-tertiary);
  border-radius: var(--border-radius-md);
  padding: 8px 12px;
  cursor: pointer;
  transition: all 0.12s ease;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.case-card:hover {
  border-color: var(--color-border-secondary);
  background: var(--color-background-secondary);
}

.case-card.copied {
  border-color: var(--color-border-success);
  background: var(--color-background-success);
}

.case-card.active-highlight {
  border: 1px solid var(--color-border-info);
  background: var(--color-background-info);
}

.case-name {
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-tertiary);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.copy-status {
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-success);
  display: flex;
  align-items: center;
  gap: 3px;
  opacity: 0;
  transition: opacity 0.12s ease;
}

.case-card.copied .copy-status {
  opacity: 1;
}

.case-name span {
  font-size: 10px;
}

.case-card.copied .case-name {
  color: var(--color-text-success);
}

.case-out {
  font-size: 13px;
  color: var(--color-text-primary);
  word-break: break-all;
  line-height: 1.4;
}

.case-card.copied .case-out {
  color: var(--color-text-success);
}

.case-card.active-highlight .case-name,
.case-card.active-highlight .case-out {
  color: var(--color-text-info);
}

.tag {
  font-size: 9px;
  padding: 1px 5px;
  border-radius: 99px;
  font-weight: 500;
  text-transform: lowercase;
}

.tag-code {
  background: rgba(142, 132, 233, 0.15);
  color: #8e84e9;
}

.tag-creative {
  background: rgba(226, 132, 163, 0.15);
  color: #e284a3;
}

.tag-text {
  background: rgba(94, 226, 198, 0.15);
  color: #4da692;
}

.case-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.case-actions button {
  flex: 1;
  min-width: 100px;
  font-size: 12px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 8px 12px;
  border: 0.5px solid var(--color-border-tertiary);
  border-radius: var(--border-radius-md);
  background: var(--color-background-primary);
  color: var(--color-text-primary);
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s ease;
}

.case-actions button:hover {
  background: var(--color-background-secondary);
  border-color: var(--color-border-secondary);
}

/* Copy All - solid primary button styling */
.case-actions button:first-child {
  background: var(--color-text-primary);
  color: var(--color-background-primary);
  border-color: var(--color-text-primary);
}

.case-actions button:first-child:hover {
  background: var(--color-text-secondary);
  border-color: var(--color-text-secondary);
  color: var(--color-background-primary);
}

/* Fix content-right table responsive overflow
   Overrides the global style.scss display:block rule with higher specificity.
   Tables inside .content-right render as proper HTML tables,
   so they should use normal table layout with word-break on small screens. */
.tool-content .content-right table {
  display: table;
  overflow-x: auto;
  white-space: normal;
  width: 100%;
  max-width: 100%;
  border-collapse: collapse;
  margin: 16px 0 0 0;
  border: 0.5px solid var(--color-border-tertiary);
  border-radius: var(--border-radius-md);
  overflow: hidden;
}

.tool-content .content-right th,
.tool-content .content-right td {
  padding: 10px 12px;
  text-align: left;
  font-size: 13px;
  line-height: 1.4;
  white-space: normal;
  word-break: break-word;
}

.tool-content .content-right th {
  font-weight: 600;
  color: var(--color-text-primary);
  background: var(--color-background-secondary);
  border-bottom: 0.5px solid var(--color-border-tertiary);
}

.tool-content .content-right td {
  color: var(--color-text-secondary);
  border-bottom: 0.5px solid var(--color-border-tertiary);
  background: var(--color-background-primary);
}

.tool-content .content-right tr:last-child td {
  border-bottom: none;
}

.tool-content .content-right code {
  font-family: var(--font-family-mono, monospace);
  font-size: 12px;
  padding: 2px 6px;
  background: var(--color-background-secondary);
  border: 0.5px solid var(--color-border-tertiary);
  border-radius: 4px;
  color: var(--color-text-primary);
}

@media (max-width: 768px) {
  .tool-content .content-right table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}