/* Markdown Editor Container */
.markdown-editor {
    width: 100%;
    position: relative;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    /* background: #2d2d2d; */
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    margin-bottom: 2rem;
}

/* Editor Textarea */
.markdown-editor textarea {
    width: 100%;
    min-height: 300px;
    padding: 1rem;
    font-size: 1rem;
    line-height: 1.5;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    resize: vertical;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}

.markdown-editor textarea:focus {
    border-color: #0077cc;
    box-shadow: 0 0 0 2px rgba(0, 119, 204, 0.2);
}

/* Preview Section */
.markdown-preview {
    margin-top: 0.5rem;
    padding: 1.5rem;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    background: #000000;
    min-height: 150px;
}

.markdown-preview-header {
    padding: 0.5rem 1rem;
    /* background-color: rgba(255, 255, 255, 0.05); */
    font-weight: 500;
    /* color: #555; */
    font-size: 0.9rem;
    /* border-top: 1px solid #e0e0e0; */
    display: flex;
    align-items: center;
}

.markdown-preview-header:before {
    content: '\f06e';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    margin-right: 8px;
    color: #ffffff;
}

/* Markdown Toolbar */
.markdown-toolbar {
    display: flex;
    flex-wrap: wrap;
    background: #000000;
    /* border-bottom: 1px solid #e0e0e0; */
    padding: 8px 10px;
    gap: 5px;
}

.markdown-toolbar button {
    background: transparent;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    color: #ffffff;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
}

.markdown-toolbar button:hover {
    background: #e9f5ff;
    border-color: #0077cc;
    color: #0077cc;
}

.markdown-toolbar .toolbar-divider {
    width: 1px;
    height: 24px;
    background: #e0e0e0;
    margin: 0 5px;
}

/* Improved styling for the suggestions panel */
.markdown-suggestions {
    position: fixed; /* Change to fixed positioning */
    z-index: 10000; /* Ensure it appears above other elements */
    background: #000000;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    max-height: 300px;
    overflow-y: auto;
    width: 300px;
    animation: fadeIn 0.2s ease-out;
}
.markdown-suggestions::-webkit-scrollbar {
    width: 8px;
}
.markdown-suggestions::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}
.markdown-suggestions::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.4);
}
.markdown-suggestions::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

.suggestion-item {
    padding: 8px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: background 0.15s;
    color: #e0e0e0;
}

.suggestion-item:not(:last-child) {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.suggestion-item:hover {
    background-color: #111111;
}

.suggestion-item.selected {
    background-color: #222222;
}

.suggestion-icon {
    margin-right: 14px;
    color: #ffffff;
    font-size: 16px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(86, 200, 255, 0.1);
    border-radius: 4px;
}

.suggestion-content {
    flex: 1;
}

.command {
    font-weight: 600;
    margin-bottom: 4px;
    color: #ffffff;
    display: block;
}

.description {
    font-size: 0.85rem;
    color: #aaaaaa;
    display: block;
}

/* Preview content styling to match detail.css */
.markdown-preview h1, 
.markdown-preview h2, 
.markdown-preview h3, 
.markdown-preview h4 {
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    line-height: 1.3;
    color: #333;
}

.markdown-preview h2 {
    font-size: 1.6rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    padding-bottom: 0.5rem;
}

.markdown-preview h3 {
    font-size: 1.3rem;
}

.markdown-preview p {
    margin: 1rem 0;
    line-height: 1.6;
}

.markdown-preview blockquote {
    border-left: 4px solid #303030;
    padding: 0.5rem 1rem;
    margin: 1rem 0;
    background: #7e7e7e;
}

.markdown-preview code {
    background: #7e7e7e;
    padding: 0.2em 0.4em;
    border-radius: 3px;
    font-family: monospace;
    font-size: 0.9em;
}

.markdown-preview pre {
    background: #7e7e7e;
    padding: 1rem;
    border-radius: 5px;
    overflow-x: auto;
    margin: 1rem 0;
}

.markdown-preview pre code {
    background: transparent;
    padding: 0;
}

.markdown-preview img {
    max-width: 100%;
    border-radius: 5px;
}

.markdown-preview a {
    color: #0077cc;
    text-decoration: none;
}

.markdown-preview ul,
.markdown-preview ol {
    padding-left: 2rem;
    margin: 1rem 0;
}

.markdown-preview table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

.markdown-preview th,
.markdown-preview td {
    border: 1px solid #e0e0e0;
    padding: 8px 12px;
}

.markdown-preview th {
    background: #f5f5f5;
    font-weight: bold;
}

/* Editor placeholder styling */
.markdown-editor textarea::placeholder {
    color: #999;
    font-style: italic;
}

/* Indicator for slash commands */
.slash-indicator {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    opacity: 0.7;
}

.slash-indicator i {
    margin-right: 4px;
}