/* Character Counter Tool WordPress Plugin CSS */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

/* Root Variables */
:root {
  --background: hsl(0 0% 95%);
  --foreground: hsl(0 0% 0%);
  --card: hsl(0 0% 100%);
  --card-foreground: hsl(0 0% 0%);
  --popover: hsl(0 0% 100%);
  --popover-foreground: hsl(0 0% 0%);
  --primary: hsl(355 85% 47%);
  --primary-foreground: hsl(0 0% 100%);
  --secondary: hsl(0 0% 90%);
  --secondary-foreground: hsl(0 0% 0%);
  --muted: hsl(0 0% 95%);
  --muted-foreground: hsl(0 0% 45%);
  --accent: hsl(355 85% 47%);
  --accent-foreground: hsl(0 0% 100%);
  --destructive: hsl(356.3033 90.5579% 54.3137%);
  --destructive-foreground: hsl(0 0% 100%);
  --border: hsl(0 0% 90%);
  --input: hsl(0 0% 100%);
  --ring: hsl(355 85% 47%);
  --font-sans: 'Poppins', sans-serif;
  --font-serif: Georgia, serif;
  --font-mono: Menlo, monospace;
  --radius: 0.5rem;
}

/* Base Styles */
.character-counter-tool {
  font-family: var(--font-sans);
  color: var(--foreground);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.character-counter-tool * {
  box-sizing: border-box;
}

.gradient-bg {
  background: linear-gradient(135deg, #F2F2F2 0%, #E8E8E8 100%);
  min-height: auto;
}

/* Container */
.cct-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Header */
.cct-header {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  margin-bottom: 2rem;
}

.cct-header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
}

.cct-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.cct-logo-icon {
  width: 2rem;
  height: 2rem;
  background: var(--primary);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
}

.cct-logo-icon .cct-icon {
  width: 1rem;
  height: 1rem;
  color: var(--primary-foreground);
}

.cct-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0;
  color: var(--foreground);
}

.cct-tagline {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

.cct-dot {
  width: 0.25rem;
  height: 0.25rem;
  background: var(--muted-foreground);
  border-radius: 50%;
}

/* Layout */
.cct-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

.cct-left-column,
.cct-right-column {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Card Components */
.cct-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.cct-card.shadow-lg {
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.cct-card-header {
  padding: 1rem 1.5rem;
  background: var(--muted);
  border-bottom: 1px solid var(--border);
}

.cct-card-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--foreground);
}

.cct-card-content {
  padding: 1.5rem;
}

/* Icons */
.cct-icon {
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
}

.text-primary {
  color: var(--primary);
}

/* Text Input */
.cct-textarea {
  width: 100%;
  height: 20rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  color: var(--foreground);
  background: var(--input);
  resize: none;
  transition: all 0.2s ease;
}

.cct-textarea:focus {
  outline: none;
  border-color: transparent;
  ring: 2px solid var(--ring);
  box-shadow: 0 0 0 2px var(--ring);
}

.cct-textarea::placeholder {
  color: var(--muted-foreground);
}

.cct-input-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1rem;
  font-size: 0.875rem;
}

.cct-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--muted-foreground);
}

/* Buttons */
.cct-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  font-family: inherit;
}

.cct-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.cct-btn-outline {
  background: transparent;
  color: var(--foreground);
  border: 1px solid var(--border);
}

.cct-btn-outline:hover:not(:disabled) {
  background: var(--accent);
  color: var(--accent-foreground);
  border-color: var(--accent);
}

.cct-btn-ghost {
  background: transparent;
  color: var(--muted-foreground);
}

.cct-btn-ghost:hover:not(:disabled) {
  color: var(--primary);
  background: var(--muted);
}

.cct-btn-sm {
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
}

/* Export Actions */
.cct-export-actions {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.cct-export-actions .cct-btn {
  flex: 1;
}

/* Stats */
.cct-primary-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.cct-stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: all 0.3s ease;
}

.cct-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.cct-stat-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cct-stat-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted-foreground);
  margin: 0 0 0.25rem 0;
}

.cct-stat-value {
  font-size: 1.875rem;
  font-weight: 700;
  color: var(--foreground);
  margin: 0;
}

.cct-stat-icon {
  width: 3rem;
  height: 3rem;
  background: hsl(from var(--primary) h s l / 0.1);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
}

.pulse-icon {
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* Detailed Stats */
.cct-detailed-stats {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.cct-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.cct-stats-single-column {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.cct-stat-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}

.cct-stat-item .cct-stat-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted-foreground);
}

.cct-stat-item .cct-stat-value {
  font-size: 1rem;
  font-weight: 600;
  color: var(--foreground);
}

.cct-readability {
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.cct-readability-info {
  text-align: right;
}

.cct-readability-score {
  font-size: 0.75rem;
  color: var(--muted-foreground);
}

/* Form Controls */
.cct-control-group {
  margin-bottom: 1rem;
}

.cct-control-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.cct-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted-foreground);
}

.cct-font-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.cct-font-size {
  font-size: 0.875rem;
  font-weight: 500;
  min-width: 3ch;
  text-align: center;
}

.cct-value {
  font-size: 0.875rem;
  font-weight: 500;
}

.cct-slider {
  width: 100%;
  height: 0.5rem;
  background: var(--muted);
  border-radius: var(--radius);
  outline: none;
  cursor: pointer;
  -webkit-appearance: none;
}

.cct-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 1.25rem;
  height: 1.25rem;
  background: var(--primary);
  border-radius: 50%;
  cursor: pointer;
}

.cct-slider::-moz-range-thumb {
  width: 1.25rem;
  height: 1.25rem;
  background: var(--primary);
  border-radius: 50%;
  cursor: pointer;
  border: none;
}

.cct-select {
  width: 100%;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  background: var(--input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--foreground);
  cursor: pointer;
}

.cct-select:focus {
  outline: none;
  border-color: var(--ring);
  box-shadow: 0 0 0 2px hsl(from var(--ring) h s l / 0.2);
}

/* Platform Limits */
.cct-platform-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0;
}

.cct-platform-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.cct-platform-name {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--foreground);
}

.cct-platform-progress {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.cct-platform-count {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted-foreground);
}

.cct-platform-count.over-limit {
  color: hsl(0 84% 60%);
}

.cct-progress-bar {
  width: 5rem;
  height: 0.5rem;
  background: var(--muted);
  border-radius: var(--radius);
  overflow: hidden;
}

.cct-progress-fill {
  height: 100%;
  background: var(--primary);
  transition: all 0.3s ease;
}

.cct-progress-fill.warning {
  background: hsl(45 93% 47%);
}

.cct-progress-fill.danger {
  background: hsl(0 84% 60%);
}

/* Badges */
.cct-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.125rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 0.375rem;
  border: 1px solid transparent;
}

.cct-badge.success {
  background: hsl(142 71% 45% / 0.1);
  color: hsl(142 71% 45%);
  border-color: hsl(142 71% 45% / 0.2);
}

.cct-badge.warning {
  background: hsl(45 93% 47% / 0.1);
  color: hsl(45 93% 47%);
  border-color: hsl(45 93% 47% / 0.2);
}

.cct-badge.danger {
  background: hsl(0 84% 60% / 0.1);
  color: hsl(0 84% 60%);
  border-color: hsl(0 84% 60% / 0.2);
}

/* Analytics */
.cct-analytics-metric {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.cct-analytics-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cct-progress {
  width: 100%;
  height: 0.5rem;
  background: var(--muted);
  border-radius: var(--radius);
  overflow: hidden;
}

.cct-progress-value {
  height: 100%;
  background: var(--primary);
  transition: all 0.3s ease;
}

/* Overall Status */
.cct-overall-status {
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  text-align: center;
}

.cct-status-message {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
}

.cct-status-success {
  color: hsl(142 71% 45%);
}

.cct-status-warning {
  color: hsl(0 84% 60%);
}

/* Responsive Design */
@media (max-width: 1024px) {
  .cct-layout {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .cct-primary-stats {
    grid-template-columns: 1fr 1fr;
  }
  
  .cct-stats-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .cct-container {
    padding: 0 0.5rem;
  }
  
  .cct-header {
    margin-bottom: 1rem;
  }
  
  .cct-header-content {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  
  .cct-tagline {
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-start;
  }
  
  .cct-dot {
    display: none;
  }
  
  .cct-title {
    font-size: 1.25rem;
  }
  
  .cct-card-content {
    padding: 1rem;
  }
  
  .cct-textarea {
    height: 15rem;
  }
  
  .cct-primary-stats {
    grid-template-columns: 1fr;
  }
  
  .cct-export-actions {
    flex-direction: column;
  }
  
  .cct-font-controls {
    flex-wrap: wrap;
  }
  
  .cct-platform-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  
  .cct-platform-progress {
    width: 100%;
    justify-content: space-between;
  }
  
  .cct-progress-bar {
    width: 8rem;
  }
}

@media (max-width: 480px) {
  .cct-container {
    padding: 0 0.25rem;
  }
  
  .cct-layout {
    gap: 1rem;
  }
  
  .cct-left-column,
  .cct-right-column {
    gap: 1rem;
  }
  
  .cct-card-header,
  .cct-card-content {
    padding: 0.75rem;
  }
  
  .cct-textarea {
    height: 12rem;
    padding: 0.75rem;
  }
  
  .cct-input-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  
  .cct-stats-grid {
    gap: 0.5rem;
  }
  
  .cct-stat-item {
    padding: 0.5rem 0;
  }
}

/* Fix for WordPress theme conflicts */
.character-counter-tool .cct-btn,
.character-counter-tool .cct-textarea,
.character-counter-tool .cct-select,
.character-counter-tool .cct-slider {
  box-shadow: none !important;
  background-image: none !important;
  text-shadow: none !important;
}

.character-counter-tool input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
}

.character-counter-tool button {
  background-image: none;
  text-shadow: none;
  box-shadow: none;
}