﻿.gam-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gam-modal-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.gam-modal-content h3 {
    font-size: 1.875rem;
    text-align: center;
    margin-bottom: 0.25rem;
}

.gam-modal-content p {
    font-size: 1.125rem;
    color: #4a5568;
    padding-left: 1rem;
    padding-right: 1rem;
}

/* --- GAM DONATION MODAL STYLES --- */

/* --- MODAL STYLES --- */
.gam-modal-overlay {
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 100000;
    /* sit above page content */
}

.gam-modal-content {
    background-color: var(--gam-bg-light, #ffffff);
    border-radius: 24px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    color: var(--gam-text-main, #323232);
    position: relative;
    max-width: 500px;
    width: 95%;
    margin: auto;
    transition: height 0.3s ease-in-out;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Ensure modal content is above the overlay */
.gam-modal-content {
    z-index: 100001;
}

/* Donation modal specific overrides - ensure consistent padding for donation modal */
#gam-donation-modal .gam-modal-panel .gam-modal-content {
    padding-left: 50px;
    padding-right: 50px;
    padding-top: 50px;
    padding-bottom: 50px;
}

/* Donation modal heading tweak */
#gam-donation-modal .gam-modal-panel h3 {
    margin-top: 3px;
}

/* Modal header spacing */
.gam-modal-content .text-center {
    margin-bottom: 8px;
}

/* Progress bar spacing */
.gam-progress-track {
    margin-bottom: 16px;
}

.gam-modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    color: #888;
    cursor: pointer;
    line-height: 1;
    background: none;
    border: none;
    z-index: 10;
}

.gam-modal-close:hover {
    color: var(--gam-text-main, #323232);
}

.gam-modal-back {
    position: absolute;
    top: 15px;
    left: 20px;
    font-size: 20px;
    color: #888;
    cursor: pointer;
    line-height: 1;
    background: none;
    border: none;
    z-index: 10;
}

.gam-modal-back:hover {
    color: var(--gam-text-main, #323232);
}

.gam-modal-back.is-step1 {
    display: none;
}

/* --- FLOATING LABEL INPUTS --- */
.gam-floating-group {
    position: relative;
    margin-bottom: 1.5rem;
    /* Standardized spacing (24px) */
}

.gam-theme-input-floating {
    width: 100%;
    padding: 24px 20px 8px 20px;
    border: 2px solid var(--gam-border-light, #eeeeee);
    border-radius: 9999px;
    font-size: 16px;
    background-color: var(--gam-bg-light, #ffffff);
    color: var(--gam-text-main, #323232);
    outline: none;
    transition: all 0.2s;
    appearance: none;
    box-sizing: border-box;
}

.gam-theme-input-floating:focus {
    border-color: var(--gam-primary, #DC58FF);
    box-shadow: 0 0 8px rgba(220, 88, 255, 0.4);
}

.gam-theme-input-floating::placeholder {
    color: transparent;
    transition: color 0.3s ease;
}

.gam-theme-input-floating:focus::placeholder {
    color: #9ca3af;
}

.gam-theme-label-floating {
    position: absolute;
    left: 20px;
    top: 16px;
    color: var(--gam-text-light, #646464);
    font-size: 18px;
    pointer-events: none;
    transition: 0.3s ease all;
    transform-origin: left top;
    opacity: 0.7;
}

.gam-theme-input-floating:focus~.gam-theme-label-floating,
.gam-theme-input-floating:not(:placeholder-shown)~.gam-theme-label-floating {
    top: 6px;
    transform: scale(0.75);
    opacity: 1;
    font-weight: bold;
    color: var(--gam-primary, #DC58FF);
}

.gam-select-wrapper {
    position: relative;
}

.gam-select-wrapper::after {
    content: "";
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23323232%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    pointer-events: none;
}

/* --- ACTION BUTTONS --- */
.gam-theme-btn-action {
    width: 100%;
    padding: 14px;
    background-color: var(--gam-secondary, #FFB400);
    color: var(--gam-text-main, #323232);
    border: none;
    border-radius: 9999px;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    justify-content: center;
    align-items: center;
}

.gam-theme-btn-action:hover {
    background-color: var(--gam-secondary-hover, #ffc43a);
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(255, 180, 0, 0.3);
}

.gam-theme-btn-action:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* --- AMOUNT GRID --- */
.gam-amount-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.gam-amount-btn {
    background-color: var(--gam-bg-light, #ffffff);
    border: 2px solid var(--gam-border-light, #eeeeee);
    padding: 12px 5px;
    border-radius: 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--gam-text-main, #323232);
}

.gam-amount-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    border-color: var(--gam-secondary, #FFB400);
}

.gam-amount-btn.selected {
    background-color: var(--gam-primary, #DC58FF);
    color: #ffffff;
    border-color: var(--gam-primary, #DC58FF);
    transform: scale(1.05);
    box-shadow: 0 4px 10px rgba(220, 88, 255, 0.4);
}

.gam-amount-btn span.currency-label {
    font-size: 0.7em;
    margin-bottom: 2px;
    text-transform: uppercase;
    opacity: 0.7;
}

.gam-amount-btn span.amount-value {
    font-size: 1.1em;
    font-weight: bold;
}

/* --- PROGRESS BAR --- */
.gam-progress-track {
    background-color: #e6e6e6;
    height: 6px;
    border-radius: 99px;
    overflow: hidden;
    margin-top: 10px;
    margin-bottom: 20px;
}

.gam-progress-fill {
    background-color: var(--gam-secondary, #FFB400);
    height: 100%;
    transition: width 0.3s ease;
}

/* Modal Body Transition Container */
#gam-modalBody {
    position: relative;
    overflow: hidden;
    transition: height 0.3s ease-in-out;
    width: 100%;
    box-sizing: border-box;
}

.hidden {
    display: none;
}

/* Normalize overlay transform to avoid unexpected offsets */
#gam-donation-modal .gam-modal-overlay {
    transform: translate(0, 0);
}

/* --- PAYMENT TOGGLE SWITCH --- */
#gam-payment-toggle:checked~.dot {
    transform: translateX(1.5rem);
    background-color: var(--gam-primary, #DC58FF);
}

/* Gam floating group */
#gam-modalBody .mt-4 .gam-floating-group {
    padding-bottom: 5px;
    margin-bottom: 10px;
}

/* Gam name */
#gam-name {
    height: 60px;
}

/* Gam currency */
#gam-currency {
    height: 60px;
}

/* Gam email */
#gam-email {
    height: 60px;
}

/* Gam proceed */
#gam-proceed-btn {
    height: 60px;
}

/* Paragraph */
.gam-modal-content p {
    margin-bottom: 5px;
}

/* Division */
#gam-modalBody .transition-transform .mt-1 {
    padding-left: 30px;
    padding-right: 30px;
    margin-top: 0 !important;
}

/* Gam custom amount */
#gam-customAmount {
    height: 60px;
}

/* Font bold */
#gam-modalBody .mt-1 .font-bold {
    margin-left: 10px;
    margin-right: 10px;
}

/* Gam pay */
#gam-payBtn {
    height: 60px;
}

/* Span Tag */
#gam-amountGrid .gam-amount-btn span {
    margin-bottom: 0px;
    line-height: 18px;
}

/* Amount value */
#gam-amountGrid .gam-amount-btn .amount-value {
    margin-bottom: 5px;
}

/* Relative */
#gam-modalBody .mt-1 .relative {
    display: flex;
    justify-content: flex-start;
    align-items: center;
}

/* Gam custom currency symbol */
#gam-custom-currency-symbol {
    margin-left: 0px;
    margin-right: 20px;

}

/* Hide number input spinner while keeping keyboard controls */
input[type="number"]#gam-customAmount::-webkit-outer-spin-button,
input[type="number"]#gam-customAmount::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"]#gam-customAmount[type="number"] {
    -moz-appearance: textfield;
}

/* Custom currency dropdown (modern with flags + scroll) */
.gam-currency-select {
    position: relative;
    width: 100%;
    margin-top: 6px;
}

.gam-currency-options {
    /* ensure the dropdown sits flush and visually matches modal rounded corners */
    margin-top: 0 !important;
    border-radius: 20px !important;
}

.gam-currency-current {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border: 2px solid var(--gam-border-light, #eeeeee);
    border-radius: 9999px;
    background: var(--gam-bg-light, #ffffff);
    cursor: pointer;
}

.gam-currency-current .flag {
    margin-right: 12px;
    font-size: 18px;
}

.gam-currency-current .label {
    flex: 1;
    text-align: left;
    color: var(--gam-text-main, #323232);
}

.gam-currency-current .caret {
    margin-left: 12px;
    opacity: .7;
}

.gam-currency-options {
    position: absolute;
    left: 0;
    right: 0;
    top: auto;
    /* positioned by JS (portal) */
    background: var(--gam-bg-light, #ffffff);
    border: 1px solid var(--gam-border-light, #eeeeee);
    border-radius: 12px;
    max-height: 240px;
    /* show ~5 items then scroll */
    overflow-y: auto;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
    z-index: 100002;
    /* ensure above overlay & modal (overlay:100000, modal:100001) */
    display: none;
    padding: 8px;
}

.gam-currency-current.open {
    position: relative;
    z-index: 100003;
}

.gam-currency-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
}

.gam-currency-option:hover {
    background: rgba(0, 0, 0, 0.03);
}

.gam-currency-option .opt-flag {
    font-size: 18px;
    width: 28px;
    text-align: center;
}

.gam-currency-option .opt-label {
    color: var(--gam-text-main, #323232);
}

/* scrollbar styling */
.gam-currency-options::-webkit-scrollbar {
    width: 10px;
}

.gam-currency-options::-webkit-scrollbar-track {
    background: transparent;
}

.gam-currency-options::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.12);
    border-radius: 8px;
}

/* hide native select used for accessibility */
.gam-currency-hidden {
    position: absolute !important;
    left: -9999px !important;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* Dark-mode: ensure donation popup primary button has black text */
body.gam-dark-mode .gam-theme-btn-action {
    color: #000000;
}

/* Transition transform */
#gam-modalBody .transition-transform {
    padding-left: 20px;
    padding-right: 20px;
}

/* Division */
#gam-modalBody .transition-transform .mt-1 {
    padding-left: 20px !important;
    padding-right: 20px !important;
    margin-top: 0 !important;
}

/* Division */
#gam-modalBody .transition-transform .mt-4 {
    padding-left: 20px;
    padding-right: 20px;
}

/* Relative */
#gam-modalBody .mt-1 .relative:nth-child(2) {
    justify-content: flex-end;
}

/* Dark mode (site-level toggle) - scoped to body.gam-dark-mode so styles only apply when site dark mode is active */
body.gam-dark-mode .gam-theme-input-floating,
body.gam-dark-mode .gam-amount-btn,
body.gam-dark-mode .gam-currency-current {
    border-color: rgba(255, 255, 255, 0.55);
}

/* Dark mode input background color */
body.gam-dark-mode .gam-theme-input-floating {
    background-color: #4a2f4a;
}

/* Dark mode currency selector background and text */
body.gam-dark-mode .gam-currency-current {
    background-color: #4a2f4a;
    color: #ffffff;
}

body.gam-dark-mode .gam-currency-current .label {
    color: #ffffff;
}

/* Dark mode dropdown options background */
body.gam-dark-mode .gam-currency-options {
    background-color: #4a2f4a;
    border-color: rgba(255, 255, 255, 0.2);
}

body.gam-dark-mode .gam-currency-option {
    color: #ffffff;
}

body.gam-dark-mode .gam-currency-option:hover {
    background: rgba(255, 255, 255, 0.1);
}

body.gam-dark-mode .gam-currency-option .opt-label {
    color: #ffffff;
}

/* Span Tag - Dark mode payment toggle text */
body.gam-dark-mode #gam-modalBody .gam-payment-toggle-container span {
    color: #a5a5a5;
}

/* Ensure focused text in inputs is visible in dark mode */
/* Ensure focused text in inputs is visible in dark mode */
body.gam-dark-mode .gam-theme-input-floating:focus {
    color: #ffffff;
    caret-color: #ffffff;
}

/* Placeholder contrast in dark mode â€” only visible when the field is focused
   (keeps placeholder hidden when the floating label is shown) */
body.gam-dark-mode .gam-theme-input-floating:focus::placeholder {
    color: rgba(255, 255, 255, 0.66);
}

/* Keep amount button hover showing gold border (both modes) but ensure override in dark mode still uses gold */
body.gam-dark-mode .gam-amount-btn:hover {
    border-color: var(--gam-secondary, #FFB400);
}

/* Selected state in dark mode: white background, black text (per request) */
body.gam-dark-mode .gam-amount-btn.selected {
    background-color: #ffffff;
    color: #000000;
    border-color: rgba(0, 0, 0, 0.08);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
}

/* Heading and paragraph colors only in dark mode */
body.gam-dark-mode .gam-modal-content h3 {
    color: #ffffff;
}

body.gam-dark-mode .gam-modal-content p {
    color: rgba(255, 255, 255, 0.66) !important;
}

/* Light mode explicit (optional) - ensure defaults use campaign template colors */
body:not(.gam-dark-mode) .gam-theme-input-floating,
body:not(.gam-dark-mode) .gam-amount-btn {
    border-color: var(--gam-border-light, #eeeeee);
}

body:not(.gam-dark-mode) .gam-amount-btn.selected {
    /* keep existing default selected style (purple primary) */
    background-color: var(--gam-primary, #DC58FF);
    color: #ffffff;
    border-color: var(--gam-primary, #DC58FF);
}

/* Light mode modal content background */
body:not(.gam-dark-mode) #gam-donation-modal .gam-modal-panel .gam-modal-content {
    background-color: #f9f0f9;
}

/* ==========================================
   SHARE MODAL STYLING
   ========================================== */

#gam-share-modal .gam-share-grid {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
    padding: 10px 0 20px;
}

.gam-share-provider-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    padding: 8px;
    border: 2px solid var(--gam-border-light, #eeeeee);
    border-radius: 12px;
    background: var(--gam-bg-light, #ffffff);
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--gam-text-main, #323232);
    font-size: 12px;
    font-weight: 500;
    text-align: center;
}

.gam-share-provider-btn:hover {
    border-color: var(--gam-secondary, #FFB400);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.gam-share-provider-btn:active {
    transform: scale(0.98);
}

.gam-share-provider-btn svg {
    width: 28px;
    height: 28px;
    margin-bottom: 4px;
}

/* Dark mode share buttons */
body.gam-dark-mode .gam-share-provider-btn {
    background-color: #4a2f4a;
    border-color: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

body.gam-dark-mode .gam-share-provider-btn:hover {
    border-color: rgba(255, 255, 255, 0.5);
}

/* Share link input dark mode */
body.gam-dark-mode #gam-share-link {
    background-color: #4a2f4a !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
    color: #ffffff !important;
}

body.gam-dark-mode #gam-share-link::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

/* Light mode share modal content */
body:not(.gam-dark-mode) #gam-share-modal .gam-modal-panel .gam-modal-content {
    background-color: #f9f0f9;
}

/* Gam share link */
#gam-share-link {
    border-top-left-radius: 50px !important;
    border-bottom-right-radius: 0px !important;
    border-bottom-left-radius: 50px !important;
    border-top-right-radius: 0px !important;
    border-style: none !important;
    padding-left: 20px !important;
}

/* Gam share copy */
#gam-share-copy {
    border-top-left-radius: 0px;
    border-top-right-radius: 50px;
    border-bottom-left-radius: 0px;
    border-bottom-right-radius: 50px;
    border-style: none;
    border-top-style: none;
    border-bottom-style: none;
    border-left-style: none;
    background-color: #eebf01;
    color: #2d2d2d;
}

/* --- NEW CUSTOM CLASSES (Replacing Tailwind) --- */

/* Modal header styling */
.gam-modal-header {
    text-align: center;
    padding-top: 8px;
    padding-bottom: 4px;
    margin-bottom: 8px;
}

.gam-modal-title {
    font-size: 28px;
    text-align: center;
    margin-bottom: 4px;
    color: var(--gam-text-main, #323232);
}

.gam-modal-subtitle {
    font-size: 18px;
    color: #666666;
    padding-left: 16px;
    padding-right: 16px;
    margin: 0;
}

/* Step containers */
.gam-step-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    box-sizing: border-box;
    padding-left: 8px;
    padding-right: 8px;
    overflow: hidden;
    transition: transform 0.3s ease-in-out;
}

#gam-step1 {
    transform: translateX(0);
}

#gam-step2 {
    transform: translateX(100%);
}

#gam-step2.active {
    transform: translateX(0);
}

/* Step content wrapper */
.gam-step-content {
    margin-top: 16px;
    padding-bottom: 8px;
}

/* Step 2 content adjustment */
#gam-step2 .gam-step-content {
    .gam-proceed-button-wrapper {
        padding-top: 0;
    }

    /* Font Icon */
    #gam-proceed-btn i {
        margin-left: 15px;
    }

    /* Gam proceed */
    #gam-proceed-btn {
        font-weight: 500;
    }

    /* Proceed button wrapper */
    .gam-proceed-button-wrapper {
        padding-top: 0;
    }

    /* Custom amount wrapper */
    .gam-custom-amount-wrapper {
        margin-bottom: 24px;
        position: relative;
    }

    .gam-currency-symbol {
        position: absolute;
        left: 20px;
        top: 50%;
        transform: translateY(-50%);
        color: #999999;
    }

    /* Ensure custom amount input & floating label have room for currency symbol */
    .gam-custom-amount-wrapper .gam-theme-input-floating {
        padding-left: 60px;
        /* leaves space for currency symbol - increased by 15px */
    }

    .gam-custom-amount-wrapper .gam-theme-label-floating {
        left: 60px;
        /* align floating label with input content - increased by 15px */
    }

    /* Payment toggle container */
    .gam-payment-toggle-container {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 16px;
        margin-bottom: 16px;
    }

    .gam-payment-method-label {
        font-weight: bold;
        color: #666666;
    }

    .gam-toggle-switch {
        display: flex;
        align-items: center;
        cursor: pointer;
        position: relative;
    }

    .gam-toggle-background {
        position: absolute;
        width: 56px;
        height: 32px;
        background-color: #999999;
        border-radius: 9999px;
        left: 0;
        top: 0;
    }

    .gam-toggle-switch input[type="checkbox"] {
        position: relative;
        appearance: none;
        width: 56px;
        height: 32px;
        background-color: #999999;
        border-radius: 9999px;
        cursor: pointer;
        transition: background-color 0.3s;
        margin: 0;
    }

    .gam-toggle-switch input[type="checkbox"]:checked {
        background-color: var(--gam-primary, #DC58FF);
    }

    .gam-toggle-dot {
        position: absolute;
        left: 4px;
        top: 4px;
        width: 24px;
        height: 24px;
        background-color: white;
        border-radius: 50%;
        transition: transform 0.3s;
        pointer-events: none;
    }

    .gam-toggle-switch input[type="checkbox"]:checked~.gam-toggle-dot {
        transform: translateX(24px);
    }

    /* Payment icons */
    .gam-payment-icons {
        margin-top: 16px;
        display: flex;
        justify-content: center;
        gap: 12px;
        color: #999999;
    }

    .gam-payment-icons i {
        font-size: 20px;
    }

    /* Share modal styles */
    .gam-share-grid {
        display: flex;
        gap: 16px;
        justify-content: center;
        flex-wrap: wrap;
        padding: 10px 0 20px;
    }

    .gam-copy-link-section {
        margin-top: 8px;
    }

    .gam-copy-link-label {
        font-size: 14px;
        font-weight: 500;
        margin-bottom: 12px;
        color: var(--gam-text-main, #323232);
    }

    .gam-copy-link-container {
        display: flex;
        gap: 8px;
        align-items: center;
    }

    .gam-copy-link-container input {
        flex: 1;
        padding: 12px;
        border-radius: 8px;
        border: 2px solid var(--gam-border-light, #eeeeee);
        background-color: var(--gam-bg-light, #ffffff);
    }

    .gam-copy-link-container button {
        white-space: nowrap;
    }

    /* Division */
    #gam-share-modal .mt-2 div {
        display: grid !important;
        column-gap: 0px !important;
        row-gap: 0px !important;
        transform: translatex(0px) translatey(0px);
        grid-template-columns: auto 20%;
    }

    /* Division */
    #gam-share-modal .gam-modal-panel .gam-modal-content .mt-2 div {
        grid-template-columns: auto 20% !important;
    }

    /* Mobile adjustments for donation modal popup */
    @media (max-width: 640px) {

        #gam-donation-modal .gam-modal-panel .gam-modal-content,
        #donationModal .gam-modal-container,
        .gam-modal-content {
            padding-left: 15px !important;
            padding-right: 15px !important;
        }

        .gam-modal-content h3,
        #campaignTitle,
        .gam-modal-title {
            font-size: 16px !important;
        }

        .gam-step-content,
        #modalBody {
            padding-left: 0 !important;
            padding-right: 0 !important;
        }
    }