/**
 * Public CSS for Add as Preferred Source
 *
 * @since      1.0.0
 *
 * @package    Add_As_Preferred_Source
 * @subpackage Add_As_Preferred_Source/public/css
 */

/* Preferred Source Banner */
.add-as-preferred-source-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: fixed;
    width: 100%;
    padding: 10px 15px;
    box-sizing: border-box;
    z-index: 999999;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    left: 0;
    right: 0;
    cursor: pointer;
    transition: all 0.3s ease;
}

.add-as-preferred-source-banner:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.add-as-preferred-source-banner.position-top {
    top: 0;
    animation: add-as-preferred-source-slide-in-top 0.5s ease;
}

.add-as-preferred-source-banner.position-bottom {
    bottom: 0;
    animation: add-as-preferred-source-slide-in-bottom 0.5s ease;
}

@keyframes add-as-preferred-source-slide-in-top {
    0% {
        transform: translateY(-100%);
    }

    100% {
        transform: translateY(0);
    }
}

@keyframes add-as-preferred-source-slide-in-bottom {
    0% {
        transform: translateY(100%);
    }

    100% {
        transform: translateY(0);
    }
}

.add-as-preferred-source-banner.hidden {
    display: none;
}

.add-as-preferred-source-banner.adasprso-trigger-pending {
    display: none;
}

.banner-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

.banner-text {
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    flex: 1;
    margin-right: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.google-button-image {
    flex-shrink: 0;
    margin-left: 12px;
    display: flex;
    align-items: center;
}

.google-button-image img {
    height: 28px;
    width: auto;
    border-radius: 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

#adasprso-banner .close-button {
    /* Reset theme/browser button styles */
    appearance: none;
    -webkit-appearance: none;
    background: none;
    border: none;
    outline: none;
    box-shadow: none;
    color: inherit;
    font: inherit;
    /* Layout */
    margin-left: 15px;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
    padding: 4px 8px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s;
    font-weight: bold;
}

#adasprso-banner .close-button:hover,
#adasprso-banner .close-button:focus,
#adasprso-banner .close-button:active {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    outline: none;
    box-shadow: none;
    color: inherit;
}

/* Visible keyboard focus ring, independent of the admin-configured banner colors. */
#adasprso-banner .close-button:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

/* Wider screens: add breathing room on either side */
@media screen and (min-width: 1024px) {
    .add-as-preferred-source-banner {
        padding: 10px 32px;
    }
}

/* Additional styles for admin bar */
body.admin-bar .add-as-preferred-source-banner.position-top {
    top: 46px;
}

@media screen and (min-width: 783px) {
    body.admin-bar .add-as-preferred-source-banner.position-top {
        top: 32px;
    }
}

/* Dynamic padding is now handled by JS */
body.has-add-as-preferred-source-banner {
    transition: padding 0.3s ease;
}

/* Responsive styles */
@media screen and (max-width: 480px) {
    .banner-text {
        font-size: 13px;
        margin-right: 8px;
    }

    .google-button-image img {
        height: 24px;
    }

    #adasprso-banner .close-button {
        font-size: 18px;
        margin-left: 8px;
    }
}

@media screen and (max-width: 360px) {
    .add-as-preferred-source-banner {
        padding: 8px 12px;
    }

    .banner-text {
        font-size: 12px;
    }

    .google-button-image img {
        height: 22px;
    }
}

/* Inline Button Styles */
.adasprso-inline-container {
    margin: 30px 0;
    width: 100%;
    clear: both;
    box-sizing: border-box;
}

/* Elementor renders its layout through the_content with full-width sections,
   so the injected card would otherwise stretch edge to edge. */
body.elementor-page .adasprso-inline-container {
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 20px;
    padding-right: 20px;
}

/* "Google's own button" implementation method — Google renders the button
   itself, we just need to center its wrapper. */
.add-as-preferred-source-banner.adasprso-standard-banner {
    cursor: default;
    background: #fff;
}

.add-as-preferred-source-banner.adasprso-standard-banner:hover {
    transform: none;
}

.adasprso-standard-banner-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 6px 0;
}

.adasprso-standard-inline {
    display: flex;
    justify-content: center;
}

/* Layout 2: Gradient Card */
.adasprso-inline-layout-2 {
    /* Gradient Background */
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;

    /* Flex Layout */
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    max-width: 100%;

    /* Reset link styles when the element is an <a> */
    text-decoration: none !important;
    color: inherit !important;
    cursor: pointer;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.adasprso-inline-layout-2:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.adasprso-inline-text-wrapper {
    flex: 1;
    text-align: left;
}

.adasprso-inline-title {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 16px;
    font-weight: 600;
    color: #1c1e21;
    line-height: 1.4;
    margin-bottom: 4px;
}

.adasprso-inline-subtitle {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 14px;
    color: #515761;
    line-height: 1.4;
}

.adasprso-inline-button {
    display: flex;
    align-items: center;
    transition: transform 0.2s ease;
    text-decoration: none !important;
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
    flex-shrink: 0;
}

.adasprso-inline-button:hover {
    transform: scale(1.02);
}

.adasprso-inline-button img {
    height: 40px;
    width: auto;
    display: block;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    margin: 0;
    padding: 0;
    max-width: 100%;
}

/* Responsive: Stack on mobile */
@media screen and (max-width: 600px) {
    .adasprso-inline-layout-2 {
        flex-direction: column;
        text-align: center;
    }

    .adasprso-inline-text-wrapper {
        text-align: center;
        margin-bottom: 15px;
    }

    .adasprso-inline-layout-2 .adasprso-inline-button {
        width: auto;
        justify-content: center;
    }
}

@media screen and (max-width: 480px) {
    .adasprso-inline-title {
        font-size: 15px;
    }

    .adasprso-inline-button img {
        height: 36px;
    }
}

.adasprso-inline-content {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    max-width: 100%;
}

.adasprso-inline-text {
    font-family: inherit;
    font-size: 18px;
    font-weight: 500;
    color: inherit;
    line-height: 1.4;
    text-align: center;
}

.adasprso-inline-button:hover {
    transform: scale(1.02);
}

.adasprso-inline-button img {
    height: 40px;
    width: auto;
    display: block;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
    margin: 0;
    padding: 0;
    max-width: 100%;
}

@media screen and (max-width: 480px) {
    .adasprso-inline-text {
        font-size: 16px;
    }

    .adasprso-inline-button img {
        height: 36px;
    }
}

/* Simple inline style: badge only */
.adasprso-inline-simple {
    display: inline-block;
    text-decoration: none;
    line-height: 0;
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
    transition: transform 0.2s ease;
}

.adasprso-inline-simple:hover {
    transform: scale(1.03);
}

.adasprso-inline-simple img {
    height: 40px;
    width: auto;
    display: block;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
    margin: 0;
    padding: 0;
    max-width: 100%;
}

@media screen and (max-width: 480px) {
    .adasprso-inline-simple img {
        height: 36px;
    }
}

/* Custom text badge (for unsupported languages) */
.adasprso-custom-badge {
    display: inline-flex;
    align-items: center;
    height: 28px;
    background: #fff;
    border-radius: 3px;
    padding: 0 8px 0 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    gap: 5px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    white-space: nowrap;
}

.adasprso-custom-badge--inline {
    height: 40px;
    padding: 0 12px 0 9px;
    gap: 7px;
    border-radius: 4px;
}

.adasprso-google-g {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}

.adasprso-google-g svg {
    width: 14px;
    height: 14px;
    display: block;
}

.adasprso-custom-badge--inline .adasprso-google-g svg {
    width: 20px;
    height: 20px;
}

.adasprso-custom-badge--dark {
    background: #202124;
}

.adasprso-custom-badge--dark .adasprso-custom-badge-text {
    color: #fff;
}

.adasprso-custom-badge-text {
    color: #444;
    font-size: 11px;
    font-weight: 500;
    line-height: 1;
    letter-spacing: 0.01em;
}

.adasprso-custom-badge--inline .adasprso-custom-badge-text {
    font-size: 13px;
}

@media screen and (max-width: 480px) {
    .adasprso-custom-badge {
        height: 24px;
    }

    .adasprso-custom-badge--inline {
        height: 36px;
    }
}

/* Strip inline style: slim single line, badge left, sentence right */
.adasprso-inline-strip {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    max-width: 100%;
    text-decoration: none !important;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.adasprso-inline-strip:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

.adasprso-inline-strip-badge {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
}

.adasprso-inline-strip-badge .adasprso-google-g svg {
    width: 20px;
    height: 20px;
}

.adasprso-inline-strip-text {
    font-size: 14px;
    line-height: 1.5;
}

/* Pill inline style: compact rounded chip */
.adasprso-inline-pill-wrap {
    display: flex;
    justify-content: center;
}

.adasprso-inline-pill {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 18px 8px 8px;
    border-radius: 999px;
    border: 1px solid #e5e7eb;
    font-size: 13.5px;
    max-width: 100%;
    text-decoration: none !important;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.adasprso-inline-pill:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

.adasprso-inline-pill-badge {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    background: #fff;
    border-radius: 50%;
    padding: 5px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

.adasprso-inline-pill-badge .adasprso-google-g svg {
    width: 16px;
    height: 16px;
}

/* Link inline style: editorial sentence with badge inline */
.adasprso-inline-link {
    font-size: 15px;
    line-height: 1.7;
    text-align: center;
}

.adasprso-inline-link-cta {
    text-decoration: underline;
    text-underline-offset: 3px;
    font-weight: 600;
}

.adasprso-inline-link-badge {
    display: inline-flex;
    vertical-align: -3px;
    margin: 0 3px;
}

.adasprso-inline-link-badge .adasprso-google-g svg {
    width: 16px;
    height: 16px;
}

/* Boxed inline style: icon tile, headline/subtext, and a solid action pill */
.adasprso-inline-boxed {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 20px;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    text-decoration: none !important;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.adasprso-inline-boxed:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.adasprso-inline-boxed-icon {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.adasprso-inline-boxed-icon .adasprso-google-g svg {
    width: 22px;
    height: 22px;
}

.adasprso-inline-boxed-text {
    flex: 1;
    text-align: left;
}

.adasprso-inline-boxed-title {
    display: block;
    font-size: 15px;
    font-weight: 600;
    margin: 0 0 3px;
}

.adasprso-inline-boxed-subtitle {
    display: block;
    font-size: 13px;
    opacity: 0.72;
}

.adasprso-inline-boxed-action {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: #202124;
    color: #fff;
    border-radius: 8px;
    padding: 9px 14px;
    font-size: 12.5px;
    font-weight: 500;
    white-space: nowrap;
}

.adasprso-inline-boxed-action .adasprso-google-g svg {
    width: 14px;
    height: 14px;
}

@media screen and (max-width: 600px) {
    .adasprso-inline-boxed {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .adasprso-inline-boxed-action {
        align-self: flex-start;
    }
}

@media screen and (max-width: 480px) {
    .adasprso-inline-strip-badge .adasprso-google-g svg,
    .adasprso-inline-pill-badge .adasprso-google-g svg,
    .adasprso-inline-link-badge .adasprso-google-g svg {
        width: 14px;
        height: 14px;
    }

    .adasprso-inline-boxed-icon {
        width: 38px;
        height: 38px;
    }

    .adasprso-inline-boxed-icon .adasprso-google-g svg {
        width: 18px;
        height: 18px;
    }
}
/* ── Alignment for manually placed buttons (shortcode, block, template tag) ── */
.adasprso-inline-container.adasprso-align-left {
    text-align: left;
}

.adasprso-inline-container.adasprso-align-center {
    text-align: center;
}

.adasprso-inline-container.adasprso-align-right {
    text-align: right;
}

/* The pill wrapper and the editorial link set their own alignment, so reach
   past them rather than relying on text-align inheritance. */
.adasprso-align-left .adasprso-inline-pill-wrap {
    justify-content: flex-start;
}

.adasprso-align-center .adasprso-inline-pill-wrap {
    justify-content: center;
}

.adasprso-align-right .adasprso-inline-pill-wrap {
    justify-content: flex-end;
}

.adasprso-align-left .adasprso-inline-link {
    text-align: left;
}

.adasprso-align-center .adasprso-inline-link {
    text-align: center;
}

.adasprso-align-right .adasprso-inline-link {
    text-align: right;
}

/* The card and boxed styles are full-width blocks, so they need to shrink to
   their content before an alignment is visible at all. */
.adasprso-align-left .adasprso-inline-layout-2,
.adasprso-align-left .adasprso-inline-boxed,
.adasprso-align-right .adasprso-inline-layout-2,
.adasprso-align-right .adasprso-inline-boxed {
    width: fit-content;
    max-width: 100%;
}

.adasprso-align-right .adasprso-inline-layout-2,
.adasprso-align-right .adasprso-inline-boxed {
    margin-left: auto;
}

.adasprso-align-left .adasprso-inline-layout-2,
.adasprso-align-left .adasprso-inline-boxed {
    margin-right: auto;
}

/* Google's own button, placed manually */
.adasprso-align-left.adasprso-standard-inline {
    justify-content: flex-start;
}

.adasprso-align-right.adasprso-standard-inline {
    justify-content: flex-end;
}
