/* YouTube Description Formatter Styles */
.statmat-tool.youtube-formatter {
  font-family: Roboto, Arial, sans-serif;
  max-width: 800px;
  margin: 0 auto;
  color: #0f0f0f;
}

.statmat-tool.youtube-formatter * {
  box-sizing: border-box;
}

.statmat-tool.youtube-formatter .toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  background-color: #f2f2f2;
  border: 1px solid #ccc;
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  padding: 10px;
}

.statmat-tool.youtube-formatter .format-btn {
  background-color: transparent;
  border: 1px solid transparent;
  border-radius: 4px;
  height: 32px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
  color: #0f0f0f;
  font-weight: 500;
  transition: all 0.2s;
}

.statmat-tool.youtube-formatter .format-btn:hover {
  background-color: #e5e5e5;
}

.statmat-tool.youtube-formatter .toolbar-divider {
  width: 1px;
  background-color: #ccc;
  margin: 0 6px;
}

.statmat-tool.youtube-formatter .input-wrapper {
  margin-bottom: 16px;
}

.statmat-tool.youtube-formatter textarea {
  width: 100%;
  padding: 16px;
  border: 1px solid #ccc;
  border-radius: 0 0 8px 8px;
  font-size: 15px;
  font-family: inherit;
  resize: vertical;
  min-height: 250px;
  transition: border-color 0.2s;
  background-color: #fff;
  line-height: 1.5;
}

.statmat-tool.youtube-formatter textarea:focus {
  outline: none;
  border-color: #065fd4; /* YouTube Blue */
}

.statmat-tool.youtube-formatter .action-bar {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-bottom: 32px;
}

.statmat-tool.youtube-formatter .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 24px;
  border-radius: 18px; /* YouTube style pill buttons */
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  border: none;
  transition: background-color 0.2s;
}

.statmat-tool.youtube-formatter .btn-primary {
  background-color: #0f0f0f;
  color: #fff;
}

.statmat-tool.youtube-formatter .btn-primary:hover {
  background-color: #272727;
}

.statmat-tool.youtube-formatter .btn-secondary {
  background-color: #0000000d; /* YouTube light grey btn */
  color: #0f0f0f;
}

.statmat-tool.youtube-formatter .btn-secondary:hover {
  background-color: #0000001a;
}

/* YouTube Preview Area */
.statmat-tool.youtube-formatter .preview-section h4 {
  margin-top: 0;
  margin-bottom: 12px;
  font-size: 16px;
  color: #606060;
  font-weight: 500;
}

.statmat-tool.youtube-formatter .youtube-preview-box {
  background-color: #f2f2f2;
  border-radius: 12px;
  padding: 16px;
  max-width: 600px;
}

.statmat-tool.youtube-formatter .yt-header {
  margin-bottom: 12px;
}

.statmat-tool.youtube-formatter .yt-title {
  font-size: 20px;
  font-weight: 700;
  color: #0f0f0f;
  margin-bottom: 4px;
}

.statmat-tool.youtube-formatter .yt-stats {
  font-size: 14px;
  color: #606060;
  font-weight: 500;
}

.statmat-tool.youtube-formatter .yt-body {
  font-size: 14px;
  line-height: 1.4;
  color: #0f0f0f;
  white-space: pre-wrap;
  word-wrap: break-word;
  margin-bottom: 12px;
}

.statmat-tool.youtube-formatter .yt-show-more {
  font-size: 14px;
  font-weight: 500;
  color: #606060;
  cursor: pointer;
}

/* YouTube Markdown Styling */
.statmat-tool.youtube-formatter .yt-body strong {
  font-weight: bold;
}
.statmat-tool.youtube-formatter .yt-body em {
  font-style: italic;
}
.statmat-tool.youtube-formatter .yt-body del {
  text-decoration: line-through;
}
.statmat-tool.youtube-formatter .yt-body .yt-link {
  color: #065fd4;
  text-decoration: none;
  cursor: pointer;
}

/* Empty State */
.statmat-tool.youtube-formatter .empty-preview {
  color: #606060;
}

/* Toast */
.statmat-tool.youtube-formatter .toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background-color: #0f0f0f;
  color: white;
  padding: 12px 24px;
  border-radius: 4px;
  font-weight: 500;
  font-size: 14px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, transform 0.3s, visibility 0.3s;
  z-index: 9999;
}

.statmat-tool.youtube-formatter .toast.show {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

/* Global override for mobile scrolling on long results */
.statmat-tool [class*="result"], 
.statmat-tool [class*="output"],
.statmat-tool [class*="preview"],
.statmat-tool [class*="display"] {
  overflow-x: auto;
  max-width: 100%;
}

/* Global safeguard: ensure main wrapper never exceeds mobile viewport */
.statmat-tool {
  width: 100% !important;
  box-sizing: border-box;
}
