/* Reset and base styles */
.text-analyzer-container * {
  box-sizing: border-box;
}

.text-analyzer-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  width: 100%;
}

.analyzer-card {
  background: white;
  border-radius: 16px;
  padding: 30px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  margin-top: 30px;
  width: 100%;
  overflow: hidden;
}

.input-group {
  margin-bottom: 25px;
  width: 100%;
}

.input-group label {
  display: block;
  margin-bottom: 10px;
  font-weight: 600;
  color: var(--dark);
}

.text-input {
  width: 100%;
  padding: 16px;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  font-family: inherit;
  font-size: 16px;
  resize: vertical;
  transition: border-color 0.3s;
  box-sizing: border-box;
  max-width: 100%;
}

.text-input:focus {
  outline: none;
  border-color: var(--primary);
}

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

.action-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.action-btn:hover {
  background: #f1f5f9;
}

.analysis-options {
  margin-bottom: 25px;
  padding: 20px;
  background: #f8fafc;
  border-radius: 12px;
  width: 100%;
}

.analysis-options h3 {
  margin-bottom: 15px;
  color: var(--dark);
}

.options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
}

.option-checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.option-checkbox input {
  display: none;
}

.checkmark {
  width: 20px;
  height: 20px;
  border: 2px solid #cbd5e1;
  border-radius: 4px;
  position: relative;
  transition: all 0.2s;
  flex-shrink: 0;
}

.option-checkbox input:checked + .checkmark {
  background: var(--primary);
  border-color: var(--primary);
}

.option-checkbox input:checked + .checkmark::after {
  content: '';
  position: absolute;
  left: 6px;
  top: 2px;
  width: 6px;
  height: 10px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.results-container {
  width: 100%;
}

.results-container h2 {
  margin-bottom: 20px;
  color: var(--dark);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
  width: 100%;
}

.stat-card {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  transition: transform 0.2s, box-shadow 0.2s;
  min-width: 0;
}

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

.stat-value {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 8px;
  word-break: break-all;
}

.stat-label {
  font-size: 14px;
  color: var(--text-light);
}

.letter-frequency h3,
.specific-letters h3 {
  margin-bottom: 15px;
  color: var(--dark);
}

.frequency-description {
  color: var(--text-light);
  margin-bottom: 15px;
  font-style: italic;
}

.frequency-table-container {
  overflow-x: auto;
  margin-bottom: 30px;
  width: 100%;
  -webkit-overflow-scrolling: touch;
}

.frequency-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  min-width: 500px;
}

.frequency-table th {
  background: #f1f5f9;
  padding: 15px 12px;
  text-align: left;
  font-weight: 600;
  color: var(--dark);
  border-bottom: 1px solid #e2e8f0;
  white-space: nowrap;
}

.frequency-table td {
  padding: 12px;
  border-bottom: 1px solid #f1f5f9;
  white-space: nowrap;
}

.frequency-table tr:last-child td {
  border-bottom: none;
}

.bar-container {
  width: 100%;
  background: #f1f5f9;
  border-radius: 4px;
  overflow: hidden;
  height: 20px;
  min-width: 100px;
}

.bar {
  height: 100%;
  background: var(--primary);
  border-radius: 4px;
  transition: width 0.3s ease;
}

.specific-letters-input {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  width: 100%;
  flex-wrap: wrap;
}

#search-letters {
  flex: 1;
  padding: 12px 16px;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  font-size: 16px;
  min-width: 200px;
  box-sizing: border-box;
}

.search-button {
  padding: 12px 24px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background 0.2s;
  white-space: nowrap;
}

.search-button:hover {
  background: var(--primary-dark);
}

.specific-results {
  background: #f8fafc;
  border-radius: 12px;
  padding: 20px;
  width: 100%;
}

.letters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 15px;
}

.letter-item {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 15px;
  text-align: center;
  min-width: 0;
}

.letter-char {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 5px;
  word-break: break-all;
}

.letter-count {
  font-size: 0.9rem;
  color: var(--text-light);
}

.no-data {
  text-align: center;
  color: var(--text-light);
  padding: 40px 20px;
  font-style: italic;
  width: 100%;
}

/* Features list styling */
.features-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
  margin: 40px 0;
  width: 100%;
}

.feature-item {
  text-align: center;
  padding: 30px 20px;
  background: white;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  transition: transform 0.3s;
  min-width: 0;
}

.feature-item:hover {
  transform: translateY(-5px);
}

.feature-item h3 {
  margin-bottom: 15px;
  color: var(--dark);
  font-size: 1.3rem;
}

.feature-item p {
  color: var(--text-light);
  line-height: 1.6;
}

.security-badge {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 12px;
  padding: 20px;
  margin: 30px 0;
  text-align: center;
  width: 100%;
}

.security-badge p {
  margin: 0;
  color: #166534;
}

.terminal {
  background: #1e293b;
  color: #e2e8f0;
  border-radius: 12px;
  padding: 25px;
  margin-top: 40px;
  font-family: 'Monaco', 'Consolas', monospace;
  font-size: 14px;
  width: 100%;
  overflow-x: auto;
}

.terminal .command {
  color: #10b981;
  margin: 8px 0;
  padding-left: 20px;
  word-break: break-all;
}

.terminal .comment {
  color: #94a3b8;
  margin: 8px 0;
  padding-left: 20px;
  font-style: italic;
  word-break: break-all;
}

/* Language support */
.language-support {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin: 25px 0;
  width: 100%;
}

.language-category {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 20px;
  transition: all 0.2s;
  min-width: 0;
}

.language-category:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.language-category h4 {
  color: var(--dark);
  margin-bottom: 8px;
  font-size: 1.1rem;
}

.language-category p {
  color: var(--text-light);
  margin: 0;
  font-size: 0.9rem;
}

/* FAQ styles */
.faq-container {
  margin-top: 30px;
  width: 100%;
}

.faq-item {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  margin-bottom: 15px;
  overflow: hidden;
  width: 100%;
}

.faq-question {
  padding: 20px;
  background: #f8fafc;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.2s;
  width: 100%;
}

.faq-question:hover {
  background: #f1f5f9;
}

.faq-question svg {
  transition: transform 0.3s;
  flex-shrink: 0;
}

.faq-item.active .faq-question svg {
  transform: rotate(180deg);
}

.faq-answer {
  padding: 0 20px;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s, padding 0.3s;
  width: 100%;
}

.faq-item.active .faq-answer {
  padding: 20px;
  max-height: 500px;
}

/* Breadcrumbs */
.breadcrumbs {
  margin-bottom: 20px;
  font-size: 14px;
  color: var(--text-light);
  width: 100%;
}

.breadcrumbs a {
  color: var(--primary);
  text-decoration: none;
}

.breadcrumbs a:hover {
  text-decoration: underline;
}

.breadcrumbs .separator {
  margin: 0 8px;
  color: var(--text-light);
}

.breadcrumbs .current {
  color: var(--dark);
  font-weight: 500;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .text-analyzer-container {
    padding: 15px;
  }
  
  .analyzer-card {
    padding: 20px;
    margin-top: 20px;
  }
  
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
  }
  
  .stat-value {
    font-size: 2rem;
  }
  
  .stat-card {
    padding: 15px;
  }
  
  .options-grid {
    grid-template-columns: 1fr;
  }
  
  .specific-letters-input {
    flex-direction: column;
  }
  
  #search-letters {
    min-width: unset;
  }
  
  .search-button {
    justify-content: center;
  }
  
  .features-list {
    grid-template-columns: 1fr;
    gap: 20px;
    margin: 30px 0;
  }
  
  .feature-item {
    padding: 20px 15px;
  }
  
  .input-actions {
    flex-direction: column;
  }
  
  .action-btn {
    justify-content: center;
  }
  
  .frequency-table {
    min-width: 400px;
  }
  
  .frequency-table th,
  .frequency-table td {
    padding: 10px 8px;
    font-size: 14px;
  }
  
  .language-support {
    grid-template-columns: 1fr;
    gap: 15px;
  }
  
  .language-category {
    padding: 15px;
  }
  
  .terminal {
    padding: 20px 15px;
    font-size: 13px;
  }
  
  .terminal .command,
  .terminal .comment {
    padding-left: 10px;
  }
  
  .faq-question {
    padding: 15px;
    font-size: 14px;
  }
  
  .faq-answer {
    padding: 0 15px;
  }
  
  .faq-item.active .faq-answer {
    padding: 15px;
  }
  
  .letters-grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
  }
  
  .letter-item {
    padding: 12px;
  }
}

@media (max-width: 480px) {
  .text-analyzer-container {
    padding: 10px;
  }
  
  .analyzer-card {
    padding: 15px;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  
  .stat-value {
    font-size: 1.8rem;
  }
  
  .text-input {
    padding: 12px;
    font-size: 16px; /* Prevent zoom on iOS */
  }
  
  .frequency-table {
    min-width: 350px;
  }
  
  .frequency-table th,
  .frequency-table td {
    padding: 8px 6px;
    font-size: 13px;
  }
  
  .breadcrumbs {
    font-size: 13px;
  }
}


/* Добавляем эти стили к существующему CSS */

/* Адаптивная сетка для 10 карточек */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
    width: 100%;
}

.stat-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 15px;
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 5px;
    word-break: break-all;
    line-height: 1.2;
}

.stat-label {
    font-size: 12px;
    color: var(--text-light);
    line-height: 1.3;
}

/* Адаптивность для мобильных устройств */
@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
        gap: 12px;
    }
    
    .stat-value {
        font-size: 1.6rem;
    }
    
    .stat-card {
        padding: 12px;
    }
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }
    
    .stat-value {
        font-size: 1.4rem;
    }
    
    .stat-label {
        font-size: 11px;
    }
    
    .stat-card {
        padding: 10px 8px;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .stat-value {
        font-size: 1.3rem;
    }
}