/* Word Counter Tool Styles */

.word-counter-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px;
}

.hero-section {
  text-align: center;
  margin-bottom: 30px;
  padding: 20px 0;
}

.hero-title {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 10px;
}

.hero-subtitle {
  font-size: 1.2rem;
  color: #666;
  max-width: 700px;
  margin: 0 auto;
}

.tool-section {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 15px;
  background: #f8f9fa;
  border-bottom: 1px solid #eaeaea;
  justify-content: space-between;
}

.toolbar-group {
  display: flex;
  gap: 5px;
}

.tool-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 8px 12px;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.tool-btn:hover {
  background: #e9ecef;
  border-color: var(--primary);
  color: var(--primary);
}

.tool-btn i {
  font-size: 0.9rem;
}

/* TTS Control Buttons */
.hidden,
.tool-btn.hidden {
  display: none !important;
}

#tts-stop-btn,
#tts-pause-btn {
  display: none;
}

#tts-stop-btn:not(.hidden),
#tts-pause-btn:not(.hidden) {
  display: flex !important;
}

#tts-stop-btn {
  background: #dc3545;
  border-color: #dc3545;
  color: white;
}

#tts-stop-btn:hover {
  background: #c82333;
  border-color: #c82333;
  color: white;
}

#tts-pause-btn {
  background: #ffc107;
  border-color: #ffc107;
  color: #212529;
}

#tts-pause-btn:hover {
  background: #e0a800;
  border-color: #e0a800;
  color: #212529;
}

.main-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 20px;
}

@media (min-width: 992px) {
  .main-content {
    flex-direction: row;
  }
  
  .editor-panel {
    flex: 1;
    min-width: 300px;
  }
  
  .stats-panel {
    width: 350px;
  }
}

.text-editor {
  width: 100%;
  min-height: 400px;
  padding: 15px;
  font-size: 1rem;
  line-height: 1.6;
  border: 1px solid #ddd;
  border-radius: 4px;
  resize: vertical;
  font-family: 'Roboto', sans-serif;
}

.text-editor:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(217, 79, 79, 0.2);
}

.panel-section {
  margin-bottom: 25px;
  padding-bottom: 20px;
  border-bottom: 1px solid #eee;
}

.panel-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.panel-section h3 {
  font-size: 1.3rem;
  margin-bottom: 15px;
  color: #333;
  font-weight: 600;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 15px;
}

.stat-card {
  background: #f8f9fa;
  border-radius: 6px;
  padding: 15px;
  text-align: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  transition: transform 0.2s ease;
}

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 5px;
}

.stat-label {
  font-size: 0.85rem;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.keyword-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  flex-wrap: wrap;
  gap: 10px;
}

.keyword-controls label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.9rem;
  color: #555;
}

.keyword-controls select {
  padding: 5px 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: #fff;
}

.keyword-list {
  max-height: 300px;
  overflow-y: auto;
}

.keyword-item {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid #f0f0f0;
}

.keyword-item:last-child {
  border-bottom: none;
}

.keyword-word {
  font-weight: 500;
}

.keyword-count {
  color: #666;
}

.keyword-percent {
  color: var(--primary);
  font-weight: 600;
}

/* Modal Styles */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
  background-color: #fff;
  margin: 5% auto;
  padding: 25px;
  border-radius: 8px;
  width: 90%;
  max-width: 500px;
  position: relative;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.close {
  position: absolute;
  right: 15px;
  top: 15px;
  font-size: 1.8rem;
  font-weight: bold;
  cursor: pointer;
  color: #aaa;
}

.close:hover {
  color: #333;
}

.modal-content h2 {
  margin-top: 0;
  color: #333;
  font-size: 1.5rem;
  margin-bottom: 20px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 5px;
  font-weight: 500;
  color: #555;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 1rem;
  box-sizing: border-box;
}

.form-group input[type="checkbox"] {
  width: auto;
  margin-right: 8px;
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 20px;
}

.modal-actions button {
  padding: 10px 15px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: background 0.2s ease;
}

.modal-actions button:first-child {
  background: var(--primary);
  color: white;
}

.modal-actions button:first-child:hover {
  background: var(--primary-dark);
}

.modal-actions button:nth-child(2) {
  background: #28a745;
  color: white;
}

.modal-actions button:nth-child(2):hover {
  background: #1e7e34;
}

.modal-actions button:last-child {
  background: #dc3545;
  color: white;
}

.modal-actions button:last-child:hover {
  background: #c82333;
}

.goal-progress {
  margin-top: 20px;
  padding-top: 15px;
  border-top: 1px solid #eee;
}

.progress-bar-container {
  width: 100%;
  height: 20px;
  background: #e9ecef;
  border-radius: 10px;
  overflow: hidden;
  margin: 10px 0;
}

.progress-bar {
  height: 100%;
  background: var(--primary);
  border-radius: 10px;
  transition: width 0.3s ease;
}

.progress-text {
  text-align: center;
  font-size: 0.9rem;
  color: #666;
}

.activity-chart-container {
  height: 250px;
  margin-bottom: 20px;
}

.activity-stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 15px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .word-counter-container {
    padding: 10px;
  }
  
  .hero-title {
    font-size: 2rem;
  }
  
  .toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  
  .toolbar-group {
    justify-content: center;
  }
  
  .stats-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  }
  
  .keyword-controls {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .modal-content {
    width: 95%;
    padding: 20px 15px;
  }
  
  .activity-stats {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  }
}

@media (max-width: 480px) {
  .tool-btn span {
    display: none;
  }
  
  .tool-btn i {
    margin-right: 0;
  }
  
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .stat-card {
    padding: 10px;
  }
  
  .stat-value {
    font-size: 1.2rem;
  }
  
  .stat-label {
    font-size: 0.75rem;
  }
}

/* ===== SEO CONTENT SECTION ===== */
.seo-content-section {
  background: var(--accent);
  padding: 4rem 2rem;
  border-top: 1px solid rgba(51, 51, 51, 0.1);
}

.seo-content-container {
  max-width: 900px;
  margin: 0 auto;
}

.seo-content-container h2 {
  font-size: 2rem;
  color: var(--secondary);
  margin-bottom: 1.5rem;
  text-align: center;
}

.seo-content-container h3 {
  font-size: 1.4rem;
  color: var(--secondary);
  margin-top: 2rem;
  margin-bottom: 1rem;
}

.seo-content-container h4 {
  font-size: 1.1rem;
  color: var(--secondary);
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

.seo-content-container p {
  color: var(--secondary-light);
  line-height: 1.8;
  margin-bottom: 1rem;
}

.seo-content-container ul,
.seo-content-container ol {
  margin-left: 1.5rem;
  margin-bottom: 1.5rem;
  color: var(--secondary-light);
  line-height: 1.8;
}

.seo-content-container li {
  margin-bottom: 0.5rem;
}

.seo-content-container a {
  color: var(--primary);
  text-decoration: none;
}

.seo-content-container a:hover {
  text-decoration: underline;
}

.seo-faq {
  background: var(--light);
  padding: 1.5rem 2rem;
  border-radius: 12px;
  margin-top: 1rem;
}

.seo-faq h4 {
  color: var(--primary);
  margin-top: 1rem;
}

.seo-faq h4:first-child {
  margin-top: 0;
}

.seo-faq p {
  margin-bottom: 1.5rem;
}

.seo-faq p:last-child {
  margin-bottom: 0;
}

@media (max-width: 768px) {
  .seo-content-section {
    padding: 2rem 1rem;
  }
  
  .seo-content-container h2 {
    font-size: 1.6rem;
  }
  
  .seo-content-container h3 {
    font-size: 1.2rem;
  }
  
  .seo-faq {
    padding: 1rem;
  }
}