/**
 * Mod Description Editor Styles - Inline Editing
 */

/* Edit Button Styling */
#edit-description-btn {
  padding: 0.4rem 0.8rem;
  font-size: 0.9rem;
  border-radius: 0.3rem;
  transition: all 0.2s ease;
  background-color: transparent;
  border: 1px solid #ffc107;
  color: #ffc107;
  white-space: nowrap;
}

#edit-description-btn:hover {
  background-color: #ffc107;
  color: #000;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(255, 193, 7, 0.3);
}

#edit-description-btn:active {
  transform: translateY(0);
  box-shadow: 0 1px 4px rgba(255, 193, 7, 0.2);
}

#edit-description-btn i {
  margin-right: 0.4rem;
}

/* Inline Editor Wrapper */
.description-inline-editor-wrapper {
  width: 100%;
  margin: 1rem 0;
}

/* Editor Container */
.description-inline-editor-container {
  background-color: #2a2a2a;
  border: 2px solid #3a3a3a;
  border-radius: 0.5rem;
  overflow: hidden;
  transition: all 0.3s ease;
}

.description-inline-editor-container:focus-within {
  border-color: #ffc107;
  box-shadow: 0 0 12px rgba(255, 193, 7, 0.2);
}

/* WYSIWYG Toolbar */
.description-inline-editor-container .bbcode-toolbar {
  background-color: #242424;
  border-bottom: 1px solid #3a3a3a;
  padding: 0.8rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

.description-inline-editor-container .bbcode-btn {
  padding: 0.5rem 0.7rem;
  background-color: #333;
  color: #e0e0e0;
  border: 1px solid #444;
  border-radius: 0.3rem;
  cursor: pointer;
  transition: all 0.15s ease;
  font-size: 0.9rem;
  min-width: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.description-inline-editor-container .bbcode-btn:hover {
  background-color: #3a3a3a;
  border-color: #555;
  color: #ffc107;
  transform: scale(1.05);
}

.description-inline-editor-container .bbcode-btn.active {
  background-color: #ffc107;
  color: #000;
  border-color: #ffc107;
}

.description-inline-editor-container .bbcode-btn:active {
  transform: scale(0.98);
}

.bbcode-toolbar-separator {
  width: 1px;
  height: 24px;
  background-color: #444;
  margin: 0 0.3rem;
}

/* WYSIWYG Editor Content Area Container */
.description-inline-editor-content {
  display: contents;
}

/* WYSIWYG Editor Content (actual editable area) */
.description-inline-editor-content .wysiwyg-content {
  background-color: #2a2a2a;
  color: #e0e0e0;
  padding: 1.2rem;
  /*min-height: 250px;*/
  border-radius: 0;
  line-height: 1.6;
  word-break: break-word;
  overflow-wrap: break-word;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  font-size: 1rem;
  outline: none;
  display: block;
}

.description-inline-editor-content .wysiwyg-content:focus {
  outline: none;
}

/* Character Counter */
.description-editor-counter {
  padding: 0 1.2rem 0.8rem 1.2rem;
  background-color: #2a2a2a;
  border-top: 1px solid #3a3a3a;
}

.description-editor-counter small {
  color: #bbb;
}

.description-editor-counter .char-count {
  color: #ffc107;
  font-weight: 600;
}

/* Buttons Container */
.description-editor-buttons {
  padding: 1rem 1.2rem;
  background-color: #242424;
  border-top: 1px solid #3a3a3a;
}

.description-editor-buttons .btn {
  padding: 0.5rem 1rem;
  border-radius: 0.3rem;
  transition: all 0.2s ease;
  font-weight: 500;
}

.description-editor-buttons .btn-outline-secondary {
  color: #e0e0e0;
  border-color: #444;
}

.description-editor-buttons .btn-outline-secondary:hover {
  background-color: #333;
  border-color: #555;
  color: #fff;
}

.description-editor-buttons .btn-success {
  background-color: #28a745;
  border-color: #28a745;
  color: #fff;
}

.description-editor-buttons .btn-success:hover {
  background-color: #20c997;
  border-color: #20c997;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
}

.description-editor-buttons .btn-success:active {
  transform: translateY(0);
  box-shadow: 0 1px 4px rgba(40, 167, 69, 0.2);
}

.description-editor-buttons .btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* BBCode Preview Styles */
.description-inline-editor-content b,
.description-inline-editor-content strong {
  color: #ffffff;
  font-weight: 600;
}

.description-inline-editor-content i,
.description-inline-editor-content em {
  color: #ffc107;
}

.description-inline-editor-content u,
.description-inline-editor-content ins {
  text-decoration: underline;
  text-decoration-color: #ffc107;
  text-decoration-thickness: 2px;
}

.description-inline-editor-content s,
.description-inline-editor-content del,
.description-inline-editor-content strike {
  text-decoration: line-through;
  color: #999;
}

.description-inline-editor-content h1,
.description-inline-editor-content h2,
.description-inline-editor-content h3,
.description-inline-editor-content h4,
.description-inline-editor-content h5,
.description-inline-editor-content h6 {
  color: #ffc107;
  margin: 0.8rem 0 0.4rem 0;
  font-weight: 600;
}

.description-inline-editor-content blockquote {
  border-left: 4px solid #ffc107;
  padding-left: 1rem;
  margin: 0.8rem 0;
  color: #bbb;
  font-style: italic;
}

.description-inline-editor-content code,
.description-inline-editor-content pre {
  background-color: #1a1a1a;
  color: #90ee90;
  padding: 0.2rem 0.5rem;
  border-radius: 0.3rem;
  font-family: 'Courier New', monospace;
  overflow-x: auto;
  line-height: 1.4;
}

.description-inline-editor-content pre {
  padding: 1rem;
  margin: 0.8rem 0;
}

.description-inline-editor-content pre code {
  padding: 0;
  background-color: transparent;
  color: inherit;
}

.description-inline-editor-content ul,
.description-inline-editor-content ol {
  margin: 0.8rem 0 0.8rem 2rem;
  padding-left: 0;
}

.description-inline-editor-content li {
  margin: 0.3rem 0;
}

/* Success Message Toast */
.alert-success {
  background-color: #1e5631;
  border: 1px solid #28a745;
  color: #90ee90;
}

.alert-success i {
  color: #28a745;
}

/* Responsive */
@media (max-width: 768px) {
  #edit-description-btn {
    padding: 0.3rem 0.6rem;
    font-size: 0.85rem;
  }

  .description-inline-editor-container .bbcode-toolbar {
    gap: 0.3rem;
    padding: 0.6rem;
  }

  .description-inline-editor-container .bbcode-btn {
    padding: 0.4rem 0.5rem;
    min-width: 32px;
    font-size: 0.8rem;
  }

  .description-inline-editor-content {
    min-height: 180px;
    padding: 0.8rem;
  }

  .description-editor-buttons {
    flex-direction: column;
    gap: 0.5rem;
  }

  .description-editor-buttons .btn {
    width: 100%;
  }
}

/* BBCode specific styles */
.bbcode-preview-quote {
  border-left: 4px solid #ffc107;
  padding-left: 1rem;
  margin: 0.8rem 0;
  color: #bbb;
  font-style: italic;
}

.bbcode-preview-code {
  background-color: #1a1a1a;
  color: #90ee90;
  padding: 1rem;
  border-radius: 0.3rem;
  font-family: 'Courier New', monospace;
  overflow-x: auto;
  margin: 0.8rem 0;
  line-height: 1.4;
}

.bbcode-preview-code code {
  background-color: transparent;
  color: inherit;
  padding: 0;
}

.bbcode-spoiler {
  background-color: #2a2a2a;
  border: 1px solid #444;
  border-radius: 0.3rem;
  margin: 0.8rem 0;
  overflow: hidden;
}

.bbcode-spoiler-header {
  background-color: #333;
  padding: 0.6rem 1rem;
  cursor: pointer;
  user-select: none;
  color: #ffc107;
  font-weight: 500;
  transition: all 0.2s ease;
}

.bbcode-spoiler-header:hover {
  background-color: #3a3a3a;
}

.bbcode-spoiler-content {
  padding: 1rem;
  color: #e0e0e0;
  display: block;
}

.bbcode-spoiler-content-hidden {
  display: none;
}

