/* Summernote Dark Theme for Wiki Editor */

/* Main editor container */
#wiki-editor {
  min-height: 400px;
  background: #1e1e1e;
  border: 1px solid #3c3c3c;
  border-radius: 4px;
  width: 100% !important;
}

/* Summernote note editor */
.note-editor {
  background: #1e1e1e;
  border: 1px solid #3c3c3c;
  color: #d4d4d4;
  position: relative;
}

.note-editor.note-frame {
  background: #1e1e1e;
  border: 1px solid #3c3c3c;
  width: 100%;
}

/* Toolbar styling - Dark theme with high specificity */
.note-editor .note-toolbar.card-header,
.note-editor .note-toolbar,
.note-editing-area .note-toolbar {
  background: #2d2d2d !important;
  border-bottom: 1px solid #3c3c3c !important;
  padding: 8px 10px !important;
  display: block !important;
  width: 100% !important;
  overflow: visible !important;
}

/* Button groups with proper layout */
.note-editor .note-toolbar .note-btn-group,
.note-editing-area .note-toolbar .note-btn-group {
  display: inline-block !important;
  margin-right: 6px !important;
  margin-bottom: 6px !important;
  vertical-align: top !important;
  float: none !important;
}

/* Toolbar buttons with proper sizing */
.note-editor .note-toolbar .note-btn,
.note-editing-area .note-toolbar .note-btn,
.note-editor .note-toolbar .note-btn.btn,
.note-editing-area .note-toolbar .note-btn.btn {
  background: #3c3c3c !important;
  color: #d4d4d4 !important;
  border: 1px solid #4d4d4d !important;
  border-radius: 3px !important;
  padding: 6px 10px !important;
  margin: 0 !important;
  font-size: 14px !important;
  line-height: 1.4 !important;
  display: inline-block !important;
  vertical-align: middle !important;
  min-width: 30px !important;
  height: auto !important;
  cursor: pointer !important;
  float: none !important;
  position: relative !important;
}

.note-editor .note-toolbar .note-btn:hover,
.note-editing-area .note-toolbar .note-btn:hover {
  background: #4d4d4d !important;
  color: #ffffff !important;
  border-color: #5d5d5d !important;
}

.note-editor .note-toolbar .note-btn:active,
.note-editor .note-toolbar .note-btn.active,
.note-editing-area .note-toolbar .note-btn:active,
.note-editing-area .note-toolbar .note-btn.active {
  background: #505050 !important;
  color: #ffffff !important;
  border-color: #606060 !important;
}

.note-editor .note-toolbar .note-btn:focus,
.note-editing-area .note-toolbar .note-btn:focus {
  outline: none !important;
  box-shadow: 0 0 0 2px rgba(79, 195, 247, 0.3) !important;
}

/* Toolbar icons with high specificity */
.note-editor .note-toolbar .note-icon,
.note-editing-area .note-toolbar .note-icon,
.note-editor .note-toolbar .note-btn .note-icon,
.note-editing-area .note-toolbar .note-btn .note-icon {
  color: #d4d4d4 !important;
  font-size: 14px !important;
  display: inline-block !important;
}

.note-editor .note-toolbar .note-btn:hover .note-icon,
.note-editing-area .note-toolbar .note-btn:hover .note-icon {
  color: #ffffff !important;
}

/* Dropdown toggle */
.note-editor .note-toolbar .dropdown-toggle::after,
.note-editing-area .note-toolbar .dropdown-toggle::after {
  margin-left: 4px !important;
  vertical-align: middle !important;
  display: inline-block !important;
}

/* Clear floats in toolbar */
.note-editor .note-toolbar::after,
.note-editing-area .note-toolbar::after {
  content: "" !important;
  display: table !important;
  clear: both !important;
}

/* Dropdown menus */
.note-toolbar .dropdown-menu {
  background: #2d2d2d !important;
  border: 1px solid #3c3c3c !important;
  margin-top: 2px !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
}

.note-toolbar .dropdown-item {
  color: #d4d4d4 !important;
  padding: 8px 16px !important;
}

.note-toolbar .dropdown-item:hover,
.note-toolbar .dropdown-item:focus {
  background: #3c3c3c !important;
  color: #ffffff !important;
}

/* Editor content area */
.note-editable {
  background: #1e1e1e !important;
  color: #d4d4d4 !important;
  min-height: 400px !important;
  padding: 15px !important;
  font-size: 14px !important;
  line-height: 1.6 !important;
}

.note-editable:focus {
  background: #1e1e1e !important;
  color: #d4d4d4 !important;
}

/* Placeholder text */
.note-editable.note-placeholder {
  color: #6e6e6e !important;
}

/* Code view */
.note-codable {
  background: #1e1e1e !important;
  color: #d4d4d4 !important;
  border: 1px solid #3c3c3c !important;
}

/* Status bar */
.note-statusbar {
  background: #2d2d2d !important;
  border-top: 1px solid #3c3c3c !important;
}

.note-resizebar {
  background: #3c3c3c !important;
}

/* Color palette */
.note-color .dropdown-menu {
  background: #2d2d2d !important;
  border: 1px solid #3c3c3c !important;
}

.note-color-palette div .note-color-btn {
  border: 1px solid #4d4d4d !important;
}

/* Font size dropdown */
.note-fontsize .dropdown-menu {
  background: #2d2d2d !important;
}

.note-fontsize .dropdown-item {
  color: #d4d4d4 !important;
}

/* Headings in editor */
.note-editable h1,
.note-editable h2,
.note-editable h3,
.note-editable h4,
.note-editable h5,
.note-editable h6 {
  color: #ffffff !important;
}

/* Links in editor */
.note-editable a {
  color: #4fc3f7 !important;
}

/* Code blocks */
.note-editable pre {
  background: #2d2d2d !important;
  color: #d4d4d4 !important;
  border: 1px solid #3c3c3c !important;
  padding: 10px !important;
  border-radius: 4px !important;
}

.note-editable code {
  background: #2d2d2d !important;
  color: #d4d4d4 !important;
  padding: 2px 6px !important;
  border-radius: 3px !important;
}

/* Tables */
.note-editable table {
  border-color: #3c3c3c !important;
}

.note-editable table th,
.note-editable table td {
  border: 1px solid #3c3c3c !important;
  color: #d4d4d4 !important;
}

.note-editable table th {
  background: #2d2d2d !important;
  color: #ffffff !important;
}

/* Blockquotes */
.note-editable blockquote {
  border-left: 4px solid #4fc3f7 !important;
  background: #2d2d2d !important;
  color: #d4d4d4 !important;
  padding: 10px 15px !important;
  margin: 10px 0 !important;
}

/* Lists */
.note-editable ul,
.note-editable ol {
  color: #d4d4d4 !important;
}

/* Horizontal rule */
.note-editable hr {
  border-color: #3c3c3c !important;
}

/* Modal dialogs */
.note-modal .modal-content {
  background: #2d2d2d !important;
  color: #d4d4d4 !important;
  border: 1px solid #3c3c3c !important;
}

.note-modal .modal-header {
  background: #252525 !important;
  border-bottom: 1px solid #3c3c3c !important;
}

.note-modal .modal-title {
  color: #ffffff !important;
}

.note-modal .modal-body {
  background: #2d2d2d !important;
  color: #d4d4d4 !important;
}

.note-modal .form-control {
  background: #1e1e1e !important;
  color: #d4d4d4 !important;
  border: 1px solid #3c3c3c !important;
}

.note-modal .form-control:focus {
  background: #1e1e1e !important;
  color: #d4d4d4 !important;
  border-color: #4fc3f7 !important;
}

.note-modal .btn-primary {
  background: #4fc3f7 !important;
  border-color: #4fc3f7 !important;
  color: #000 !important;
}

.note-modal .btn-primary:hover {
  background: #29b6f6 !important;
  border-color: #29b6f6 !important;
}

/* Popover */
.note-popover {
  background: #2d2d2d !important;
  border: 1px solid #3c3c3c !important;
}

.note-popover .popover-content,
.note-popover .arrow::after {
  background: #2d2d2d !important;
  border-color: #3c3c3c !important;
}

/* Handle */
.note-handle .note-control-selection {
  border: 1px solid #4fc3f7 !important;
}

/* Image popover */
.note-image-popover {
  background: #2d2d2d !important;
  border: 1px solid #3c3c3c !important;
}

/* Link popover */
.note-link-popover {
  background: #2d2d2d !important;
  border: 1px solid #3c3c3c !important;
}

.note-link-popover a {
  color: #4fc3f7 !important;
}

/* Help dialog */
.note-help-dialog .modal-content {
  background: #2d2d2d !important;
  color: #d4d4d4 !important;
}

/* Wiki editor container */
.wiki-editor-container {
  margin-top: 20px;
  display: block !important;
}

.wiki-title-container {
  margin-bottom: 15px;
}

.wiki-title-input {
  background: #1e1e1e !important;
  color: #d4d4d4 !important;
  border: 1px solid #3c3c3c !important;
  padding: 10px 15px;
  font-size: 18px;
  font-weight: 600;
  border-radius: 4px;
}

.wiki-title-input:focus {
  background: #1e1e1e !important;
  color: #d4d4d4 !important;
  border-color: #4fc3f7 !important;
  outline: none !important;
}

.wiki-title-input::placeholder {
  color: #6e6e6e !important;
}

/* Scrollbar for dark theme */
.note-editable::-webkit-scrollbar {
  width: 12px;
}

.note-editable::-webkit-scrollbar-track {
  background: #1e1e1e;
}

.note-editable::-webkit-scrollbar-thumb {
  background: #3c3c3c;
  border-radius: 6px;
}

.note-editable::-webkit-scrollbar-thumb:hover {
  background: #4d4d4d;
}

/* Selection color */
.note-editable ::selection {
  background: #264f78 !important;
  color: #ffffff !important;
}