/**
 * ============================================================================
 * Rich Text Editor - Additional Styles
 * ============================================================================
 * Complementary styles for the Rich Editor
 * Works alongside Tailwind CSS
 */

/* Editor Content Styles */
.rich-editor-content {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #1f2937;
}

.rich-editor-content:empty::before {
    content: attr(data-placeholder);
    color: #9ca3af;
    pointer-events: none;
}

.rich-editor-content:focus {
    outline: none;
}

/* Formatted Text */
.rich-editor-content p {
    margin-bottom: 0.75rem;
}

.rich-editor-content p:last-child {
    margin-bottom: 0;
}

.rich-editor-content strong {
    font-weight: 700;
    color: #111827;
}

.rich-editor-content em {
    font-style: italic;
}

.rich-editor-content u {
    text-decoration: underline;
}

/* Lists */
.rich-editor-content ul,
.rich-editor-content ol {
    margin-left: 1.5rem;
    margin-bottom: 0.75rem;
}

.rich-editor-content ul {
    list-style-type: disc;
}

.rich-editor-content ol {
    list-style-type: decimal;
}

.rich-editor-content li {
    margin-bottom: 0.25rem;
    padding-left: 0.25rem;
}

.rich-editor-content li::marker {
    color: #7c3aed;
}

/* Tables */
.rich-editor-content table {
    border-collapse: collapse;
    width: 100%;
    margin: 1rem 0;
}

.rich-editor-content table td,
.rich-editor-content table th {
    border: 1px solid #d1d5db;
    padding: 0.5rem;
    min-width: 80px;
}

.rich-editor-content table td:hover {
    background-color: #f3f4f6;
}

/* Table Wrapper with Controls */
.rich-editor-content .table-wrapper {
    margin: 1rem 0;
    padding: 0.75rem;
    background-color: #f9fafb;
    border: 2px solid #d1d5db;
    border-radius: 0.5rem;
}

.table-wrapper table {
    margin: 0 !important;
}

/* Font Size Menu */
.font-size-menu {
    animation: slideDown 0.2s ease-out;
}

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

/* Alignment styles */
.rich-editor-content [align="left"] {
    text-align: left;
}

.rich-editor-content [align="center"] {
    text-align: center;
}

.rich-editor-content [align="right"] {
    text-align: right;
}

.rich-editor-content [align="justify"] {
    text-align: justify;
}

/* Images */
.rich-editor-content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 1rem auto;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Toolbar Button Active States */
.rich-editor-btn:active {
    transform: scale(0.95);
}

.rich-editor-btn:hover {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Focus Styles */
/* .rich-editor-container:focus-within {
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
} */

/* Scrollbar Styles */
.rich-editor-content::-webkit-scrollbar {
    width: 8px;
}

.rich-editor-content::-webkit-scrollbar-track {
    background: #f3f4f6;
    border-radius: 4px;
}

.rich-editor-content::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 4px;
}

.rich-editor-content::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* Animation for notifications */
@keyframes slide-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-slide-up {
    animation: slide-up 0.3s ease-out;
}

/* Selection Highlight */
.rich-editor-content ::selection {
    background-color: rgba(124, 58, 237, 0.2);
    color: inherit;
}

/* Placeholder for empty editor */
.rich-editor-content[data-placeholder]:empty::before {
    content: attr(data-placeholder);
    color: #9ca3af;
    font-style: italic;
}

/* Responsive adjustments */
@media (max-width: 640px) {
    .rich-editor-toolbar {
        gap: 0.25rem;
        padding: 0.5rem;
    }
    
    .rich-editor-btn {
        padding: 0.5rem;
        font-size: 0.875rem;
    }
    
    .rich-editor-content {
        padding: 0.75rem;
        min-height: 150px;
    }
}

/* Print styles */
@media print {
    .rich-editor-toolbar {
        display: none;
    }
    
    .rich-editor-container {
        border: none;
    }
    
    .rich-editor-content {
        padding: 0;
    }
}
