/* Rich Text Editor Styles */
.rich-text-editor-container {
    border: 2px solid #e5e7eb;
    border-radius: 0.5rem;
    background: white;
    transition: border-color 0.2s;
}

.rich-text-editor-container:focus-within {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.rich-text-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.125rem;
    padding: 0.5rem;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
    border-radius: 0.5rem 0.5rem 0 0;
}

.rich-text-toolbar button {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 1.75rem;
    height: 1.75rem;
    padding: 0 0.25rem;
    border: 1px solid #d1d5db;
    background: white;
    border-radius: 0.25rem;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
    font-size: 0.75rem;
    white-space: nowrap;
    color: #374151;
}

.rich-text-toolbar button:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
}

.rich-text-toolbar button.active {
    background: #3b82f6;
    color: white;
    border-color: #2563eb;
}

.rich-text-toolbar button:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.5);
}

.rich-text-toolbar .toolbar-separator {
    width: 1px;
    height: 1.5rem;
    background: #d1d5db;
    margin: 0.25rem 0.125rem;
}

.rich-text-editor {
    min-height: 120px;
    padding: 0.75rem;
    border: none;
    outline: none;
    font-family: inherit;
    font-size: 0.875rem;
    line-height: 1.5;
    resize: vertical;
    border-radius: 0 0 0.5rem 0.5rem;
}

.rich-text-editor[contenteditable="true"] {
    cursor: text;
}

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

/* Content styling within editor */
.rich-text-editor h1 {
    font-size: 1.5rem;
    font-weight: bold;
    margin: 0.5rem 0;
}

.rich-text-editor h2 {
    font-size: 1.25rem;
    font-weight: bold;
    margin: 0.5rem 0;
}

.rich-text-editor h3 {
    font-size: 1.125rem;
    font-weight: bold;
    margin: 0.5rem 0;
}

.rich-text-editor strong {
    font-weight: bold;
}

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

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

.rich-text-editor ul, .rich-text-editor ol {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}

.rich-text-editor li {
    margin: 0.25rem 0;
}

.rich-text-editor a {
    color: #3b82f6;
    text-decoration: underline;
}

.rich-text-editor p {
    margin: 0.5rem 0;
}

.rich-text-editor p:first-child {
    margin-top: 0;
}

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

/* Link dialog styles */
.link-dialog {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    padding: 1.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    min-width: 300px;
}

.link-dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

.link-dialog h3 {
    margin: 0 0 1rem 0;
    font-size: 1.125rem;
    font-weight: 600;
}

.link-dialog input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #d1d5db;
    border-radius: 0.25rem;
    margin-bottom: 1rem;
}

.link-dialog .dialog-buttons {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

.link-dialog button {
    padding: 0.5rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 0.25rem;
    cursor: pointer;
    font-weight: 500;
}

.link-dialog .btn-primary {
    background: #3b82f6;
    color: white;
    border-color: #2563eb;
}

.link-dialog .btn-primary:hover {
    background: #2563eb;
}

.link-dialog .btn-secondary {
    background: white;
    color: #374151;
}

.link-dialog .btn-secondary:hover {
    background: #f3f4f6;
}

/* Mobile responsiveness */
@media (max-width: 640px) {
    .rich-text-toolbar {
        padding: 0.5rem;
        gap: 0.125rem;
    }
    
    .rich-text-toolbar button {
        min-width: 1.5rem;
        height: 1.5rem;
        font-size: 0.625rem;
        padding: 0 0.25rem;
    }
    
    .link-dialog {
        margin: 1rem;
        min-width: auto;
        width: calc(100% - 2rem);
    }
}

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