/**
 * WP Flow Visual Editor Styles
 */

/* Tooltip Editor */
#visual-editor-tooltip {
    position: fixed;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    min-width: 320px;
    max-width: 400px;
    z-index: 10000;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.tooltip-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 20px;
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tooltip-header strong {
    font-size: 15px;
    font-weight: 600;
}

.tooltip-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 24px;
    line-height: 1;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.tooltip-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.tooltip-body {
    padding: 20px;
    max-height: 500px;
    overflow-y: auto;
}

.tooltip-fields {
    margin-bottom: 20px;
}

.field-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.field-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.field-group label {
    font-size: 13px;
    font-weight: 600;
    color: #334155;
}

.field-group input[type="text"],
.field-group input[type="number"],
.field-group select {
    padding: 8px 12px;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.2s;
    width: 100%;
    box-sizing: border-box;
}

.field-group input:focus,
.field-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.color-input-wrapper {
    display: flex;
    gap: 10px;
    align-items: center;
}

.color-input-wrapper input[type="color"] {
    width: 60px;
    height: 40px;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    cursor: pointer;
    padding: 2px;
}

.color-input-wrapper .color-hex {
    flex: 1;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    background: #f8fafc;
}

.tooltip-actions {
    display: flex;
    gap: 10px;
    padding-top: 15px;
    border-top: 1px solid #e2e8f0;
}

.tooltip-actions button {
    flex: 1;
    padding: 10px 16px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-apply {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-apply:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-reset {
    background: #f1f5f9;
    color: #64748b;
}

.btn-reset:hover {
    background: #e2e8f0;
}

/* Edit Icon */
.edit-icon {
    animation: fadeIn 0.2s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Notification */
.visual-editor-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 10001;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 500;
    opacity: 0;
    transform: translateX(100px);
    transition: all 0.3s ease;
}

.visual-editor-notification.show {
    opacity: 1;
    transform: translateX(0);
}

.visual-editor-notification.success {
    border-left: 4px solid #22c55e;
    color: #15803d;
}

.visual-editor-notification.error {
    border-left: 4px solid #ef4444;
    color: #b91c1c;
}

.visual-editor-notification.success::before {
    content: '✓';
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #22c55e;
    color: white;
    font-weight: bold;
}

.visual-editor-notification.error::before {
    content: '✕';
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #ef4444;
    color: white;
    font-weight: bold;
}

/* Editable elements hover state */
.editable-element {
    cursor: pointer;
    transition: all 0.2s ease;
}

.editable-element:hover {
    position: relative;
}

/* Scrollbar styling for tooltip */
.tooltip-body::-webkit-scrollbar {
    width: 6px;
}

.tooltip-body::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

.tooltip-body::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.tooltip-body::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Global Settings Button Animation */
#save-global-settings {
    animation: pulseGreen 2s infinite;
    position: relative;
}

#save-global-settings:hover {
    animation: none;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.5) !important;
}

#save-global-settings::before {
    content: '👈 CLIQUE AQUI';
    position: absolute;
    right: -140px;
    top: 50%;
    transform: translateY(-50%);
    background: #ef4444;
    color: white;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
    animation: bounce 1s infinite;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
}

@keyframes pulseGreen {
    0%, 100% {
        box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    }
    50% {
        box-shadow: 0 4px 20px rgba(16, 185, 129, 0.6);
    }
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(-50%) translateX(0);
    }
    50% {
        transform: translateY(-50%) translateX(-5px);
    }
}

/* Global Settings Box Highlight */
.global-chat-settings {
    position: relative;
    animation: highlightBox 3s infinite;
}

@keyframes highlightBox {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
    50% {
        box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.3);
    }
}
