/* ========================================
   GOAIDME DONATION MODAL - COMPLETE CSS
   ======================================== */

/* --- MODAL VISIBILITY CLASSES --- */
.gam-modal-hidden {
    display: none !important;
}

.gam-modal-visible {
    display: flex !important;
}

/* Modal overlay (hidden by default) - shown when modal gains `gam-modal-visible` */
.gam-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 100000;
}

/* Ensure modal content is above the overlay */
.gam-modal-content {
    position: relative;
    z-index: 99999;
}

/* --- DETACHED CURRENCY DROPDOWN (body-appended, absolute positioning) --- */
.gam-currency-select {
    position: relative;
    width: 100%;
    margin-top: 6px;
}

.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: 0.7;
}

.gam-currency-current:hover {
    background: var(--gam-bg-hover, #f9f9f9);
    border-color: var(--gam-border-hover, #ddd);
}

.gam-currency-options {
    position: absolute;
    left: 0;
    right: 0;
    top: auto; /* positioned by JS */
    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;
    list-style: none;
    margin: 0;
}
.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;
}
    backdrop-filter: blur(6px);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.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: 420px;
    width: 95%;
    margin: auto;
    transition: height 0.3s ease-in-out; 
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* 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;
}

.gam-modal-back-arrow {
    position: absolute;
    top: 15px;
    left: 20px;
    font-size: 20px;
    color: #888;
    cursor: pointer;
    line-height: 1;
    background: none;
    border: none;
    z-index: 10;
    display: none;
}
.gam-modal-back-arrow:hover { color: var(--gam-text-main, #323232); }
.gam-modal-back-arrow.gam-show {
    display: block;
}

/* --- 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;
}

/* Ensure placeholder/label logic for the standard .gam-input */
.gam-input::placeholder {
    color: transparent;
    transition: color 0.25s ease;
}
.gam-input:focus::placeholder {
    color: #9ca3af;
}

.gam-input:not(:placeholder-shown) + .gam-label,
.gam-input:focus + .gam-label {
    top: -0.75rem;
    font-size: 0.875rem;
    color: var(--gam-secondary, #FFB400);
}

/* For select elements we add/remove the 'has-value' class from JS */
.gam-select.has-value + .gam-label {
    top: -0.75rem;
    font-size: 0.875rem;
    color: var(--gam-secondary, #FFB400);
}

.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);
}

/* --- FORM STYLES (Floating Label) --- */
.gam-form-group {
    position: relative;
    margin-bottom: 1.5rem;
}

.gam-label {
    position: absolute;
    left: 20px;
    top: 16px;
    font-size: 16px;
    color: var(--gam-text-light, #646464);
    pointer-events: none;
    transition: all 0.2s ease;
    transform-origin: left top;
    background: transparent;
    padding: 0;
}

.gam-input {
    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 ease;
    font-family: inherit;
    box-sizing: border-box;
}

.gam-input:focus {
    border-color: var(--gam-secondary, #FFB400);
    box-shadow: 0 0 0 3px rgba(255, 180, 0, 0.1);
}

/* Float the label on focus or when input has value */
.gam-input:not(:placeholder-shown) + .gam-label,
.gam-input:focus + .gam-label {
    top: 6px;
    font-size: 13px;
    color: var(--gam-secondary, #FFB400);
    transform: scale(0.85);
    font-weight: 600;
}

.gam-select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23323232' stroke-width='2'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 20px center;
    background-size: 1.25rem;
    padding-right: 2.75rem;
}

/* Modern scrollable currency dropdown - shows 5 items at a time */
.gam-currency-select {
    position: relative;
    width: 100%;
    max-height: fit-content;
    overflow-y: auto;
    background: var(--gam-bg-light, #ffffff);
    border: 2px solid var(--gam-border-light, #eeeeee);
    border-radius: 12px;
    padding: 8px 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    font-size: 15px;
    line-height: 1.6;
}

/* Scrollbar styling for the select element */
.gam-currency-select::-webkit-scrollbar {
    width: 6px;
}

.gam-currency-select::-webkit-scrollbar-track {
    background: transparent;
}

.gam-currency-select::-webkit-scrollbar-thumb {
    background: var(--gam-secondary, #FFB400);
    border-radius: 3px;
}

.gam-currency-select::-webkit-scrollbar-thumb:hover {
    background: darken(var(--gam-secondary, #FFB400), 10%);
}

/* Option styling within the select */
.gam-currency-select option {
    padding: 10px 15px;
    background: var(--gam-bg-light, #ffffff);
    color: var(--gam-text-main, #323232);
    line-height: 1.6;
}

.gam-currency-select option:checked {
    background: linear-gradient(var(--gam-secondary, #FFB400), var(--gam-secondary, #FFB400));
    background-color: var(--gam-secondary, #FFB400) !important;
    color: #ffffff;
}

.gam-currency-select option:hover {
    background: var(--gam-bg-hover, #f5f5f5);
}

/* Modern currency dropdown with flags */
.gam-currency-select {
    position: relative;
    width: 100%;
}

.gam-currency-current {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border: 2px solid var(--gam-border-light, #eeeeee);
    border-radius: 9999px;
    background: var(--gam-bg-light, #ffffff);
    cursor: pointer;
    transition: all 0.2s ease;
}

.gam-currency-current:hover {
    border-color: var(--gam-secondary, #FFB400);
}

.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: 0.7;
}

.gam-currency-options {
    position: absolute;
    left: 0;
    right: 0;
    top: auto;
    background: var(--gam-bg-light, #ffffff);
    border: 1px solid var(--gam-border-light, #eeeeee);
    border-radius: 12px;
    max-height: 240px;
    overflow-y: auto;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
    z-index: 99999;
    display: none;
    padding: 8px;
    margin-top: 0 !important;
}

.gam-currency-options.open {
    display: block;
}

.gam-currency-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.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);
}

.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;
}

/* --- 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;
}

.gam-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 9999px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.gam-btn-primary {
    width: 100%;
    padding: 1rem;
    margin-top: 0.5rem;
    background-color: var(--gam-secondary, #FFB400);
    color: #000;
    font-size: 16px;
    font-weight: 600;
}

.gam-btn-primary:hover {
    background-color: var(--gam-secondary-hover, #ffc43a);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.gam-btn-primary:active {
    transform: translateY(0);
}

/* --- AMOUNT GRID --- */
.gam-amount-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.gam-amount-btn,
.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,
.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,
.amount-btn.selected {
    background-color: var(--gam-secondary, #FFB400);
    color: #000;
    border-color: var(--gam-secondary, #FFB400);
    transform: scale(1.05);
    box-shadow: 0 4px 10px rgba(255, 180, 0, 0.4);
}

.gam-amount-btn span.currency-label,
.currency-label {
    font-size: 0.7em;
    margin-bottom: 2px;
    text-transform: uppercase;
    opacity: 0.7;
}

.gam-amount-btn span.amount-value,
.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;
}

/* --- STEP STYLING --- */
#modalBody {
    position: relative;
    overflow: hidden;
    height: auto;
}

.gam-step {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out;
}

.gam-step-active {
    transform: translateX(0);
    opacity: 1;
    z-index: 2;
}

.gam-step-hidden {
    transform: translateX(100%);
    opacity: 0;
    z-index: 1;
    pointer-events: none;
}

.gam-step-content {
    margin-top: 16px;
    padding: 0px 20px 0px 20px;
}

/* --- PAYMENT TABS --- */
.gam-payment-tabs {
    display: flex;
    gap: 8px;
    border-bottom: 2px solid #e0e0e0;
    margin-bottom: 20px;
}

.gam-payment-tabs-container {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    width: 100%;
}

.gam-payment-tab {
    background: none;
    border: none;
    padding: 12px 16px;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    font-weight: 600;
    color: #666;
    transition: all 0.2s;
}

.gam-payment-tab:hover {
    color: #333;
}

.gam-payment-tab-active {
    color: var(--gam-secondary, #FFB400);
    border-bottom-color: var(--gam-secondary, #FFB400);
}

/* --- PAYMENT TOGGLE (Segmented control) --- */
.gam-payment-toggle-wrapper {
    /* Hidden by default: only JS should mark it visible for UGX */
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 0;
    width: 100%;
    margin-bottom: 18px;
}

.gam-payment-toggle-wrapper.gam-toggle-visible {
    display: flex;
}

.gam-toggle {
    display: inline-flex;
    background: var(--gam-bg-light, #ffffff);
    border-radius: 999px;
    padding: 4px;
    gap: 4px;
    border: 2px solid var(--gam-border-light, #eeeeee);
}

.gam-toggle-option {
    padding: 10px 18px;
    border-radius: 999px;
    cursor: pointer;
    background: transparent;
    color: var(--gam-text-main, #323232);
    border: none;
    font-weight: 600;
    transition: all 0.15s ease;
}

.gam-toggle-option.active {
    background: var(--gam-secondary, #FFB400);
    color: #000;
    box-shadow: 0 6px 14px rgba(0,0,0,0.12);
    transform: translateY(-1px);
}

/* Make sure the toggle centers on mobile too */
@media (max-width: 640px) {
    .gam-toggle { width: 100%; justify-content: center; }
    .gam-toggle-option { flex: 1 1 auto; text-align: center; }
}

/* --- ERROR MESSAGES --- */
.gam-error-message {
    color: #c62828;
    font-size: 12px;
    margin-top: 0.5rem;
    text-align: center;
    min-height: 1rem;
}

/* --- MODAL BODY & CONTAINER --- */
#modalBody {
    position: relative;
    overflow: hidden;
    transition: height 0.3s ease-in-out;
    width: 100%;
    box-sizing: border-box;
}

.gam-modal-body {
    position: relative;
    overflow: hidden;
    width: 100%;
    box-sizing: border-box;
}

.gam-modal-container {
    position: relative;
    background-color: var(--gam-bg-light, #ffffff);
    border-radius: 24px;
    padding: 30px 30px 10px 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    color: var(--gam-text-main, #323232);
    max-width: 500px;
    width: 95%;
    margin: 0 auto;
    z-index: 100001;
    pointer-events: auto;
}

.gam-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    text-align: center;
    pointer-events: none;
}

.gam-modal-header {
    text-align: center;
    padding-top: 8px;
    padding-bottom: 4px;
    margin-bottom: 8px;
}

.gam-modal-subtitle {
    font-size: 14px;
    color: var(--gam-text-light, #646464);
    margin: 0 0 6px 0;
    font-weight: 500;
}

.gam-modal-title {
    font-size: 28px;
    text-align: center;
    margin: 0;
    color: var(--gam-text-main, #323232);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    padding-left: 16px;
    padding-right: 16px;
    margin: 0;
}

/* --- TOAST NOTIFICATIONS --- */
.gam-toast-container {
    position: fixed;
    bottom: 1.25rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 50;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
    max-width: 24rem;
    padding: 0 1rem;
    box-sizing: border-box;
}

.gam-toast {
    background-color: #fff;
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    animation: slideUp 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.gam-toast.success {
    border-left: 4px solid #4caf50;
    color: #2e7d32;
}

.gam-toast.error {
    border-left: 4px solid #c62828;
    color: #c62828;
}

.gam-toast.info {
    border-left: 4px solid #2196f3;
    color: #1565c0;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(100%);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- DARK MODE SUPPORT --- */
body.gam-dark-mode #donationModal .gam-modal-container {
    background-color: #69036b;
    color: #ffffff;
}

body.gam-dark-mode .gam-input,
body.gam-dark-mode .gam-select {
    background-color: #4a2f4a;
    color: #ffffff;
    border-color: rgba(255,255,255,0.55);
}

body.gam-dark-mode .gam-amount-btn,
body.gam-dark-mode .amount-btn {
    background-color: #4a2f4a;
    border-color: rgba(255,255,255,0.55);
    color: #ffffff;
}

body.gam-dark-mode .gam-amount-btn.selected,
body.gam-dark-mode .amount-btn.selected {
    background-color: #ffffff;
    color: #000000;
    border-color: rgba(0,0,0,0.08);
}

body.gam-dark-mode .gam-modal-title,
body.gam-dark-mode .gam-modal-header {
    color: #ffffff;
}

body.gam-dark-mode .gam-modal-subtitle {
    color: rgba(255, 255, 255, 0.7);
}

body.gam-dark-mode .gam-label {
    color: #ffffff;
}

/* Dark mode support for currency dropdown */
body.gam-dark-mode .gam-currency-current {
    background-color: #4a2f4a;
    border-color: rgba(255, 255, 255, 0.55);
    color: #ffffff;
}

body.gam-dark-mode .gam-currency-current .label {
    color: #ffffff;
}

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;
}

/* Ensure modal overlay is visible and dark behind donation modal */
#donationModal {
    z-index: 50;
}

#donationModal.gam-modal-visible .gam-modal-overlay {
    display: block;
}

/* --- RESPONSIVE DESIGN --- */
@media (max-width: 640px) {
    .gam-modal-container {
        padding: 20px;
        border-radius: 12px 12px 0 0;
        max-width: 90%;
        width: 90%;
    }

    .gam-amount-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }

    .gam-payment-tabs {
        flex-wrap: wrap;
    }

    .gam-payment-tab {
        width: 100%;
        text-align: left;
    }
}

/* Modal body padding adjustments requested */
#modalBody {
    padding-left: 10px;
    padding-right: 10px;
}

/* ========================================
   THANK YOU & FAILURE MODALS
   ======================================== */

/* Result modal container */
.gam-result-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Result modal hidden state */
.gam-result-modal.gam-modal-hidden {
    display: none !important;
}

/* Result modal visible state */
.gam-result-modal.gam-modal-visible {
    display: flex !important;
}

/* Show dark blurred overlay behind result modals (matches donation modal behavior) */
.gam-result-modal.gam-modal-visible .gam-modal-overlay {
    display: block;
}

/* Result container styling */
.gam-result-container {
    position: relative;
    background-color: var(--gam-bg-light, #ffffff);
    border-radius: 20px;
    padding: 40px 30px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
    color: var(--gam-text-main, #323232);
    max-width: 500px;
    width: 95%;
    z-index: 100001;
    pointer-events: auto;
}

/* Result icon container */
.gam-result-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    border-radius: 50%;
    font-size: 32px;
}

/* Success icon styling */
.gam-result-icon.gam-result-success {
    background-color: #e8f5e9;
    color: #2e7d32;
}

.gam-result-icon.gam-result-success svg {
    color: #2e7d32;
}

/* Error icon styling */
.gam-result-icon.gam-result-error {
    background-color: #ffebee;
    color: #c62828;
}

.gam-result-icon.gam-result-error svg {
    color: #c62828;
}

/* Result header */
.gam-result-header {
    text-align: center;
    margin-bottom: 24px;
}

.gam-result-title {
    font-size: 28px;
    font-weight: 600;
    margin: 0 0 8px 0;
    color: var(--gam-text-main, #323232);
}

.gam-result-subtitle {
    font-size: 15px;
    color: var(--gam-text-light, #646464);
    margin: 0;
    line-height: 1.4;
}

/* Result body */
.gam-result-body {
    margin-bottom: 24px;
}

/* Donation details styling */
.gam-donation-details {
    background-color: #f9f9f9;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 20px;
    border: 1px solid #eeeeee;
}

.gam-detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #eeeeee;
    font-size: 14px;
}

.gam-detail-item:last-child {
    border-bottom: none;
}

.gam-detail-label {
    font-weight: 600;
    color: var(--gam-text-main, #323232);
}

.gam-detail-value {
    color: var(--gam-secondary, #FFB400);
    font-weight: 500;
    word-break: break-word;
    text-align: right;
    max-width: 60%;
}

/* Error details styling */
.gam-error-details {
    background-color: #fff3cd;
    border-left: 4px solid #ffc107;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 20px;
}

.gam-error-code {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.gam-error-label {
    font-weight: 600;
    color: var(--gam-text-main, #323232);
    font-size: 13px;
}

.gam-error-value {
    color: #c62828;
    font-weight: 600;
    font-family: 'Courier New', monospace;
    font-size: 12px;
}

.gam-error-message-box {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.gam-error-text {
    color: var(--gam-text-main, #323232);
    font-size: 14px;
    margin: 0;
    line-height: 1.5;
    padding: 8px;
    background-color: rgba(0, 0, 0, 0.02);
    border-radius: 6px;
}

/* Troubleshooting section */
.gam-troubleshooting {
    background-color: #f5f5f5;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
}

.gam-troubleshooting-title {
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 12px 0;
    color: var(--gam-text-main, #323232);
}

.gam-troubleshooting-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.gam-troubleshooting-list li {
    font-size: 13px;
    color: var(--gam-text-main, #323232);
    padding: 6px 0;
    padding-left: 20px;
    position: relative;
    line-height: 1.4;
}

.gam-troubleshooting-list li:before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--gam-secondary, #FFB400);
    font-weight: bold;
}

/* Support text */
.gam-result-message,
.gam-support-text {
    font-size: 14px;
    color: var(--gam-text-main, #323232);
    line-height: 1.6;
    margin: 0;
    text-align: center;
}

.gam-result-message {
    margin-bottom: 16px;
}

.gam-support-text {
    background-color: #f9f9f9;
    border-radius: 8px;
    padding: 12px;
    border-left: 3px solid var(--gam-secondary, #FFB400);
}

/* Result footer */
.gam-result-footer {
    display: flex;
    gap: 12px;
}

.gam-result-footer.gam-footer-row {
    flex-direction: row;
}

.gam-btn-secondary {
    background-color: #f0f0f0;
    color: var(--gam-text-main, #323232);
    border: 2px solid #ddd;
    flex: 1;
}

.gam-btn-secondary:hover {
    background-color: #e0e0e0;
    border-color: #ccc;
    transform: translateY(-1px);
}

.gam-result-footer .gam-btn {
    flex: 1;
    padding: 12px;
    font-size: 15px;
}

.gam-result-footer .gam-btn-primary {
    width: auto;
    margin: 0;
}

/* Responsive adjustments */
@media (max-width: 640px) {
    .gam-result-container {
        padding: 30px 20px;
        max-width: 90%;
    }

    .gam-result-title {
        font-size: 24px;
    }

    .gam-result-icon {
        width: 70px;
        height: 70px;
    }

    .gam-detail-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .gam-detail-value {
        max-width: 100%;
        text-align: left;
    }

    .gam-result-footer {
        flex-direction: column;
    }

    .gam-result-footer .gam-btn {
        width: 100%;
    }
}

/* Dark mode support for result modals */
body.gam-dark-mode .gam-result-container {
    background-color: #2a2a2a;
    color: #ffffff;
}

body.gam-dark-mode .gam-result-title {
    color: #ffffff;
}

body.gam-dark-mode .gam-result-subtitle {
    color: rgba(255, 255, 255, 0.7);
}

body.gam-dark-mode .gam-donation-details,
body.gam-dark-mode .gam-troubleshooting {
    background-color: #3a3a3a;
    border-color: #4a4a4a;
}

body.gam-dark-mode .gam-detail-item,
body.gam-dark-mode .gam-error-code {
    border-bottom-color: #4a4a4a;
    color: #ffffff;
}

body.gam-dark-mode .gam-error-details {
    background-color: rgba(255, 193, 7, 0.1);
    border-left-color: #ffc107;
}

body.gam-dark-mode .gam-error-text {
    background-color: rgba(0, 0, 0, 0.3);
    color: #ffffff;
}

body.gam-dark-mode .gam-troubleshooting-title,
body.gam-dark-mode .gam-troubleshooting-list li {
    color: #ffffff;
}

body.gam-dark-mode .gam-support-text {
    background-color: rgba(0, 0, 0, 0.2);
    color: #ffffff;
}

body.gam-dark-mode .gam-btn-secondary {
    background-color: #3a3a3a;
    color: #ffffff;
    border-color: #4a4a4a;
}

body.gam-dark-mode .gam-btn-secondary:hover {
    background-color: #4a4a4a;
}
