.word-counter-container {
    width: 100%;
    max-width: 900px;
    margin: 20px auto;
    padding: 20px;
    background: #71ffd808;
    border-radius: 10px;
    box-shadow: 0px 0px 8px rgb(0 0 0 / 10%);
    text-align: center;
    font-family: 'Arial', sans-serif;
    box-sizing: border-box;
    overflow-x: hidden;
}

.word-counter-textarea {
  width: 100%;
  min-height: 300px;
  padding: 20px;
  margin-top: 30px;
  font-size: 17px;
  font-family: Helvetica;
  line-height: 1.3;
  border: none;
  border-radius: 10px;
  height: 230px;
  box-sizing: border-box;
  resize: vertical;
  background-color: white;
  outline: none;
  overflow: auto;
  box-shadow: 0px 0px 5px 4px #7f978638;
    -webkit-overflow-scrolling: touch;
 
}


.gradient-textarea-border {
  padding: 6px;
  border-radius: 12px; 
  background: linear-gradient(90deg, #ff8c00, #ff4500);
  display: inline-block;
  width: 100%; 
  box-sizing: border-box;
  line-height: 0; 
  vertical-align: top;
}

.word-counter-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: 20px;
}

.stat-block {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    font-size: 16px;
    text-align: center;
    box-sizing: border-box;
    word-break: break-word;
    overflow-wrap: break-word;
    min-width: 0;
}

.stat-block p {
    margin: 0;
}

.stat-value {
    display: block;
    margin-top: 5px;
    font-size: 1.5rem;
    color: #32cd32; /* Зеленый цвет */
}

.stat-block.full-width {
    grid-column: span 2;
}

.word-counter-buttons {
    margin-top: 20px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.word-counter-btn {
    padding: 10px 16px;
    font-size: 16px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s ease, opacity 0.3s ease;
    background: linear-gradient(90deg, #ff8c00, #ff4500); 
    color: white;
    width: 120px;
    font-weight: 600;
    font-size: large;
}

#clear-text {
    background: linear-gradient(90deg, #ff8c00, #ff4500); 
}

#copy-text {
    background: linear-gradient(90deg, #32cd32, #00fa9a); 
}

.word-counter-btn:hover {
    opacity: 0.85;
}

/* Уникальные слова */
.word-counter-unique-words {
    max-width: 900px;
    margin: 30px auto;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 10px;
    box-sizing: border-box;
    overflow-x: auto;
}

.unique-words-grid {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 8px 12px;
    margin-top: 15px;
    font-size: 15px;
    word-break: break-word;
    width: 100%;
}

.word-cell {
    background: #f1f1f1;
    padding: 8px 10px;
    border-radius: 6px;
    text-align: left;
    min-width: 0;
}

.word-header {
    font-weight: bold;
    background: #d0f5e1;
}

/* Pagination */
#pagination-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 15px;
    gap: 10px;
    flex-wrap: wrap;
    flex-shrink: 0;
  /*  overflow-x: hidden; */
    box-sizing: border-box;
}

.pagination-btn {
    padding: 6px 12px;
    border: none;
    background: linear-gradient(90deg, #00c6ff, #0072ff); 
    color: white;
    border-radius: 5px;
    cursor: pointer;
    min-width: 100px;
    text-align: center;
    transition: background 0.3s ease;
}

.pagination-btn:hover {
    opacity: 0.85;
}

#page-info {
    font-weight: bold;
}






@media (max-width: 600px) {
    .word-counter-stats {
        grid-template-columns: 1fr;
    }

    .stat-block.full-width {
        grid-column: span 1;
    }

    .stat-value {
        font-size: 24px;
    }

    .unique-words-grid {
        font-size: 14px;
        grid-template-columns: 1fr 1fr 1fr;
    }

    #pagination-controls {
        flex-direction: column;
        align-items: center;
        gap: 8px;
    }

    .pagination-btn {
        width: 100%;
    }

    .word-counter-buttons {
        flex-direction: column;
        align-items: stretch;
    }

    .word-counter-btn {
        width: 100%;
    }
}

.word-counter-textarea::-webkit-scrollbar {
    width: 12px;
}

.word-counter-textarea::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 10px;
}

.word-counter-textarea::-webkit-scrollbar-thumb {
    background: linear-gradient(90deg, #6fff6f8f, #00fa9a85);
    border-radius: 10px;
    border: 2px solid #f0f0f0;
}

.word-counter-textarea::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(90deg, #32cd32, #00fa9a);
    
}



#toast-container {
  position: fixed;
  right: 20px;
  bottom: 20px;
  display: flex;
  flex-direction: column-reverse;
  gap: 10px;
  z-index: 1000;
}

.toast {
  min-width: 170px;
  font-size: 18px;
  line-height: 25px;
  background: linear-gradient(90deg, #00c6ff, #0072ff);
  color: white;
  padding: 12px 18px;
  border-radius: 10px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
  opacity: 0;
  transform: translateY(30px) scale(0.95);
  transition:
    opacity 0.5s ease,
    transform 0.5s cubic-bezier(0.25, 1.2, 0.5, 1);
}


.toast-show {
  opacity: 1;
  transform: translateY(0) scale(1);
}


.toast-error {
      background: linear-gradient(90deg, #ff8c00, #ff4500);
}


.checkbox-toggle {
  margin-bottom: 15px;
}

.checkbox-wrapper {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 20px;
}

.checkbox-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.checkbox-tile {
  position: relative;
  width: 24px;
  height: 24px;
  background: #fff;
  border: 2px solid #e0e0e0;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.3s ease, background-color 0.3s ease;
  overflow: hidden;
}

.checkbox-tile:hover {
  border-color: #b0b0b0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.checkbox-tile:active {
  transform: scale(0.95);
}

.checkbox-input:focus-visible + .checkbox-tile {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

/* Checkmark container */
.checkmark {
  position: relative;
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: transparent;
  border-radius: 2px;
  transition: all 0.3s ease;
}

/* Lines for checkmark */
.checkmark-line {
  content: "";
  position: absolute;
  background: #e0e0e0;
  border-radius: 2px;
  width: 2px;
  height: 16px;
  left: 50%;
  transform-origin: center;
  transition: all 0.3s ease-out;
}

.checkmark .line-1 {
  transform: translateX(-50%) rotate(45deg);
}

.checkmark .line-2 {
  transform: translateX(-50%) rotate(-45deg);
}

.checkbox-input:checked + .checkbox-tile .checkmark {
  background-color: #22c55e;
  transition: background-color 0.5s ease-in-out;
}

.checkbox-input:checked + .checkbox-tile .checkmark .line-1 {
  transform: translateX(-50%) rotate(0deg);
  width: 16px;
  background: #00fa9a;
}

.checkbox-input:checked + .checkbox-tile .checkmark .line-2 {
  transform: translateX(-50%) rotate(90deg);
  width: 16px;
  opacity: 1;
  background: #00fa9a;
}

/* Label text styles */
.label-text {
  color: #b0b0b0;
  font-size: 16px;
  user-select: none;
  transition: color 0.2s ease;
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 250px;
}

.label-unchecked,
.label-checked {
  display: none;
}

.checkbox-input:not(:checked) ~ .label-text .label-unchecked {
  display: inline;
}

.checkbox-input:checked ~ .label-text .label-checked {
  display: inline;
}

.checkbox-input:checked ~ .label-text {
  color: #3b82f6;
}



/*
.autosave-checkbox .label-text {
  color: #b0b0b0;
  font-size: 16px;
  user-select: none;
  transition: color 0.2s ease;
}

.autosave-checkbox .label-text::before {
  content: attr(data-unchecked);
}

.autosave-checkbox .checkbox-input:checked ~ .label-text::before {
  content: attr(data-checked);
}

.autosave-checkbox .checkbox-input:checked ~ .label-text {
  color: var(--checkbox-color);
}

*/


.stat-value-mini {
    display: block;
    margin-top: 5px;
    font-size: 0.75rem;
    color: #32cd32; /* Зеленый цвет */
}


#selection-stats {
  margin-top: 12px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  max-width: 100%;
}

#selection-stats.visible {
  opacity: 1;
  visibility: visible;
}

.selection-stats-content {
  background: #ffffff;
  border: 1px solid #e0e0e0;
  padding: 12px 14px;
  border-radius: 10px;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.05);
  position: relative;
  max-width: 400px;
  margin: 0 auto;
}

.selection-stats-content h4 {
  margin: 0 0 10px;
  font-size: 14px;
  font-weight: 600;
  color: #333;
}

.selection-stats-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.stat-item {
  background: #f5f5f5;
  padding: 2px 17px;
  border-radius: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: #444;
}


.stat-label {
  margin-right: 20px;
  flex: 1;
  text-align: left;
  color: #666;
  font-size: 13px;
}

#selection-stats-close {
  position: absolute;
  top: 8px;
  right: 10px;
  background: transparent;
  border: none;
  font-size: 18px;
  color: #999;
  cursor: pointer;
  transition: color 0.2s ease;
}

#selection-stats-close:hover {
  color: #444;
}



.selection-panel {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
  padding: 0 10px;
  box-sizing: border-box;
  margin-bottom: 12px;
}

/* --- Чекбоксы --- */
.checkboxes-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}



/* --- Statistic --- */
#selection-stats {
  margin-top: 0; 
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  max-width: 100%;
}

#selection-stats.visible {
  opacity: 1;
  visibility: visible;
}


@media (min-width: 768px) {
  .selection-panel {
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
  }


}



