/* ПРОСТЫЕ стили для WYSIWYG редактора */

.wysiwyg-content {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  overflow-y: auto;
  max-height: 500px;
  /* Match form-control styling */
  background-color: #2d2d36;
  border: 1px solid #495057;
  border-radius: 0.375rem;
  padding: 0.75rem;
  min-height: 120px;
  color: #e0e0e0;
}

.wysiwyg-content:focus {
  outline: none;
  border-color: var(--nexus-orange, #ff7600) !important;
  box-shadow: 0 0 0 2px rgba(255, 118, 0, 0.2);
}

/* Форматирование в WYSIWYG */
.wysiwyg-content strong,
.wysiwyg-content b {
  font-weight: bold;
}

.wysiwyg-content em,
.wysiwyg-content i {
  font-style: italic;
}

.wysiwyg-content u {
  text-decoration: underline;
}

.wysiwyg-content del,
.wysiwyg-content s {
  text-decoration: line-through;
}

.wysiwyg-content h1 {
  font-size: 2em;
  font-weight: bold;
  margin: 0.5em 0;
}

.wysiwyg-content h2 {
  font-size: 1.5em;
  font-weight: bold;
  margin: 0.5em 0;
}

.wysiwyg-content h3 {
  font-size: 1.17em;
  font-weight: bold;
  margin: 0.5em 0;
}

.wysiwyg-content ul,
.wysiwyg-content ol {
  margin: 0.5em 0;
  padding-left: 2em;
}

.wysiwyg-content ul {
  list-style-type: disc;
}

.wysiwyg-content ol {
  list-style-type: decimal;
}

.wysiwyg-content li {
  margin: 0.25em 0;
}

.wysiwyg-content blockquote {
  border-left: 3px solid var(--nexus-gold, #f4c842);
  padding-left: 1em;
  margin: 1em 0;
  font-style: italic;
  color: #ccc;
}

.wysiwyg-content pre,
.wysiwyg-content code {
  background: #1e1e1e;
  padding: 0.5em;
  border-radius: 0.25rem;
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  font-size: 0.9em;
}

.wysiwyg-content pre {
  display: block;
  margin: 1em 0;
  overflow-x: auto;
}

.wysiwyg-content a {
  color: var(--nexus-gold, #f4c842);
  text-decoration: none;
}

.wysiwyg-content a:hover {
  text-decoration: underline;
}

.wysiwyg-content img,
.wysiwyg-content iframe,
.bbcode-youtube,
.bbcode-preview-image {
  max-width: 512px !important;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  display: block;
  margin: 0.5em 0;
}

.wysiwyg-content img,
.bbcode-preview-image {
  height: auto;
  aspect-ratio: auto;
}

/* Placeholder */
.wysiwyg-content:empty:before {
  content: attr(data-placeholder);
  color: #999;
  font-style: italic;
}

/* === MODAL STYLES === */

.bbcode-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

.bbcode-modal {
  background: #2d2d36;
  border: 1px solid #495057;
  border-radius: 0.5rem;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  color: #e0e0e0;
}

.bbcode-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  border-bottom: 1px solid #495057;
}

.bbcode-modal-header h5 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
}

.bbcode-modal-close {
  background: none;
  border: none;
  color: #e0e0e0;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.25rem;
  transition: background-color 0.2s;
}

.bbcode-modal-close:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.bbcode-modal-body {
  padding: 1.5rem;
}

.bbcode-modal-footer {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  padding: 1rem;
  border-top: 1px solid #495057;
}

/* Color Picker */
.bbcode-color-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 0.75rem;
}

.bbcode-color-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem;
  background: #3a3a42;
  border: 1px solid #495057;
  border-radius: 0.25rem;
  color: #e0e0e0;
  cursor: pointer;
  transition: all 0.2s;
}

.bbcode-color-btn:hover {
  background: #4a4a52;
  border-color: #f4c842;
  transform: translateY(-2px);
}

.bbcode-color-preview {
  display: block;
  width: 40px;
  height: 40px;
  border-radius: 0.25rem;
  border: 1px solid rgba(0, 0, 0, 0.3);
}

/* Color previews for palette */
.bbcode-color-preview-red {
  background-color: red;
}

.bbcode-color-preview-green {
  background-color: green;
}

.bbcode-color-preview-blue {
  background-color: blue;
}

.bbcode-color-preview-yellow {
  background-color: yellow;
}

.bbcode-color-preview-orange {
  background-color: orange;
}

.bbcode-color-preview-purple {
  background-color: purple;
}

.bbcode-color-preview-pink {
  background-color: pink;
}

.bbcode-color-preview-aqua {
  background-color: aqua;
}

.bbcode-color-preview-black {
  background-color: black;
}

.bbcode-color-preview-white {
  background-color: white;
  border-color: rgba(255, 255, 255, 0.5);
}

.bbcode-color-preview-gray {
  background-color: gray;
}

.bbcode-color-preview-brown {
  background-color: brown;
}

.bbcode-color-label {
  font-size: 0.85rem;
  text-align: center;
  line-height: 1.2;
}

/* Size List */
.bbcode-size-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

.bbcode-size-btn {
  padding: 0.75rem;
  background: #3a3a42;
  border: 1px solid #495057;
  border-radius: 0.25rem;
  color: #e0e0e0;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}

.bbcode-size-btn:hover {
  background: #4a4a52;
  border-color: #f4c842;
}

/* URL Form */
.bbcode-url-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.bbcode-url-form label {
  font-weight: 500;
  color: #e0e0e0;
}

.bbcode-url-form input[type="text"] {
  padding: 0.5rem;
  background: #3a3a42;
  border: 1px solid #495057;
  border-radius: 0.25rem;
  color: #e0e0e0;
  font-size: 0.95rem;
}

.bbcode-url-form input[type="text"]:focus {
  outline: none;
  border-color: #f4c842;
  box-shadow: 0 0 0 2px rgba(244, 200, 66, 0.2);
}

/* === SIZE CLASSES === */
.bbcode-size-px-8 {
  font-size: 8px;
}

.bbcode-size-px-10 {
  font-size: 10px;
}

.bbcode-size-px-12 {
  font-size: 12px;
}

.bbcode-size-px-14 {
  font-size: 14px;
}

.bbcode-size-px-16 {
  font-size: 16px;
}

.bbcode-size-px-18 {
  font-size: 18px;
}

.bbcode-size-px-20 {
  font-size: 20px;
}

.bbcode-size-px-24 {
  font-size: 24px;
}

.bbcode-size-px-28 {
  font-size: 28px;
}

.bbcode-size-px-32 {
  font-size: 32px;
}

.bbcode-size-em-0_75 {
  font-size: 0.75em;
}

.bbcode-size-em-1 {
  font-size: 1em;
}

.bbcode-size-em-1_25 {
  font-size: 1.25em;
}

.bbcode-size-em-1_5 {
  font-size: 1.5em;
}

.bbcode-size-em-2 {
  font-size: 2em;
}

.bbcode-size-percent-50 {
  font-size: 50%;
}

.bbcode-size-percent-75 {
  font-size: 75%;
}

.bbcode-size-percent-100 {
  font-size: 100%;
}

.bbcode-size-percent-125 {
  font-size: 125%;
}

.bbcode-size-percent-150 {
  font-size: 150%;
}

.bbcode-size-percent-200 {
  font-size: 200%;
}

.bbcode-size-default {
  font-size: inherit;
}

/* === COLOR CLASSES === */
.bbcode-color-red {
  color: red;
}

.bbcode-color-green {
  color: green;
}

.bbcode-color-blue {
  color: blue;
}

.bbcode-color-yellow {
  color: yellow;
}

.bbcode-color-orange {
  color: orange;
}

.bbcode-color-purple {
  color: purple;
}

.bbcode-color-pink {
  color: pink;
}

.bbcode-color-aqua {
  color: aqua;
}

.bbcode-color-black {
  color: black;
}

.bbcode-color-white {
  color: white;
}

.bbcode-color-gray {
  color: gray;
}

.bbcode-color-brown {
  color: brown;
}

.bbcode-color-inherit {
  color: inherit;
}

/* Hex colors with prefix pattern */
.wysiwyg-content [class*="bbcode-color-hex-"] {
  color: inherit;
}
/* Spoiler Styles */
.bbcode-spoiler { margin: 10px 0; border: 1px solid #495057; border-radius: 4px; background: #2d2d36; }
.bbcode-spoiler-header { background: #3a3a45; padding: 8px 12px; cursor: pointer; user-select: none; font-weight: bold; font-size: 0.9em; }
.bbcode-spoiler-header:hover { background: #444450; }
.bbcode-spoiler-content { padding: 10px; border-top: 1px solid #495057; }
.bbcode-spoiler-content-hidden { display: none; }
