/* ========================================
   📝 WORD COUNTER TOOL - RESPONSIVE CSS
   Mobile First + Desktop Friendly
   Matches Calculator Tool Structure
======================================== */

/* ✅ Reset & Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* Color Theme (Matching index.html) */
  --primary-color: #6366f1;
  --primary-dark: #4f46e5;
  --secondary-color: hsl(258, 90%, 66%);
  --accent-color: #ec4899;
  --success-color: #10b981;
  --bg-color: #f8fafc;
  --card-bg: #ffffff;
  --text-color: #1e293b;
  --text-light: #64748b;
  --border-color: #e2e8f0;
  --error-color: #ef4444;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: var(--text-color);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ========================================
   ⬅️ ENHANCED BACK BUTTON
======================================== */
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: var(--card-bg);
  color: var(--primary-color);
  text-decoration: none;
  border-radius: 12px;
  font-weight: 600;
  font-size: 1rem;
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
  margin: 4rem 2rem 2rem;
  position: relative;
  overflow: hidden;
  border: 2px solid transparent;
  width: fit-content;
}

.back-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.1), transparent);
  transition: left 0.5s ease;
}

.back-btn:hover::before {
  left: 100%;
}

.back-btn:hover {
  background: var(--primary-color);
  color: white;
  transform: translateX(-5px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-color);
}

.back-btn:active {
  transform: translateX(-3px) scale(0.98);
}

/* ========================================
   📦 MAIN CONTAINER
======================================== */
.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 1.5rem 1rem;
  width: 100%;
  background: transparent;
  flex: 1;
}

/* ========================================
   📄 PAGE HEADER
======================================== */
.page-header {
  text-align: center;
  margin-bottom: 2rem;
}

.page-header h1 {
  font-size: 2rem;
  color: white;
  margin-bottom: 0.5rem;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.page-header p {
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.5;
}

/* ========================================
   🎨 COUNTER WRAPPER
======================================== */
.counter-wrapper {
  background: var(--card-bg);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  padding: 2rem 1.5rem;
  animation: fadeInUp 0.6s ease;
}

/* ========================================
   📝 COUNTER SECTION
======================================== */
.counter-section {
  margin-bottom: 2rem;
}

.counter-card {
  background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
  border-radius: 16px;
  padding: 2rem 1.5rem;
  box-shadow: var(--shadow-lg);
  margin-bottom: 2rem;
}

/* Input Section */
.input-section {
  margin-bottom: 1.5rem;
}

.input-section label {
  display: block;
  margin-bottom: 1rem;
}

.input-section h3 {
  font-size: 1.1rem;
  color: #f7fafc;
  margin-bottom: 0.5rem;
}

.input-hint {
  font-size: 0.9rem;
  color: #cbd5e1;
  margin: 0;
}

#textInput {
  width: 100%;
  min-height: 300px;
  padding: 1.25rem;
  font-size: 1rem;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  background: linear-gradient(135deg, #1a202c 0%, #2d3748 100%);
  color: #f7fafc;
  border: 2px solid #4a5568;
  border-radius: 12px;
  resize: vertical;
  transition: all 0.3s ease;
}

#textInput:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

#textInput::placeholder {
  color: #a0aec0;
}

/* ========================================
   🔘 BUTTONS
======================================== */
.button-group {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.btn {
  padding: 1rem 1.5rem;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-block;
  text-align: center;
  box-shadow: var(--shadow);
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  color: white;
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-dark) 0%, #9333ea 100%);
}

.btn-secondary {
  background: var(--text-light);
  color: white;
}

.btn-secondary:hover {
  background: #475569;
}

/* ========================================
   📊 STATISTICS SECTION
======================================== */
.stats-section {
  background: var(--bg-color);
  border-radius: 12px;
  padding: 2rem 1.5rem;
  border: 1px solid var(--border-color);
  margin-bottom: 2rem;
  animation: fadeIn 0.6s ease 0.2s backwards;
}

.stats-section h4 {
  font-size: 1.2rem;
  color: var(--text-color);
  margin-bottom: 1.5rem;
  text-align: center;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: white;
  border: 2px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem 1rem;
  text-align: center;
  transition: all 0.3s ease;
}

.stat-card:hover {
  border-color: var(--primary-color);
  box-shadow: var(--shadow);
  transform: translateY(-4px);
}

.stat-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  display: block;
}

.stat-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary-color);
  margin-bottom: 0.25rem;
  line-height: 1;
}

.stat-label {
  font-size: 0.9rem;
  color: var(--text-light);
  font-weight: 500;
}

/* Additional Statistics */
.additional-stats {
  background: white;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1.5rem;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border-color);
}

.stat-row:last-child {
  border-bottom: none;
}

.stat-row-label {
  font-size: 0.95rem;
  color: var(--text-color);
  font-weight: 500;
}

.stat-row-value {
  font-size: 1rem;
  color: var(--primary-color);
  font-weight: 700;
}

/* ========================================
   ⚡ REAL-TIME TOGGLE
======================================== */
.realtime-toggle {
  margin-top: 1.5rem;
  text-align: center;
}

.toggle-label {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.05);
  padding: 0.75rem 1.25rem;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.toggle-label:hover {
  background: rgba(255, 255, 255, 0.1);
}

.toggle-label input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  cursor: pointer;
}

.toggle-slider {
  width: 50px;
  height: 26px;
  background: #4a5568;
  border-radius: 13px;
  position: relative;
  transition: all 0.3s ease;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  background: white;
  border-radius: 50%;
  top: 3px;
  left: 3px;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-label input:checked ~ .toggle-slider {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
}

.toggle-label input:checked ~ .toggle-slider::before {
  transform: translateX(24px);
}

.toggle-text {
  color: #e2e8f0;
  font-size: 0.95rem;
  font-weight: 600;
}

/* ========================================
   ℹ️ INFO SECTION
======================================== */
.info-section {
  background: linear-gradient(135deg, #f0f4ff 0%, #faf5ff 100%);
  border-left: 4px solid var(--primary-color);
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  animation: fadeIn 0.6s ease 0.6s backwards;
}

.info-section h3 {
  font-size: 1.1rem;
  color: var(--primary-color);
  margin-bottom: 1rem;
}

.info-section ul {
  list-style: none;
  padding-left: 0;
}

.info-section li {
  padding: 0.5rem 0;
  padding-left: 1.5rem;
  position: relative;
  font-size: 0.95rem;
  color: var(--text-color);
  line-height: 1.5;
}

.info-section li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--success-color);
  font-weight: bold;
}

/* ========================================
   🚀 FEATURES SECTION
======================================== */
.features-section {
  margin-bottom: 2rem;
  animation: fadeIn 0.6s ease 0.8s backwards;
}

.features-section h3 {
  font-size: 1.25rem;
  color: var(--text-color);
  margin-bottom: 1.5rem;
  text-align: center;
}

.features-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

.feature-card {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem;
  text-align: center;
  transition: all 0.3s ease;
}

.feature-card:hover {
  border-color: var(--primary-color);
  box-shadow: var(--shadow);
  transform: translateY(-4px);
}

.feature-icon {
  font-size: 2.5rem;
  display: block;
  margin-bottom: 1rem;
}

.feature-card h4 {
  font-size: 1.05rem;
  color: var(--text-color);
  margin-bottom: 0.5rem;
}

.feature-card p {
  font-size: 0.9rem;
  color: var(--text-light);
  line-height: 1.5;
}

/* ========================================
   💡 USE CASES SECTION
======================================== */
.usecases-section {
  margin-bottom: 2rem;
  animation: fadeIn 0.6s ease 1s backwards;
}

.usecases-section h3 {
  font-size: 1.25rem;
  color: var(--text-color);
  margin-bottom: 1.5rem;
  text-align: center;
}

.usecases-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

.usecase-card {
  background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
  border: 1px solid #fed7aa;
  border-left: 4px solid #f59e0b;
  border-radius: 12px;
  padding: 1.5rem;
  text-align: center;
  transition: all 0.3s ease;
}

.usecase-card:hover {
  border-color: #f59e0b;
  box-shadow: var(--shadow);
  transform: translateY(-4px);
}

.usecase-icon {
  font-size: 2rem;
  display: block;
  margin-bottom: 0.75rem;
}

.usecase-card h4 {
  font-size: 1.05rem;
  color: var(--text-color);
  margin-bottom: 0.5rem;
}

.usecase-card p {
  font-size: 0.9rem;
  color: var(--text-light);
  line-height: 1.5;
}

/* ========================================
   👣 FOOTER STYLES
======================================== */
.pro-footer {
  background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
  color: #e2e8f0;
  padding: 3rem 1rem 1rem;
  margin-top: auto;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-section h4 {
  color: white;
  margin-bottom: 1rem;
  font-size: 1.25rem;
}

.footer-brand {
  text-align: center;
}

.footer-brand img {
  width: 200px;
  height: auto;
  border-radius: 12px;
  margin-bottom: 1rem;
  margin-top: 2rem;
}

.footer-brand p {
  color: #94a3b8;
  font-size: 0.95rem;
  margin-top: 0;
}

.footer-section ul {
  list-style: none;
}

.footer-section ul li {
  margin-bottom: 0.5rem;
}

.footer-section a {
  color: #cbd5e1;
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer-section a:hover {
  color: var(--primary-color);
}

.contact p {
  margin-bottom: 0.5rem;
  color: #cbd5e1;
}

.contact small {
  display: block;
  color: #94a3b8;
  font-size: 0.8rem;
  margin-top: -0.25rem;
  margin-bottom: 0.5rem;
}

.footer-bottom {
  border-top: 1px solid #475569;
  padding-top: 1.5rem;
  text-align: center;
}

.footer-bottom p {
  color: #94a3b8;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.copyright-warning {
  font-size: 0.8rem;
  color: #64748b;
  margin-top: 0.5rem;
}

/* ========================================
   📱 RESPONSIVE DESIGN - TABLETS (640px+)
======================================== */
@media (min-width: 640px) {
  .counter-wrapper {
    padding: 2.5rem 2rem;
  }

  .button-group {
    flex-direction: row;
    gap: 1rem;
  }

  .btn {
    flex: 1;
  }

  .stats-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .usecases-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer-container {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ========================================
   💻 RESPONSIVE DESIGN - DESKTOP (768px+)
======================================== */
@media (min-width: 768px) {
  .container {
    padding: 2rem 1.5rem;
  }

  .page-header h1 {
    font-size: 2.5rem;
  }

  .page-header p {
    font-size: 1.1rem;
  }

  .counter-wrapper {
    padding: 3rem;
  }

  .counter-card {
    padding: 2rem;
  }

  .features-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .usecases-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .feature-card {
    padding: 2rem 1.5rem;
  }

  .footer-container {
    grid-template-columns: repeat(3, 1fr);
    text-align: left;
  }

  .footer-brand {
    text-align: left;
  }
}

@media (min-width: 1024px) {
  .container {
    padding: 2.5rem 2rem;
  }

  .page-header h1 {
    font-size: 3rem;
  }

  .counter-wrapper {
    padding: 3.5rem;
  }
}

/* ========================================
   ✨ ANIMATIONS & EFFECTS
======================================== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.feature-card {
  animation: fadeInUp 0.6s ease backwards;
}

.feature-card:nth-child(1) { animation-delay: 0.1s; }
.feature-card:nth-child(2) { animation-delay: 0.2s; }
.feature-card:nth-child(3) { animation-delay: 0.3s; }
.feature-card:nth-child(4) { animation-delay: 0.4s; }

.usecase-card {
  animation: fadeInUp 0.6s ease backwards;
}

.usecase-card:nth-child(1) { animation-delay: 0.1s; }
.usecase-card:nth-child(2) { animation-delay: 0.2s; }
.usecase-card:nth-child(3) { animation-delay: 0.3s; }
.usecase-card:nth-child(4) { animation-delay: 0.4s; }

/* ========================================
   ♿ ACCESSIBILITY
======================================== */
*:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/*Google Ads*/
.ad-sidebar {
  width: 100%; /* Full on mobile */
  max-width: 300px; /* Sidebar size on desktop */
  margin: 20px auto; /* Center it */
  text-align: center;
  border-radius: 8px;
}

/* ========================================
   📝 BLOG CTA
======================================== */
.blog-cta {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
  border: 2px solid var(--primary-color);
  border-radius: 12px;
  padding: 2.5rem;
  text-align: center;
}

.blog-cta-content h3 {
  font-size: 1.8rem;
  color: var(--text-color);
  margin-bottom: 1rem;
  font-weight: 700;
}

.blog-cta-content p {
  font-size: 1.1rem;
  color: var(--text-light);
  margin-bottom: 1.5rem;
  line-height: 1.8;
}

.blog-btn {
  display: inline-block;
  padding: 1rem 2.5rem;
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  color: white;
  text-decoration: none;
  border-radius: 10px;
  font-weight: 700;
  font-size: 1.05rem;
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
}

.blog-btn:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}
