/**
 * WYSIWYG Editor CSS voor AgroForest Community
 */

/* Editor container */
.wysiwyg-editor {
    border: 2px solid #c5e1a5;
    border-radius: 0.5rem;
    background: #fff;
    overflow: hidden;
    transition: all 0.3s ease;
}

.wysiwyg-editor:focus-within {
    border-color: #33691e;
    box-shadow: 0 0 0 0.25rem rgba(51, 105, 30, 0.25);
}

/* Toolbar styling */
.wysiwyg-toolbar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 2px solid #c5e1a5;
    flex-wrap: wrap;
}

.wysiwyg-toolbar-group {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem;
    border-radius: 0.25rem;
    background: rgba(255, 255, 255, 0.5);
}

/* Toolbar buttons */
.wysiwyg-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border: 1px solid #dee2e6;
    background: #fff;
    color: #6c757d;
    border-radius: 0.25rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.875rem;
}

.wysiwyg-btn:hover {
    background: #e9ecef;
    border-color: #adb5bd;
    color: #495057;
}

.wysiwyg-btn.active {
    background: #33691e;
    border-color: #33691e;
    color: #fff;
}

.wysiwyg-btn:focus {
    outline: none;
    box-shadow: 0 0 0 0.2rem rgba(51, 105, 30, 0.25);
}

/* Content area */
.wysiwyg-content {
    min-height: 200px;
    padding: 1rem;
    outline: none;
    line-height: 1.6;
    color: #495057;
    font-family: inherit;
    overflow-y: auto;
}

.wysiwyg-content:empty:before {
    content: attr(data-placeholder);
    color: #6c757d;
    font-style: italic;
    pointer-events: none;
}

.wysiwyg-content:focus {
    background: #fff;
}

/* Content formatting */
.wysiwyg-content blockquote {
    margin: 1rem 0;
    padding: 0.75rem 1rem;
    border-left: 4px solid #33691e;
    background: #f8f9fa;
    font-style: italic;
    color: #6c757d;
}

.wysiwyg-content a {
    color: #33691e;
    text-decoration: underline;
}

.wysiwyg-content a:hover {
    color: #1b5e20;
    text-decoration: none;
}

.wysiwyg-content strong,
.wysiwyg-content b {
    font-weight: 600;
    color: #495057;
}

.wysiwyg-content em,
.wysiwyg-content i {
    font-style: italic;
}

.wysiwyg-content u {
    text-decoration: underline;
}

/* Link dialog styling */
.wysiwyg-link-dialog {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 1000;
    background: #fff;
    border: 2px solid #c5e1a5;
    border-radius: 0.5rem;
    padding: 1rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 300px;
    margin-top: 0.5rem;
}

.wysiwyg-link-dialog.show {
    display: block;
}

.wysiwyg-link-dialog .form-group {
    margin-bottom: 1rem;
}

.wysiwyg-link-dialog .form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #1b5e20;
}

.wysiwyg-link-dialog .form-control {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #c5e1a5;
    border-radius: 0.25rem;
    font-size: 0.875rem;
}

.wysiwyg-link-dialog .form-control:focus {
    outline: none;
    border-color: #33691e;
    box-shadow: 0 0 0 0.2rem rgba(51, 105, 30, 0.25);
}

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

.wysiwyg-link-dialog .btn {
    padding: 0.5rem 1rem;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.wysiwyg-link-dialog .btn-primary {
    background: #33691e;
    border: 1px solid #33691e;
    color: #fff;
}

.wysiwyg-link-dialog .btn-primary:hover {
    background: #1b5e20;
    border-color: #1b5e20;
}

.wysiwyg-link-dialog .btn-secondary {
    background: #6c757d;
    border: 1px solid #6c757d;
    color: #fff;
}

.wysiwyg-link-dialog .btn-secondary:hover {
    background: #5a6268;
    border-color: #5a6268;
}

/* Responsive design */
@media (max-width: 768px) {
    .wysiwyg-toolbar {
        padding: 0.5rem;
        gap: 0.25rem;
    }
    
    .wysiwyg-toolbar-group {
        gap: 0.125rem;
    }
    
    .wysiwyg-btn {
        width: 1.75rem;
        height: 1.75rem;
        font-size: 0.75rem;
    }
    
    .wysiwyg-content {
        padding: 0.75rem;
        min-height: 150px;
    }
    
    .wysiwyg-link-dialog {
        min-width: 250px;
        padding: 0.75rem;
    }
}

/* Dark Mode Support - Now handled by dark-mode.css via JavaScript */
