/* ========================================================================== */
/* Toolsgi Character Counter – Frontend Styles                                 */
/* Purpose: Vibrant, futuristic, mobile-first, card-based UI with animations, */
/* emojis, sounds, and clear responsive layout inspired by dashboard styles.  */
/* Author: P. Adhil Khan (https://toolsgi.com)                                */
/* ========================================================================== */

/* Root variables for theme colors and effects */
:root {
  --tcc-radius: 14px;
  --tcc-gap: 16px;
  --tcc-shadow: 0 10px 26px rgba(13,18,40,0.08), 0 2px 10px rgba(13,18,40,0.06);
  --tcc-primary: #6c5ce7;
  --tcc-accent: #00d4ff;
  --tcc-success: #00c853;
  --tcc-danger: #ff4757;
  --tcc-warning: #ffa502;
  --tcc-bg: #0f1222;
  --tcc-card-bg: #151833;
  --tcc-text-primary: #eef1ff;
  --tcc-text-muted: #8b90b6;
  --tcc-grid-border: rgba(255,255,255,0.10);
  --tcc-focus-shadow: 0 0 0 4px rgba(108,92,231,0.6);
  --tcc-transition-speed: 0.22s;
  --tcc-font-family: 'Arial', Helvetica, sans-serif;
}

/* Global reset and base styles */
.tcc-app {
  background-color: var(--tcc-bg);
  color: var(--tcc-text-primary);
  font-family: var(--tcc-font-family);
  font-weight: 400;
  padding: 20px;
  border-radius: var(--tcc-radius);
  max-width: 960px;
  margin: 16px auto;
  box-shadow: var(--tcc-shadow);
  user-select: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Header & Branding */
.tcc-app__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--tcc-gap);
  margin-bottom: 20px;
}

.tcc-brand {
  font-weight: 800;
  font-size: 22px;
  letter-spacing: 0.3px;
  color: var(--tcc-primary);
  display: flex;
  align-items: center;
  gap: 12px;
}

.tcc-badge {
  background-color: rgba(108,92,231,0.25);
  color: var(--tcc-primary);
  font-size: 12px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 9999px;
  text-transform: uppercase;
  box-shadow: 0 1px 8px rgba(108,92,231,0.8);
  user-select: none;
  cursor: default;
}

/* Action buttons container */
.tcc-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: flex-end;
}

.tcc-btn {
  appearance: none;
  border: none;
  border-radius: 16px;
  padding: 12px 20px;
  background: var(--tcc-card-bg);
  color: var(--tcc-text-primary);
  font-size: 15px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: var(--tcc-shadow);
  cursor: pointer;
  text-align: center;
  transition: background-color var(--tcc-transition-speed), box-shadow var(--tcc-transition-speed);
  user-select: none;
  outline: none;
}

.tcc-btn:hover,
.tcc-btn:focus {
  background-color: var(--tcc-primary);
  box-shadow: 0 0 14px var(--tcc-primary);
  color: #0b0e23;
  outline-offset: 2px;
  outline: 2px solid var(--tcc-primary);
}

.tcc-btn--primary {
  background: linear-gradient(135deg, var(--tcc-primary), var(--tcc-accent));
  color: #fff;
  box-shadow: 0 0 14px var(--tcc-accent);
}

.tcc-btn--primary:hover,
.tcc-btn--primary:focus {
  background: linear-gradient(135deg, var(--tcc-accent), var(--tcc-primary));
  box-shadow: 0 0 20px var(--tcc-accent);
  color: #0b0e23;
}

.tcc-btn--ghost {
  background: transparent;
  color: var(--tcc-text-primary);
  border: 2px solid var(--tcc-grid-border);
  font-weight: 700;
  padding: 10px 18px;
}

.tcc-btn--ghost:hover,
.tcc-btn--ghost:focus {
  background: var(--tcc-primary);
  color: #0b0e23;
  border-color: var(--tcc-primary);
  box-shadow: 0 0 15px var(--tcc-primary);
}

/* Responsive grid layout for panels and stats */
.tcc-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--tcc-gap);
}

/* Card components */
.tcc-card {
  background-color: var(--tcc-card-bg);
  border: 1px solid var(--tcc-grid-border);
  border-radius: var(--tcc-radius);
  padding: 20px 24px;
  box-shadow: var(--tcc-shadow);
  display: flex;
  flex-direction: column;
  gap: 12px;
  color: var(--tcc-text-primary);
}

.tcc-card--sm { grid-column: span 4; }
.tcc-card--md { grid-column: span 6; }
.tcc-card--lg { grid-column: span 8; }
.tcc-card--xl { grid-column: span 12; }

@media (max-width: 900px) {
  .tcc-card--sm, .tcc-card--md, .tcc-card--lg, .tcc-card--xl {
    grid-column: span 12;
  }
}

/* Editor panel */
.tcc-editor-wrap {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.tcc-editor {
  width: 100%;
  min-height: 280px;
  padding: 14px 18px;
  font-size: 18px;
  line-height: 1.7;
  background-color: #0b0f2a;
  border: 2px solid var(--tcc-grid-border);
  border-radius: 16px;
  color: var(--tcc-text-primary);
  font-weight: 500;
  outline: none;
  resize: vertical;
  transition: border-color var(--tcc-transition-speed);
  font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.tcc-editor::selection {
  background-color: var(--tcc-primary);
  color: #fff;
}

.tcc-editor:focus {
  border-color: var(--tcc-primary);
  box-shadow: 0 0 18px var(--tcc-primary);
}

/* Toolbar (inside editor card) */
.tcc-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* Live counters */
.tcc-stats {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 16px;
}

.tcc-stat {
  grid-column: span 6;
  padding: 14px 20px;
  background: linear-gradient(180deg, rgba(108,92,231,0.22), rgba(0,212,255,0.10));
  border-radius: 16px;
  font-weight: 600;
  text-align: center;
  color: var(--tcc-text-primary);
  box-shadow:
    inset 0 3px 6px 2px rgba(255, 255, 255, 0.15),
    0 2px 10px rgba(108,92,231,0.3);
  user-select: none;
  transition: box-shadow 0.25s ease;
}

.tcc-stat:hover,
.tcc-stat:focus-within {
  box-shadow:
    inset 0 4px 8px 3px rgba(255, 255, 255, 0.25),
    0 4px 16px rgba(108,92,231,0.45);
  cursor: default;
}

.tcc-stat__label {
  font-size: 12px;
  color: var(--tcc-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-bottom: 8px;
}

.tcc-stat__value {
  font-size: 24px;
  font-weight: 700;
}

/* Details panel and other toggle panels */
.tcc-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tcc-panel__row {
  display: flex;
  justify-content: space-between;
  border-radius: 12px;
  padding: 12px 16px;
  background: rgba(108, 92, 231, 0.15);
  box-shadow: inset 0 1px 6px rgba(255, 255, 255, 0.10);
  font-weight: 600;
  user-select: none;
}

.tcc-panel__label {
  color: var(--tcc-text-muted);
  font-size: 13px;
  letter-spacing: 0.03em;
}

.tcc-panel__value {
  font-size: 15px;
}

/* Progress bar (Goal) */
.tcc-progress {
  border-radius: 20px;
  background: rgba(255,255,255,0.05);
  height: 14px;
  overflow: hidden;
  box-shadow: inset 0 0 6px rgba(0,0,0,0.2);
}

.tcc-progress__bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--tcc-primary), var(--tcc-accent));
  transition: width 0.3s ease;
}

/* Toast notifications and popup */
.tcc-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(16px);
  background: linear-gradient(135deg, var(--tcc-primary), var(--tcc-accent));
  color: #0a0a0a;
  padding: 14px 28px;
  border-radius: 22px;
  font-weight: 700;
  font-size: 14px;
  text-align: center;
  box-shadow: 0 5px 22px rgba(108,92,231,0.55);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 99999;
  user-select: none;
}

.tcc-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

/* Table styles for keyword density */
.tcc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  background: var(--tcc-card-bg);
  border-radius: var(--tcc-radius);
  user-select: none;
}

.tcc-table th,
.tcc-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--tcc-grid-border);
}

.tcc-table th {
  text-align: left;
  color: var(--tcc-text-muted);
  font-variant: small-caps;
  letter-spacing: 0.11em;
  font-weight: 700;
  font-size: 13px;
  user-select: none;
}

.tcc-table tbody tr:hover td {
  background: rgba(108, 92, 231, 0.25);
  cursor: default;
}

/* Responsive grid for live counters */
@media (max-width: 600px) {
  .tcc-grid {
    grid-template-columns: 1fr !important;
  }
  
  .tcc-card--sm, .tcc-card--md, .tcc-card--lg, .tcc-card--xl {
    grid-column: span 12 !important;
  }

  .tcc-quick {
    justify-content: center;
  }

  .tcc-btn {
    flex-grow: 1;
    min-width: 120px;
  }

  .tcc-stat {
    grid-column: span 12 !important;
    font-size: 18px;
  }
}
