/* Clipboard Paste Plugin Styles for PerfexCRM */

/* Main container styles */
.clipboard-paste-enabled {
    position: relative;
}

.clipboard-paste-enabled:focus {
    box-shadow: 0 0 5px rgba(52, 152, 219, 0.5);
    border-color: #3498db;
}

/* Paste hint styles */
.clipboard-paste-hint {
    position: absolute;
    top: -25px;
    right: 10px;
    background: #3498db;
    color: white;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 11px;
    z-index: 1000;
    opacity: 0;
    animation: fadeInHint 0.3s ease-in-out forwards;
}

.clipboard-paste-hint:before {
    content: '';
    position: absolute;
    top: 100%;
    right: 10px;
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid #3498db;
}

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

/* Preview styles */
.clipboard-paste-preview {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    max-width: 400px;
    max-height: 500px;
}

.clipboard-paste-preview .preview-content {
    padding: 15px;
    text-align: center;
}

.clipboard-paste-preview img {
    max-width: 100%;
    max-height: 300px;
    border-radius: 4px;
    border: 1px solid #eee;
}

.clipboard-paste-preview .preview-info {
    margin: 10px 0;
    color: #666;
    font-size: 12px;
}

.clipboard-paste-preview .preview-info span {
    display: inline-block;
    margin: 0 5px;
    padding: 2px 6px;
    background: #f8f9fa;
    border-radius: 3px;
}

.clipboard-paste-preview .preview-actions {
    margin-top: 15px;
}

.clipboard-paste-preview .preview-actions .btn {
    margin: 0 5px;
}

/* Progress indicator styles */
.clipboard-paste-progress {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(52, 152, 219, 0.1);
    border: 1px solid #3498db;
    border-radius: 4px;
    padding: 8px 12px;
    margin-top: 5px;
    z-index: 1000;
}

.clipboard-paste-progress .progress-content {
    display: flex;
    align-items: center;
    color: #3498db;
    font-size: 12px;
}

.clipboard-paste-progress .progress-content i {
    margin-right: 8px;
}

/* Notification styles (fallback) */
.clipboard-paste-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    min-width: 300px;
    padding: 12px 15px;
    border-radius: 4px;
    z-index: 9999;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    animation: slideInNotification 0.3s ease-out;
}

.clipboard-paste-notification.notification-success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.clipboard-paste-notification.notification-error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.clipboard-paste-notification.notification-info {
    background: #d1ecf1;
    border: 1px solid #bee5eb;
    color: #0c5460;
}

.clipboard-paste-notification .notification-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.clipboard-paste-notification .close {
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    opacity: 0.7;
    margin-left: 10px;
}

.clipboard-paste-notification .close:hover {
    opacity: 1;
}

@keyframes slideInNotification {
    from { 
        opacity: 0; 
        transform: translateX(100%); 
    }
    to { 
        opacity: 1; 
        transform: translateX(0); 
    }
}

/* Pasted image styles */
.pasted-image {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin: 5px 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    cursor: pointer;
}

.pasted-image:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Admin settings page styles */
.clipboard-paste-settings .form-group label {
    font-weight: 600;
    color: #555;
}

.clipboard-paste-settings .help-block {
    font-style: italic;
}

/* File management table styles */
#clipboard-files-table .label {
    font-size: 11px;
}

#clipboard-files-table .btn-group .btn {
    padding: 2px 6px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .clipboard-paste-preview {
        position: fixed;
        top: 10px;
        left: 10px;
        right: 10px;
        transform: none;
        max-width: none;
    }
    
    .clipboard-paste-notification {
        left: 10px;
        right: 10px;
        min-width: auto;
    }
    
    .clipboard-paste-hint {
        display: none; /* Hide hints on mobile */
    }
}

/* Integration with PerfexCRM textarea styles */
.form-control.clipboard-paste-enabled {
    transition: all 0.3s ease;
}

.form-control.clipboard-paste-enabled:focus {
    border-color: #3498db;
    box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 0 3px rgba(52, 152, 219, 0.1);
}

/* TinyMCE integration */
.mce-tinymce.clipboard-paste-enabled {
    border-color: #3498db !important;
}

/* Content editable styles */
[contenteditable="true"].clipboard-paste-enabled {
    min-height: 100px;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
}

[contenteditable="true"].clipboard-paste-enabled:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 5px rgba(52, 152, 219, 0.3);
}

/* Loading state for textareas */
.clipboard-paste-enabled.uploading {
    opacity: 0.7;
    pointer-events: none;
}

/* Success state animation */
.clipboard-paste-success {
    animation: successPulse 0.6s ease-in-out;
}

@keyframes successPulse {
    0% { background-color: transparent; }
    50% { background-color: rgba(46, 204, 113, 0.1); }
    100% { background-color: transparent; }
}

/* Dark theme support (if PerfexCRM uses dark theme) */
@media (prefers-color-scheme: dark) {
    .clipboard-paste-preview {
        background: #2c3e50;
        border-color: #34495e;
        color: #ecf0f1;
    }
    
    .clipboard-paste-progress {
        background: rgba(52, 152, 219, 0.2);
        color: #ecf0f1;
    }
    
    .clipboard-paste-hint {
        background: #34495e;
        color: #ecf0f1;
    }
}
