/**
 * DeepL Translation Styles for Gravity Forms
 */

/* Translation Button */
.whu-deepl-translate-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 8px;
    margin-bottom: 15px;
    padding: 8px 16px;
    background: #2271b1;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

/* Combined Translation Button - larger and more prominent */
.whu-deepl-translate-combined-btn {
    display: block;
    width: 100%;
    max-width: 400px;
    margin: 20px auto;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    background: #2271b1;
    box-shadow: 0 2px 8px rgba(34, 113, 177, 0.25);
}

.whu-deepl-translate-combined-btn:hover {
    background: #135e96;
    box-shadow: 0 4px 12px rgba(34, 113, 177, 0.35);
    transform: translateY(-1px);
}

.whu-deepl-translate-combined-btn:active {
    transform: translateY(0);
}

.whu-deepl-translate-combined-btn .dashicons {
    width: 18px;
    height: 18px;
    font-size: 18px;
}

.whu-deepl-translate-btn:hover {
    background: #135e96;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
}

.whu-deepl-translate-btn:active {
    transform: translateY(1px);
}

.whu-deepl-translate-btn:disabled,
.whu-deepl-translate-btn.translating {
    background: #8c8f94;
    cursor: not-allowed;
    opacity: 0.7;
}

/* Dashicons in button */
.whu-deepl-translate-btn .dashicons {
    width: 16px;
    height: 16px;
    font-size: 16px;
    line-height: 1;
}

/* WordPress Spinner */
.whu-deepl-translate-btn .spinner {
    float: none;
    margin: 0;
    display: inline-block;
    width: 16px;
    height: 16px;
    background-size: 16px 16px;
}

.whu-deepl-translate-btn .spinner.is-active {
    display: inline-block;
}

/* Translated field highlight animation */
.whu-translated-field {
    animation: highlightTranslation 2s ease;
    border-color: #46b450 !important;
}

@keyframes highlightTranslation {
    0% {
        background-color: #e7f7e8;
    }
    100% {
        background-color: transparent;
    }
}

/* Field container spacing */
.gfield .whu-deepl-translate-btn {
    margin-left: 0;
}

/* Responsive adjustments */
@media screen and (max-width: 640px) {
    .whu-deepl-translate-btn {
        font-size: 13px;
        padding: 6px 12px;
    }
}

/* Success indicator */
.whu-translation-success {
    display: inline-block;
    margin-left: 10px;
    color: #46b450;
    font-size: 14px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Info text */
.whu-translation-info {
    font-size: 12px;
    color: #646970;
    margin-top: 5px;
    font-style: italic;
}

/* Loading state overlay (optional) */
.whu-translation-loading-overlay {
    position: relative;
}

.whu-translation-loading-overlay::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
}
