/**
 * Avas Theme Builder - Elementor Editor Edit Overlay Styles
 */

/* Wrapper containers for header/footer */
.tx-theme-builder-header,
.tx-theme-builder-footer {
    position: relative !important;
}

/* Edit Overlay Base */
.tx-edit-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: transparent;
    border: 2px dashed transparent;
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease-in-out;
    z-index: 99999;
    pointer-events: none;
    box-sizing: border-box;
}

.tx-edit-overlay-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    /*background: rgba(146, 126, 255, 0.08);*/
    border-color: #927eff;
}

/* Header specific styling */
.tx-edit-overlay-header.tx-edit-overlay-visible {
    /*background: rgba(146, 126, 255, 0.1);*/
    border-color: #927eff;
}

/* Footer specific styling */
.tx-edit-overlay-footer.tx-edit-overlay-visible {
    /*background: rgba(255, 107, 107, 0.08);*/
    border-color: #ff6b6b;
}

/* Edit Button */
.tx-edit-overlay-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: linear-gradient(135deg, #927eff 0%, #6c5ce7 100%);
    color: #fff !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none !important;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(146, 126, 255, 0.4);
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    outline: none;
    line-height: 1;
}

.tx-edit-overlay-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(146, 126, 255, 0.5);
    color: #fff !important;
    background: linear-gradient(135deg, #8470ff 0%, #5a4bd1 100%);
    text-decoration: none !important;
}

.tx-edit-overlay-button:active {
    transform: translateY(0);
}

.tx-edit-overlay-button:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(146, 126, 255, 0.3), 0 2px 10px rgba(146, 126, 255, 0.4);
}

.tx-edit-overlay-button svg {
    flex-shrink: 0;
    width: 14px;
    height: 14px;
}

.tx-edit-overlay-text {
    white-space: nowrap;
}

/* Footer button color */
.tx-edit-overlay-footer .tx-edit-overlay-button {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a5a 100%);
    box-shadow: 0 2px 10px rgba(255, 107, 107, 0.4);
}

.tx-edit-overlay-footer .tx-edit-overlay-button:hover {
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.5);
    background: linear-gradient(135deg, #ff5252 0%, #e04848 100%);
}

.tx-edit-overlay-footer .tx-edit-overlay-button:focus {
    box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.3), 0 2px 10px rgba(255, 107, 107, 0.4);
}

/* Corner indicator removed - button is now in corner */

/* Subtle animation for hover */
@keyframes tx-pulse {
    0%, 100% {
        box-shadow: 0 2px 10px rgba(146, 126, 255, 0.4);
    }
    50% {
        box-shadow: 0 2px 15px rgba(146, 126, 255, 0.6);
    }
}

.tx-edit-overlay-visible .tx-edit-overlay-button {
    animation: tx-pulse 2s ease-in-out infinite;
}

.tx-edit-overlay-footer.tx-edit-overlay-visible .tx-edit-overlay-button {
    animation-name: tx-pulse-footer;
}

@keyframes tx-pulse-footer {
    0%, 100% {
        box-shadow: 0 2px 10px rgba(255, 107, 107, 0.4);
    }
    50% {
        box-shadow: 0 2px 15px rgba(255, 107, 107, 0.6);
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .tx-edit-overlay {
        padding: 10px;
    }
    
    .tx-edit-overlay-button {
        padding: 8px 12px;
        font-size: 12px;
        gap: 5px;
    }
}

/* Small screens */
@media (max-width: 480px) {
    .tx-edit-overlay {
        padding: 8px;
    }
    
    .tx-edit-overlay-button {
        padding: 6px 10px;
        font-size: 11px;
        gap: 4px;
    }
    
    .tx-edit-overlay-button svg {
        width: 12px;
        height: 12px;
    }
}

/* Prevent layout issues */
.tx-theme-builder-header > .elementor,
.tx-theme-builder-footer > .elementor {
    position: relative;
    z-index: 1;
}

/* Ensure the overlay doesn't interfere with normal page viewing */
body:not(.elementor-editor-active) .tx-edit-overlay {
    display: none !important;
}

/* Show overlay only in Elementor preview */
.elementor-editor-preview .tx-edit-overlay,
body.elementor-editor-active .tx-edit-overlay {
    display: flex !important;
}