/* Rich Text Editor Styles - Light Theme Only */
.rich-text-editor {
    border: 1px solid #cbd5e1;
    border-radius: 0.5rem;
    overflow: hidden;
    transition: all 0.2s ease;
    background-color: white;
}

.rich-text-editor:focus-within {
    border-color: #2f2f77;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Toolbar */
.rich-text-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem;
    background-color: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.toolbar-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    border: none;
    background: transparent;
    color: #64748b;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.toolbar-button:hover {
    background-color: #e2e8f0;
    color: #334155;
}

.toolbar-button:active,
.toolbar-button.active {
    background-color: #2f2f77;
    color: white;
}

.toolbar-button:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.4);
}

.toolbar-separator {
    width: 1px;
    height: 1.5rem;
    background-color: #e2e8f0;
    margin: 0 0.25rem;
}

/* Editor Content Area - Always Light */
.rich-text-content {
    padding: 1rem;
    min-height: 150px;
    overflow-y: auto;
    outline: none;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 1rem;
    line-height: 1.6;
    color: #1e293b;
    background-color: white;
    position: relative;
}

.rich-text-content:focus {
    outline: none;
}

/* Placeholder */
.rich-text-content:empty:not(.focused-empty):before {
    content: attr(data-placeholder);
    color: #94a3b8;
    pointer-events: none;
    position: absolute;
    top: 1rem;
    left: 1rem;
}

/* Content Styles */
.rich-text-content h1,
.rich-text-content h2,
.rich-text-content h3,
.rich-text-content h4,
.rich-text-content h5,
.rich-text-content h6 {
    margin: 1rem 0 0.5rem 0;
    font-weight: 600;
    line-height: 1.25;
    color: #1e293b;
}

.rich-text-content h1 { font-size: 2rem; }
.rich-text-content h2 { font-size: 1.5rem; }
.rich-text-content h3 { font-size: 1.25rem; }
.rich-text-content h4 { font-size: 1.125rem; }
.rich-text-content h5 { font-size: 1rem; }
.rich-text-content h6 { font-size: 0.875rem; }

.rich-text-content p {
    margin: 0.5rem 0;
    color: #334155;
}

.rich-text-content ul,
.rich-text-content ol {
    margin: 0.5rem 0;
    padding-left: 2rem;
    color: #334155;
}

.rich-text-content ul {
    list-style-type: disc;
}

.rich-text-content ol {
    list-style-type: decimal;
}

.rich-text-content li {
    margin: 0.25rem 0;
}

.rich-text-content a {
    color: #2f2f77;
    text-decoration: underline;
}

.rich-text-content a:hover {
    color: #4f46e5;
}

.rich-text-content code {
    background-color: #f1f5f9;
    color: #e11d48;
    padding: 0.125rem 0.25rem;
    border-radius: 0.25rem;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.875em;
}

.rich-text-content pre {
    background-color: #f8fafc;
    color: #1e293b;
    padding: 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    overflow-x: auto;
    margin: 1rem 0;
}

.rich-text-content pre code {
    background-color: transparent;
    color: #1e293b;
    padding: 0;
    font-size: 0.875rem;
    line-height: 1.5;
}

.rich-text-content blockquote {
    border-left: 4px solid #2f2f77;
    background-color: #f1f5f9;
    padding: 0.75rem 1rem;
    margin: 1rem 0;
    color: #475569;
    font-style: italic;
}

.rich-text-content strong,
.rich-text-content b {
    font-weight: 600;
    color: #1e293b;
}

.rich-text-content em,
.rich-text-content i {
    font-style: italic;
}

.rich-text-content u {
    text-decoration: underline;
}

/* Container for rich text editors in forms */
.rich-text-editor-container {
    position: relative;
}

/* Responsive */
@media (max-width: 640px) {
    .rich-text-toolbar {
        padding: 0.375rem;
    }
    
    .toolbar-button {
        width: 1.75rem;
        height: 1.75rem;
        font-size: 0.875rem;
    }
    
    .rich-text-content {
        padding: 0.75rem;
        font-size: 0.875rem;
    }
}

/* Force light theme even if system prefers dark mode */
@media (prefers-color-scheme: dark) {
    .rich-text-editor {
        background-color: white;
        border-color: #cbd5e1;
    }
    
    .rich-text-editor:focus-within {
        border-color: #2f2f77;
    }
    
    .rich-text-toolbar {
        background-color: #f8fafc;
        border-bottom-color: #e2e8f0;
    }
    
    .toolbar-button {
        color: #64748b;
    }
    
    .toolbar-button:hover {
        background-color: #e2e8f0;
        color: #334155;
    }
    
    .toolbar-button:active,
    .toolbar-button.active {
        background-color: #2f2f77;
        color: white;
    }
    
    .rich-text-content {
        color: #1e293b;
        background-color: white;
    }
    
    .rich-text-content:empty:not(.focused-empty):before {
        color: #94a3b8;
    }
    
    .rich-text-content h1,
    .rich-text-content h2,
    .rich-text-content h3,
    .rich-text-content h4,
    .rich-text-content h5,
    .rich-text-content h6 {
        color: #1e293b;
    }
    
    .rich-text-content p,
    .rich-text-content ul,
    .rich-text-content ol {
        color: #334155;
    }
    
    .rich-text-content code {
        background-color: #f1f5f9;
        color: #e11d48;
    }
    
    .rich-text-content pre {
        background-color: #f8fafc;
        color: #1e293b;
        border: 1px solid #e2e8f0;
    }
    
    .rich-text-content pre code {
        color: #1e293b;
    }
    
    .rich-text-content blockquote {
        border-left-color: #2f2f77;
        background-color: #f1f5f9;
        color: #475569;
    }
    
    .rich-text-content strong,
    .rich-text-content b {
        color: #1e293b;
    }
}