/* Rich Text Editor Modal Styles */

/* Floating Notepad Icon */
.floating-notepad {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #4CAF50, #45a049);
    border-radius: 50%;
    box-shadow: 0 4px 20px rgba(76, 175, 80, 0.4);
    cursor: pointer;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    border: none;
}

.floating-notepad:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 25px rgba(76, 175, 80, 0.6);
    background: linear-gradient(135deg, #45a049, #4CAF50);
}

.floating-notepad:active {
    transform: translateY(-1px);
}

.floating-notepad i {
    font-size: 24px;
    color: white;
}

/* Pulse animation for attention */
.floating-notepad.pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 4px 20px rgba(76, 175, 80, 0.4);
    }
    50% {
        box-shadow: 0 4px 20px rgba(76, 175, 80, 0.8);
    }
    100% {
        box-shadow: 0 4px 20px rgba(76, 175, 80, 0.4);
    }
}

/* Modal Overlay */
.rich-text-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(3px);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.rich-text-modal-overlay.show {
    display: flex;
    opacity: 1;
}

/* Modal Container */
.rich-text-modal {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 900px;
    height: 80%;
    max-height: 600px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.rich-text-modal-overlay.show .rich-text-modal {
    transform: scale(1);
}

/* Modal Header */
.rich-text-modal-header {
    padding: 20px 25px 15px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 12px 12px 0 0;
}

.rich-text-modal-title {
    margin: 0;
    color: #2c3e50;
    font-size: 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.rich-text-modal-title i {
    color: #4CAF50;
}

.rich-text-modal-subtitle {
    margin: 8px 0 0 0;
    color: #6c757d;
    font-size: 14px;
    font-weight: 400;
    font-style: italic;
    line-height: 1.4;
}

.rich-text-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #666;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.rich-text-modal-close:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #333;
}

/* Modal Body */
.rich-text-modal-body {
    flex: 1;
    padding: 20px 25px;
    display: flex;
    flex-direction: column;
    min-height: 0; /* Important for flex child overflow */
}

/* Quill Container */
.quill-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 300px;
}

.quill-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    color: #666;
    font-size: 16px;
}

.quill-loading i {
    margin-right: 10px;
    animation: spin 1s linear infinite;
}

/* Quill Editor Styling */
#rich-text-editor {
    flex: 1;
    min-height: 300px;
}

/* Quill Snow Theme Customizations */
.ql-toolbar {
    border-top: 1px solid #ccc;
    border-left: 1px solid #ccc;
    border-right: 1px solid #ccc;
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    background: #f8f9fa;
}

.ql-container {
    border-bottom: 1px solid #ccc;
    border-left: 1px solid #ccc;
    border-right: 1px solid #ccc;
    border-top: none;
    border-radius: 0 0 8px 8px;
    font-size: 14px;
    min-height: 250px;
}

.ql-editor {
    min-height: 250px;
    padding: 15px;
    line-height: 1.6;
}

.ql-editor.ql-blank::before {
    font-style: italic;
    color: #999;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Modal Footer */
.rich-text-modal-footer {
    padding: 15px 25px 20px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
    border-radius: 0 0 12px 12px;
}

.modal-footer-left {
    display: flex;
    align-items: center;
    gap: 15px;
    color: #666;
    font-size: 14px;
}

.modal-footer-right {
    display: flex;
    gap: 10px;
}

/* Action Buttons */
.rich-text-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.rich-text-btn-save {
    background: #4CAF50;
    color: white;
}

.rich-text-btn-save:hover {
    background: #45a049;
    transform: translateY(-1px);
}

.rich-text-btn-save:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.rich-text-btn-clear {
    background: #f44336;
    color: white;
}

.rich-text-btn-clear:hover {
    background: #d32f2f;
    transform: translateY(-1px);
}

.rich-text-btn-cancel {
    background: #6c757d;
    color: white;
}

.rich-text-btn-cancel:hover {
    background: #5a6268;
    transform: translateY(-1px);
}

/* Auto-save indicator */
.auto-save-indicator {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #28a745;
    font-size: 13px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.auto-save-indicator.show {
    opacity: 1;
}

.auto-save-indicator i {
    font-size: 12px;
}

/* Profile indicator */
.profile-indicator {
    background: #e3f2fd;
    color: #1976d2;
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .floating-notepad {
        bottom: 20px;
        right: 20px;
        width: 50px;
        height: 50px;
    }
    
    .floating-notepad i {
        font-size: 20px;
    }
    
    .rich-text-modal {
        width: 95%;
        height: 85%;
        margin: 10px;
    }
    
    .rich-text-modal-header {
        padding: 15px 20px 10px;
    }
    
    .rich-text-modal-title {
        font-size: 18px;
    }
    
    .rich-text-modal-body {
        padding: 15px 20px;
    }
    
    .rich-text-modal-footer {
        padding: 10px 20px 15px;
        flex-direction: column;
        gap: 10px;
    }
    
    .modal-footer-left,
    .modal-footer-right {
        width: 100%;
        justify-content: center;
    }
    
    /* Mobile Quill adjustments */
    .ql-toolbar {
        padding: 8px;
    }
    
    .ql-editor {
        min-height: 200px;
        padding: 12px;
    }
    
    .quill-container {
        min-height: 250px;
    }
}

/* Hide on pages where not needed */
body.no-rich-text-modal .floating-notepad {
    display: none;
}