.text-area-box {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  border-radius: 12px;
  margin: 20px 0;
  padding: 20px;
  background: #fff;
  text-align: left;
  border: 2px solid #e8f0fe;
  color: #000;
  position: relative;
  transition: all 0.3s ease;
}

.text-area-box:focus-within {
  border-color: #e8f0fe;
  box-shadow: none;
}

.text-area-box textarea {
  text-align: justify;
  font-size: 16px;
  line-height: 1.6;
  color: #333;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  padding: 0 30px 0 0;
  border: none;
  outline: none;
  background: transparent;
  resize: none;
  width: 100%;
}

.txt-area {
  position: relative;
}

.clr-txt-area {
  position: absolute;
  bottom: 20px;
  right: 20px;
  border: none;
  background: transparent;
  background-image: url('../../images/clear-text-icon2.svg');
  height: 32px;
  width: 32px;
  display: inline-block;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  cursor: pointer;
  transition: opacity 0.3s ease, transform 0.3s ease;
  opacity: 0.6;
  box-shadow: none;
}

.clr-txt-area:hover {
  opacity: 1;
  transform: scale(1.1);
  box-shadow: none;
}

.clr-txt-area:active {
  transform: scale(0.95);
  box-shadow: none;
}

/* Style for the tooltip */
.clr-tooltip {
  visibility: hidden;
  background-color: #333;
  color: #fff;
  text-align: center;
  border-radius: 6px;
  padding: 6px 12px;
  position: absolute;
  bottom: calc(100% + 10px);
  right: 0;
  transform: translateX(15%);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: 10;
}

/* Show the tooltip on button hover */
.clr-txt-area:hover .clr-tooltip {
  visibility: visible;
  opacity: 1;
}

#input {
  resize: none;
  border: none;
  outline: 0;
  height: auto;
  width: 100%;
  min-height: 120px;
  max-height: 300px;
  overflow-y: auto;
  padding: 0;
  box-sizing: border-box;
}

#output {
  text-align: center !important;
  padding: 10px 0;
}

#output span {
  font-size: 18px !important;
  text-align: center !important;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.font-style {
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  padding: 16px;
  margin-bottom: 12px;
  color: #333;
  position: relative;
  background: #f9f9f9;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  word-break: break-all;
  min-height: auto;
  cursor: default;
  gap: 12px;
}

.font-style:hover {
  background: #f5f5f5;
  border-color: #1b7c62;
  box-shadow: 0 4px 12px rgba(27, 124, 98, 0.1);
  transform: translateY(-2px);
}

.font-style-text {
  width: 100%;
  text-align: left;
  word-break: break-all;
  font-size: 18px;
  line-height: 1.6;
  padding: 0;
  margin-bottom: 4px;
}

.font-style-copy {
  flex-shrink: 0;
  margin-left: auto;
  align-self: center;
}

.font-style-actions {
  width: 100%;
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
  justify-content: flex-end;
  margin-top: 5px;
}

.copy-btn,
.share-btn {
  position: relative;
  border: none;
  cursor: pointer;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  font-size: 10px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 4px;
  flex-shrink: 0;
  white-space: nowrap;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.2), 0 2px 4px rgba(0, 0, 0, 0.1);
  text-transform: uppercase;
  min-width: 75px;
  height: 24px;
  line-height: 1;
}

.copy-btn {
  background: #0f4a2e;
}

.share-btn {
  background: #4b5563;
}

.copy-btn:hover,
.share-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.2), 0 4px 8px rgba(0, 0, 0, 0.2);
  filter: brightness(1.1);
}

.copy-btn:active,
.share-btn:active {
  transform: translateY(0);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.2), 0 1px 2px rgba(0, 0, 0, 0.1);
}

.tool-copied {
  background: #1b7c62;
  color: #fff;
  cursor: default;
  box-shadow: 0 1px 3px rgba(27, 124, 98, 0.2);
  font-size: 11px;
  padding: 4px 8px;
}

.tool-shared {
  background: #6b7280;
  color: #fff;
  cursor: default;
  box-shadow: 0 1px 3px rgba(107, 114, 128, 0.2);
  font-size: 11px;
  padding: 4px 8px;
}

.load-more-btn {
  background: #0f4a2e;
  color: white;
  padding: 10px 24px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  margin-top: 16px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.2), 0 4px 8px rgba(0, 0, 0, 0.1);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: inline-block;
}

.load-more-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(27, 124, 98, 0.4);
}

.load-more-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(27, 124, 98, 0.2);
}

/* Best tools grid and cards */
.best-tools-section {
  margin: 48px 0;
}

.best-tools-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.best-tool-card {
  background: #fff;
  border-radius: 10px;
  padding: 18px;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.06);
  border: 1px solid #f1f5f9;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.best-tool-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.08);
}

.best-tool-card .tool-title {
  font-weight: 700;
  margin-bottom: 8px;
}

.best-tool-card .tool-desc {
  color: #6b7280;
  font-size: 14px;
}

@media (max-width: 1000px) {
  .best-tools-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .best-tools-grid {
    grid-template-columns: 1fr;
  }

  .font-style {
    padding: 12px;
  }
}

/* RTL Support */
[dir="rtl"] .text-area-box {
  text-align: right;
}

[dir="rtl"] .text-area-box textarea {
  padding: 0 0 0 30px;
  text-align: right;
}

[dir="rtl"] .clr-txt-area {
  right: auto !important;
  left: 20px !important;
}

[dir="rtl"] .clr-tooltip {
  right: auto !important;
  left: 0 !important;
  transform: translateX(-15%) !important;
}

[dir="rtl"] #char-counter {
  text-align: right;
}

[dir="rtl"] .font-style-text {
  text-align: right;
}

[dir="rtl"] .font-style-copy {
  margin-left: 0;
  margin-right: auto;
}

@media (max-width: 768px) {
  [dir="rtl"] .clr-txt-area {
    right: auto !important;
    left: 16px !important;
  }
}

@media (max-width: 480px) {
  [dir="rtl"] .clr-txt-area {
    right: auto !important;
    left: 12px !important;
  }
}