/* ============================================================================
   RICH TEXT EDITOR STYLES (QUILL)
   ============================================================================ */

/* Quill editor container */
.quill-editor-container {
    border: 2px solid rgba(107, 70, 193, 0.5);
    border-radius: 8px;
    background: #1a1a2e;
    font-family: 'Rajdhani', sans-serif;
    overflow: hidden;
}

/* Quill toolbar styling to match Loreweave theme */
.ql-toolbar.ql-snow {
    background: linear-gradient(135deg, #2a1a5f, #3b0c5a) !important;
    border: none !important;
    border-bottom: 1px solid rgba(107, 70, 193, 0.5) !important;
    padding: 8px;
}

/* Toolbar buttons */
.ql-toolbar.ql-snow .ql-stroke {
    stroke: #e0e0e0 !important;
}

.ql-toolbar.ql-snow .ql-fill {
    fill: #e0e0e0 !important;
}

.ql-toolbar.ql-snow .ql-picker-label {
    color: #e0e0e0 !important;
}

/* Toolbar button hover */
.ql-toolbar.ql-snow button:hover,
.ql-toolbar.ql-snow button:focus {
    background: rgba(107, 70, 193, 0.3) !important;
}

.ql-toolbar.ql-snow button.ql-active,
.ql-toolbar.ql-snow .ql-picker-label.ql-active,
.ql-toolbar.ql-snow .ql-picker-item.ql-selected {
    background: rgba(107, 70, 193, 0.5) !important;
    color: #9d4edd !important;
}

.ql-toolbar.ql-snow button.ql-active .ql-stroke {
    stroke: #9d4edd !important;
}

.ql-toolbar.ql-snow button.ql-active .ql-fill {
    fill: #9d4edd !important;
}

/* Dropdown menus */
.ql-snow .ql-picker-options {
    background: linear-gradient(135deg, #2a1a5f, #3b0c5a) !important;
    border: 1px solid rgba(107, 70, 193, 0.5) !important;
    padding: 4px 0;
    z-index: 10000 !important;
}

.ql-snow .ql-picker-item {
    color: #e0e0e0 !important;
}

.ql-snow .ql-picker-item:hover {
    background: rgba(107, 70, 193, 0.3) !important;
    color: #9d4edd !important;
}

/* Editor content area */
.ql-container.ql-snow {
    border: none !important;
    font-family: 'Rajdhani', sans-serif !important;
    font-size: 14px;
    background-color: #1a1a2e !important;
}

.ql-editor {
    min-height: 300px;
    max-height: 600px;
    overflow-y: auto;
    color: #e0e0e0 !important;
    padding: 15px;
}

.ql-editor.ql-blank::before {
    color: #666 !important;
    font-style: italic;
}

/* Content styling within editor */
.ql-editor h1,
.ql-editor h2,
.ql-editor h3,
.ql-editor h4,
.ql-editor h5,
.ql-editor h6 {
    color: #9d4edd;
}

.ql-editor a {
    color: #9d4edd;
}

.ql-editor blockquote {
    border-left: 4px solid #9d4edd;
    padding-left: 16px;
    color: #c7b3e5;
}

.ql-editor code,
.ql-editor pre {
    background: rgba(107, 70, 193, 0.2);
    color: #e0e0e0;
}

.ql-editor pre {
    border-radius: 5px;
    padding: 10px;
}

/* Tooltip */
.ql-snow .ql-tooltip {
    background: linear-gradient(135deg, #2a1a5f, #3b0c5a) !important;
    border: 1px solid rgba(107, 70, 193, 0.5) !important;
    color: #e0e0e0 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 10001 !important;
}

.ql-snow .ql-tooltip input[type="text"] {
    background: rgba(26, 26, 46, 0.8) !important;
    border: 1px solid rgba(107, 70, 193, 0.5) !important;
    color: #e0e0e0 !important;
}

.ql-snow .ql-tooltip a {
    color: #9d4edd !important;
}

.ql-snow .ql-tooltip .ql-action::after,
.ql-snow .ql-tooltip .ql-remove::before {
    color: #9d4edd !important;
}

/* Scrollbar styling for editor */
.ql-editor::-webkit-scrollbar {
    width: 8px;
}

.ql-editor::-webkit-scrollbar-track {
    background: rgba(107, 70, 193, 0.1);
}

.ql-editor::-webkit-scrollbar-thumb {
    background: rgba(107, 70, 193, 0.5);
    border-radius: 4px;
}

.ql-editor::-webkit-scrollbar-thumb:hover {
    background: rgba(157, 78, 221, 0.7);
}


/* ============================================================================
   UPGRADE BADGE STYLES
   ============================================================================ */

.richtext-upgrade-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    margin-top: 0.5rem;
    background: linear-gradient(135deg, rgba(157, 78, 221, 0.2), rgba(107, 70, 193, 0.2));
    border: 1px solid rgba(157, 78, 221, 0.5);
    border-radius: 8px;
    font-size: 0.875rem;
    color: #e0e0e0;
}

.richtext-upgrade-badge .badge-icon {
    font-size: 1.2rem;
}

.richtext-upgrade-badge .badge-text {
    flex: 1;
    color: #c7b3e5;
}

.richtext-upgrade-badge .badge-link {
    padding: 0.25rem 0.75rem;
    background: linear-gradient(135deg, #6b46c1, #9d4edd);
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 600;
    transition: all 0.2s;
}

.richtext-upgrade-badge .badge-link:hover {
    background: linear-gradient(135deg, #9d4edd, #6b46c1);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(157, 78, 221, 0.3);
}

/* Textarea with Pro feature indicator */
textarea[data-richtext="true"] {
    position: relative;
}

textarea[data-richtext="true"]:not(.richtext-active) {
    border-left: 3px solid #9d4edd;
}

/* Pro badge for textareas without access */
.textarea-pro-badge {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    padding: 0.25rem 0.5rem;
    background: linear-gradient(135deg, #6b46c1, #9d4edd);
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 4px;
    pointer-events: none;
    z-index: 10;
}


/* ============================================================================
   RICH TEXT CONTENT DISPLAY (for viewing saved rich text)
   ============================================================================ */

.richtext-content {
    font-family: 'Rajdhani', sans-serif;
    line-height: 1.6;
    color: #e0e0e0;
}

.richtext-content h1,
.richtext-content h2,
.richtext-content h3,
.richtext-content h4,
.richtext-content h5,
.richtext-content h6 {
    color: #9d4edd;
    margin-top: 1em;
    margin-bottom: 0.5em;
}

.richtext-content h1 {
    font-size: 2em;
    border-bottom: 2px solid rgba(157, 78, 221, 0.3);
    padding-bottom: 0.3em;
}

.richtext-content h2 {
    font-size: 1.5em;
}

.richtext-content h3 {
    font-size: 1.3em;
}

.richtext-content p {
    margin-bottom: 1em;
}

.richtext-content a {
    color: #9d4edd;
    text-decoration: underline;
}

.richtext-content a:hover {
    color: #c7b3e5;
}

.richtext-content ul,
.richtext-content ol {
    margin-left: 2em;
    margin-bottom: 1em;
}

.richtext-content li {
    margin-bottom: 0.5em;
}

.richtext-content blockquote {
    border-left: 4px solid #9d4edd;
    padding-left: 1em;
    margin-left: 0;
    margin-right: 0;
    font-style: italic;
    color: #c7b3e5;
}

.richtext-content code {
    background: rgba(107, 70, 193, 0.2);
    padding: 0.2em 0.4em;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

.richtext-content pre {
    background: rgba(107, 70, 193, 0.2);
    padding: 1em;
    border-radius: 5px;
    overflow-x: auto;
    margin-bottom: 1em;
}

.richtext-content pre code {
    background: none;
    padding: 0;
}

.richtext-content table {
    border-collapse: collapse;
    width: 100%;
    margin-bottom: 1em;
}

.richtext-content table th,
.richtext-content table td {
    border: 1px solid rgba(107, 70, 193, 0.5);
    padding: 0.5em;
    text-align: left;
}

.richtext-content table th {
    background: rgba(107, 70, 193, 0.3);
    font-weight: 600;
}

.richtext-content img {
    max-width: 100%;
    height: auto;
    border-radius: 5px;
    margin: 1em 0;
}

.richtext-content hr {
    border: none;
    border-top: 2px solid rgba(107, 70, 193, 0.5);
    margin: 2em 0;
}

/* Text alignment */
.richtext-content .text-left {
    text-align: left;
}

.richtext-content .text-center {
    text-align: center;
}

.richtext-content .text-right {
    text-align: right;
}

.richtext-content .text-justify {
    text-align: justify;
}


/* ============================================================================
   RESPONSIVE ADJUSTMENTS
   ============================================================================ */

@media (max-width: 768px) {
    .richtext-upgrade-badge {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .richtext-upgrade-badge .badge-link {
        align-self: stretch;
        text-align: center;
    }
    
    .quill-editor-container {
        max-width: 100%;
    }
    
    .ql-editor {
        min-height: 200px;
    }
}