/* Google Preferred Source Button Styles */

/* Reset all button-related images */
.gpswp-preferred-source-button img,
.gpswp-preferred-source-link img {
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    box-sizing: border-box;
}

/* Base button container */
.gpswp-preferred-source-button {
    margin: 20px 0;
    text-align: center;
}

/* Button container alignment */
.gpswp-preferred-source-button.gpswp-align-left {
    text-align: left;
}

.gpswp-preferred-source-button.gpswp-align-right {
    text-align: right;
}

.gpswp-preferred-source-button.gpswp-align-center {
    text-align: center;
}

/* Button link */
.gpswp-preferred-source-link {
    display: inline-block;
    text-decoration: none;
    vertical-align: middle;
}

/* Button images */
.gpswp-preferred-source-link img {
    height: auto !important;
    border: none !important;
    vertical-align: middle;
    margin: 0 !important;
    padding: 0 !important;
    display: block;
}

/* Ensure all images within button containers have zero margin/padding */
.gpswp-preferred-source-button img {
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
}

/* Button sizes */
.gpswp-preferred-source-link.gpswp-size-small img {
    width: 75px;
}

.gpswp-preferred-source-link.gpswp-size-normal img {
    width: 125px;
}

.gpswp-preferred-source-link.gpswp-size-large img {
    width: 175px;
}

/* Fallback text button */
.gpswp-preferred-source-link.gpswp-fallback-button {
    display: inline-block;
    background: #000;
    color: #fff;
    padding: 12px 20px;
    text-decoration: none;
    border-radius: 6px;
    font-family: Arial, sans-serif;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    vertical-align: middle;
}

.gpswp-preferred-source-link.gpswp-fallback-button .gpswp-button-content {
    display: flex;
    align-items: center;
    gap: 8px;
}

.gpswp-preferred-source-link.gpswp-fallback-button svg {
    fill: currentColor;
}

/* Button text */
.gpswp-button-text {
    font-family: Arial, sans-serif;
    font-size: 14px;
    color: #333;
    line-height: 1.4;
    vertical-align: middle;
    margin-left: 5px;
}

/* Reduce font size for small buttons */
.gpswp-preferred-source-link.gpswp-size-small ~ .gpswp-button-text,
.gpswp-preferred-source-button:has(.gpswp-size-small) .gpswp-button-text {
    font-size: 11px;
}

/* Theme-specific styles */
.gpswp-preferred-source-button.gpswp-theme-auto img {
    filter: brightness(1);
}

@media (prefers-color-scheme: dark) {
    .gpswp-preferred-source-button.gpswp-theme-auto img {
        filter: brightness(0) invert(1);
    }
}

/* Animation classes - default state (hidden until viewport) */
.gpswp-preferred-source-button.gpswp-animation-fade-in {
    opacity: 0;
    animation: none;
}

.gpswp-preferred-source-button.gpswp-animation-wiggle {
    animation: none;
}

.gpswp-preferred-source-button.gpswp-animation-bounce {
    animation: none;
}

.gpswp-preferred-source-button.gpswp-animation-pulse {
    animation: none;
}

.gpswp-preferred-source-button.gpswp-animation-glow {
    animation: none;
}

.gpswp-preferred-source-button.gpswp-animation-ease-it {
    opacity: 0;
    animation: none;
}

.gpswp-preferred-source-button.gpswp-animation-nudge-left {
    animation: none;
}

.gpswp-preferred-source-button.gpswp-animation-scroll-up-spring {
    opacity: 0;
    animation: none;
}

/* Animation classes - triggered when in viewport for 2 seconds */
.gpswp-preferred-source-button.gpswp-animation-fade-in.gpswp-in-viewport {
    animation: gpswp-fade-in 0.5s ease-in forwards;
}

.gpswp-preferred-source-button.gpswp-animation-wiggle.gpswp-in-viewport {
    animation: gpswp-wiggle 0.5s ease-in-out;
}

.gpswp-preferred-source-button.gpswp-animation-bounce.gpswp-in-viewport {
    animation: gpswp-bounce 0.6s ease-in-out;
}

.gpswp-preferred-source-button.gpswp-animation-pulse.gpswp-in-viewport {
    animation: gpswp-pulse 1.5s ease-in-out forwards;
    border-radius: 4px;
    display: inline-block;
}

.gpswp-preferred-source-button.gpswp-animation-glow.gpswp-in-viewport {
    animation: gpswp-glow 2s ease-in-out infinite;
    border-radius: 6px;
    display: inline-block;
}

.gpswp-preferred-source-button.gpswp-animation-ease-it.gpswp-in-viewport {
    animation: gpswp-ease-it 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

.gpswp-preferred-source-button.gpswp-animation-nudge-left.gpswp-in-viewport {
    animation: gpswp-nudge-left 1.2s ease-in-out 2;
}

.gpswp-preferred-source-button.gpswp-animation-scroll-up-spring.gpswp-in-viewport {
    animation: gpswp-scroll-up-spring 0.9s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
}

/* Pending animation state (optional visual feedback) */
.gpswp-preferred-source-button.gpswp-pending-animation {
    /* Add subtle visual indicator that animation is pending */
    transition: opacity 0.3s ease;
}

/* Ensure fade-in animation sets opacity to 1 when complete */
@keyframes gpswp-fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Custom margin support */
.gpswp-preferred-source-button.gpswp-margin-none {
    margin: 0;
}

.gpswp-preferred-source-button.gpswp-margin-small {
    margin: 10px 0;
}

.gpswp-preferred-source-button.gpswp-margin-large {
    margin: 30px 0;
}

/* Block Editor Preview Styles */
.gpswp-block-editor .gpswp-block-preview {
    border: 1px dashed #ccc;
    padding: 20px;
    margin: 10px 0;
    background: #f9f9f9;
}

.gpswp-block-editor .gpswp-block-preview-img {
    pointer-events: none;
}

/* Responsive design - only applies when responsive scaling is enabled */
@media (max-width: 768px) {
    .gpswp-responsive-scaling .gpswp-preferred-source-button {
        margin: 15px 0;
    }
    
    .gpswp-responsive-scaling .gpswp-preferred-source-link.gpswp-size-large img {
        width: 150px;
    }
    
    .gpswp-responsive-scaling .gpswp-preferred-source-link.gpswp-size-normal img {
        width: 100px;
    }
    
    .gpswp-responsive-scaling .gpswp-preferred-source-link.gpswp-size-small img {
        width: 60px;
    }
}

@media (max-width: 480px) {
    .gpswp-responsive-scaling .gpswp-preferred-source-button {
        margin: 10px 0;
    }
    
    .gpswp-responsive-scaling .gpswp-preferred-source-link.gpswp-size-large img {
        width: 125px;
    }
    
    .gpswp-responsive-scaling .gpswp-preferred-source-link.gpswp-size-normal img {
        width: 85px;
    }
    
    .gpswp-responsive-scaling .gpswp-preferred-source-link.gpswp-size-small img {
        width: 50px;
    }
    
    .gpswp-responsive-scaling .gpswp-button-text {
        font-size: 12px;
        margin-left: 3px;
    }
}
