/* Modern Summernote Editor Styling - Dark Mode */

/* Main editor container */
.note-editor {
    border: 1px solid #1e1e1e;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    transition: all 0.3s ease;
    background: #1e1e1e;
}

.note-editor:focus-within {
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2), 0 4px 6px rgba(0, 0, 0, 0.3);
}

/* Toolbar styling */
.note-toolbar,
.note-editor .note-toolbar {
    background: #2d2d2d !important;
    border-bottom: 1px solid #3e3e3e !important;
    padding: 12px 16px;
    border-radius: 12px 12px 0 0;
}

.note-toolbar .btn-group {
    margin-right: 8px;
    margin-bottom: 4px;
}

/* Override any conflicting styles */
.note-editor.note-frame .note-toolbar,
.note-editor.note-airframe .note-toolbar {
    background: #2d2d2d !important;
    border-bottom: 1px solid #3e3e3e !important;
}

/* Button styling */
.note-btn {
    background: #3e3e3e;
    border: 1px solid #4b5563;
    color: #e5e7eb;
    padding: 8px 12px;
    border-radius: 8px;
    transition: all 0.2s ease;
    font-size: 14px;
    margin: 0 2px;
}

.note-btn:hover {
    background: #4b5563;
    color: #ffffff;
    border-color: #6b7280;
    transform: translateY(-1px);
}

.note-btn.active,
.note-btn:active {
    background: #4f46e5;
    color: #ffffff;
    border-color: #4f46e5;
    box-shadow: 0 2px 4px rgba(79, 70, 229, 0.3);
}

.note-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2);
}

/* Icon color fix */
.note-btn i,
.note-btn .note-icon-caret {
    color: inherit;
}

/* Dropdown toggle */
.note-btn.dropdown-toggle::after {
    color: inherit;
}

/* Ensure all button types have consistent styling */
.note-toolbar .btn,
.note-toolbar button,
.note-btn-group .btn,
.note-btn-group button {
    background: #3e3e3e !important;
    border: 1px solid #4b5563 !important;
    color: #e5e7eb !important;
}

.note-toolbar .btn:hover,
.note-toolbar button:hover,
.note-btn-group .btn:hover,
.note-btn-group button:hover {
    background: #4b5563 !important;
    color: #ffffff !important;
    border-color: #6b7280 !important;
}

.note-toolbar .btn.active,
.note-toolbar button.active,
.note-btn-group .btn.active,
.note-btn-group button.active {
    background: #4f46e5 !important;
    color: #ffffff !important;
    border-color: #4f46e5 !important;
}

/* Dropdown styling */
.note-dropdown-menu {
    border: 1px solid #3e3e3e;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    padding: 8px;
    background: #2d2d2d !important;
}

.note-dropdown-item {
    padding: 10px 16px;
    border-radius: 6px;
    transition: all 0.2s ease;
    color: #d4d4d4;
}

.note-dropdown-item:hover {
    background: #3e3e3e;
    color: #ffffff;
}

/* Editable area */
.note-editable {
    background: #1e1e1e !important;
    padding: 20px 24px;
    min-height: 200px;
    font-size: 15px;
    line-height: 1.7;
    color: #ffffff !important;
}

.note-editable:focus {
    outline: none;
}

/* Ensure all text in editable area is white */
.note-editable *,
.note-editable p,
.note-editable span,
.note-editable div,
.note-editable li,
.note-editable td,
.note-editable th {
    color: #ffffff !important;
}

/* Placeholder styling */
.note-placeholder {
    color: #6b7280;
    font-style: normal;
    padding: 20px 24px;
}

/* Status bar */
.note-statusbar {
    background: #2d2d2d;
    border-top: 1px solid #3e3e3e;
    padding: 10px 16px;
    border-radius: 0 0 12px 12px;
}

.note-resizebar {
    background: #4b5563;
    border-radius: 4px;
    height: 4px;
    cursor: ns-resize;
}

.note-resizebar:hover {
    background: #4f46e5;
}

/* Modal/Dialog styling */
.note-modal {
    border-radius: 16px;
    overflow: hidden;
}

.note-modal-header {
    background: #2d2d2d;
    color: #ffffff;
    padding: 20px 24px;
    border-bottom: 1px solid #3e3e3e;
}

.note-modal-title {
    font-weight: 600;
    font-size: 18px;
    color: #ffffff;
}

.note-modal-body {
    padding: 24px;
    background: #1e1e1e;
    color: #d4d4d4;
}

.note-modal-footer {
    background: #2d2d2d;
    padding: 16px 24px;
    border-top: 1px solid #3e3e3e;
}

.note-modal-footer .btn {
    border-radius: 8px;
    padding: 10px 20px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.note-modal-footer .btn-primary {
    background: #4f46e5;
    border: none;
}

.note-modal-footer .btn-primary:hover {
    background: #4338ca;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

/* Form controls in modal */
.note-form-control {
    border: 1px solid #3e3e3e;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 14px;
    transition: all 0.2s ease;
    background: #1e1e1e;
    color: #d4d4d4;
}

.note-form-control:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2);
}

/* Color palette */
.note-color-palette {
    border-radius: 10px;
    padding: 8px;
    background: #2d2d2d;
}

.note-color-btn {
    border-radius: 6px;
    width: 28px;
    height: 28px;
    margin: 3px;
    border: 2px solid transparent;
    transition: all 0.2s ease;
}

.note-color-btn:hover {
    transform: scale(1.1);
    border-color: #4f46e5;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

/* Image popover */
.note-popover {
    border: 1px solid #3e3e3e;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    background: #2d2d2d !important;
}

.note-popover .popover-content,
.note-popover .note-popover-content {
    padding: 12px;
    background: #2d2d2d;
}

.note-popover .btn {
    border-radius: 6px;
    margin: 2px;
    background: #3e3e3e;
    color: #d4d4d4;
}

.note-popover .btn:hover {
    background: #4b5563;
}

/* Handle styling */
.note-handle {
    border-radius: 8px;
}

.note-control-selection {
    border: 2px solid #4f46e5;
    border-radius: 6px;
}

.note-control-holder {
    background: #4f46e5;
    border: 2px solid #1e1e1e;
    border-radius: 50%;
    width: 10px;
    height: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Code view styling */
.note-codable {
    background: #1e1e1e;
    color: #d4d4d4;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    padding: 20px;
    border-radius: 0 0 12px 12px;
    font-size: 13px;
    line-height: 1.6;
}

/* Fullscreen mode */
.note-editor.fullscreen {
    border-radius: 0;
}

.note-editor.fullscreen .note-toolbar {
    border-radius: 0;
}

.note-editor.fullscreen .note-statusbar {
    border-radius: 0;
}

/* Icon styling */
.note-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Table styling */
.note-editable table {
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #3e3e3e;
}

.note-editable table th {
    background: #2d2d2d;
    font-weight: 600;
    padding: 12px;
    border-bottom: 2px solid #3e3e3e;
    color: #d4d4d4;
}

.note-editable table td {
    padding: 12px;
    border-bottom: 1px solid #3e3e3e;
    color: #d4d4d4;
}

.note-editable table tr:last-child td {
    border-bottom: none;
}

/* Link styling */
.note-editable a {
    color: #6366f1;
    text-decoration: underline;
    text-decoration-color: rgba(99, 102, 241, 0.3);
    transition: all 0.2s ease;
}

.note-editable a:hover {
    color: #818cf8;
    text-decoration-color: #818cf8;
}

/* Blockquote styling */
.note-editable blockquote {
    border-left: 4px solid #4f46e5;
    padding-left: 20px;
    margin: 20px 0;
    color: #9ca3af;
    font-style: italic;
    background: #2d2d2d;
    padding: 16px 20px;
    border-radius: 0 8px 8px 0;
}

/* Code block styling */
.note-editable pre {
    background: #0d1117;
    color: #d4d4d4;
    padding: 16px 20px;
    border-radius: 8px;
    overflow-x: auto;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 13px;
    line-height: 1.6;
    border: 1px solid #3e3e3e;
}

.note-editable code {
    background: #2d2d2d;
    color: #f87171;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9em;
}

.note-editable pre code {
    background: transparent;
    color: inherit;
    padding: 0;
}

/* HR styling */
.note-editable hr {
    border: none;
    border-top: 2px solid #3e3e3e;
    margin: 24px 0;
}

/* List styling */
.note-editable ul,
.note-editable ol {
    padding-left: 24px;
    margin: 12px 0;
    background: transparent !important;
}

.note-editable ul {
    list-style-type: disc !important;
}

.note-editable ol {
    list-style-type: decimal !important;
}

.note-editable li {
    margin: 8px 0;
    color: #d4d4d4 !important;
    background: transparent !important;
    list-style-position: outside;
    display: list-item !important;
}

.note-editable ul li {
    list-style-type: disc !important;
}

.note-editable ol li {
    list-style-type: decimal !important;
}

/* Nested lists */
.note-editable ul ul,
.note-editable ol ul {
    list-style-type: circle !important;
}

.note-editable ul ul ul,
.note-editable ol ul ul {
    list-style-type: square !important;
}

/* Heading styling */
.note-editable h1,
.note-editable h2,
.note-editable h3,
.note-editable h4,
.note-editable h5,
.note-editable h6 {
    font-weight: 600;
    margin-top: 24px;
    margin-bottom: 16px;
    color: #ffffff;
}

/* Character count styling */
.characters-count,
.total-characters {
    font-size: 13px;
    color: #9ca3af;
    padding: 8px 16px;
    background: #2d2d2d;
    border-radius: 0 0 12px 12px;
    text-align: right;
    border-top: 1px solid #3e3e3e;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .note-toolbar {
        padding: 10px 12px;
    }
    
    .note-btn {
        padding: 6px 10px;
        font-size: 13px;
    }
    
    .note-editable {
        padding: 16px;
        font-size: 14px;
    }
}

/* Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.note-dropdown-menu {
    animation: fadeIn 0.2s ease;
}

/* Scrollbar styling for modern browsers */
.note-editable::-webkit-scrollbar {
    width: 8px;
}

.note-editable::-webkit-scrollbar-track {
    background: #2d2d2d;
    border-radius: 4px;
}

.note-editable::-webkit-scrollbar-thumb {
    background: #4b5563;
    border-radius: 4px;
}

.note-editable::-webkit-scrollbar-thumb:hover {
    background: #6b7280;
}

/* Additional dark mode improvements */
.note-modal-content {
    background: #1e1e1e;
    color: #d4d4d4;
}

.note-modal .close {
    color: #d4d4d4;
    opacity: 0.7;
}

.note-modal .close:hover {
    color: #ffffff;
    opacity: 1;
}

/* Ensure all text in editable area is visible */
.note-editable * {
    color: inherit;
}

.note-editable strong,
.note-editable b {
    font-weight: 600;
    color: #ffffff;
}

.note-editable em,
.note-editable i {
    font-style: italic;
}

/* Image styling in editor */
.note-editable img {
    border-radius: 8px;
    max-width: 100%;
    height: auto;
}

/* Button groups */
.note-btn-group {
    display: inline-flex;
    gap: 2px;
}

/* Focus states */
.note-editor:focus-within .note-toolbar {
    border-bottom-color: #4f46e5;
}

/* Paragraph spacing */
.note-editable p {
    margin-bottom: 12px;
}

.note-editable p:last-child {
    margin-bottom: 0;
}
