/* Rich Text Editor Styles */

.rich-text-editor {
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #fff;
    overflow: hidden;
}

.rich-text-editor:focus-within {
    border-color: #f97316;
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.1);
}

/* Toolbar */
.rte-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
}

.rte-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: #374151;
    cursor: pointer;
    transition: all 0.15s ease;
}

.rte-btn:hover {
    background: #e5e7eb;
    color: #111827;
}

.rte-btn:active,
.rte-btn.active {
    background: #d1d5db;
}

.rte-btn svg {
    width: 16px;
    height: 16px;
}

.rte-file-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: #374151;
    cursor: pointer;
    transition: all 0.15s ease;
}

.rte-file-label:hover {
    background: #e5e7eb;
    color: #111827;
}

/* Select dropdowns */
.rte-select {
    height: 32px;
    padding: 0 8px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    background: #fff;
    color: #374151;
    font-size: 12px;
    cursor: pointer;
}

.rte-select:focus {
    outline: none;
    border-color: #f97316;
}

.rte-font-family {
    width: 120px;
}

.rte-font-size {
    width: 70px;
}

/* Separator */
.rte-separator {
    width: 1px;
    height: 24px;
    background: #d1d5db;
    margin: 0 4px;
}

/* Color picker */
.rte-color-picker-wrapper {
    position: relative;
    display: inline-flex;
}

.rte-color-btn {
    position: relative;
}

.rte-color-indicator {
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%);
    width: 14px;
    height: 3px;
    border-radius: 1px;
}

.rte-color-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

/* Editor content area */
.rte-content-wrapper {
    overflow-y: auto;
}

.rte-content {
    min-height: 200px;
    padding: 16px;
    outline: none;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.6;
    color: #111827;
}

.rte-content:empty:before {
    content: attr(placeholder);
    color: #9ca3af;
    pointer-events: none;
}

.rte-content:focus {
    outline: none;
}

/* Content styling */
.rte-content p {
    margin: 0 0 1em 0;
}

.rte-content ul,
.rte-content ol {
    margin: 0 0 1em 0;
    padding-left: 2em;
}

.rte-content a {
    color: #f97316;
    text-decoration: underline;
}

.rte-content img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin: 8px 0;
}

.rte-content .rte-video-wrapper {
    margin: 16px 0;
}

.rte-content iframe {
    max-width: 100%;
    border-radius: 8px;
}

.rte-content blockquote {
    margin: 1em 0;
    padding: 12px 16px;
    border-left: 4px solid #f97316;
    background: #fef3e2;
    color: #92400e;
}

/* Footer */
.rte-footer {
    padding: 8px 12px;
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
    font-size: 12px;
    color: #6b7280;
}

/* Dialog overlay */
.rte-dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.rte-dialog {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    width: 100%;
    max-width: 400px;
    overflow: hidden;
}

.rte-dialog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #e5e7eb;
}

.rte-dialog-header h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #111827;
}

.rte-dialog-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: #6b7280;
    font-size: 20px;
    cursor: pointer;
}

.rte-dialog-close:hover {
    background: #f3f4f6;
    color: #111827;
}

.rte-dialog-body {
    padding: 20px;
}

.rte-dialog-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 20px;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
}

.rte-form-group {
    margin-bottom: 16px;
}

.rte-form-group:last-child {
    margin-bottom: 0;
}

.rte-form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
}

.rte-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    color: #111827;
    transition: border-color 0.15s ease;
}

.rte-input:focus {
    outline: none;
    border-color: #f97316;
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.1);
}

/* Disabled state */
.rich-text-editor.disabled {
    opacity: 0.6;
    pointer-events: none;
}

/* Print styles */
@media print {
    .rte-toolbar,
    .rte-footer {
        display: none;
    }
    
    .rte-content-wrapper {
        max-height: none !important;
        overflow: visible;
    }
}
