/* Google Fonts - Brand Typography */
@import url('https://fonts.googleapis.com/css2?family=Libre+Franklin:wght@700;800;900&family=Lato:wght@400;600;700&family=Inter:wght@400;500;600;700&display=swap');

/* Saajan Rates Calculator Styles - Version A (Brand Aligned) */

/* Container - Professional & Bold */
.src-calculator {
    position: relative;
    width: 100%;
    min-width: 320px;
    max-width: 600px;
    margin: 0 auto;
    padding: 32px;
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0, 114, 188, 0.08), 0 1px 4px rgba(0, 114, 188, 0.05);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #1a1a1a;
    border: 1px solid rgba(0, 114, 188, 0.08);
}

.src-calculator * {
    box-sizing: border-box;
}

.src-calculator *,
.src-calculator *:focus,
.src-calculator *:active,
.src-calculator input,
.src-calculator input:focus,
.src-calculator input:active,
.src-calculator div:focus,
.src-calculator div:active {
    outline: none !important;
    -webkit-tap-highlight-color: transparent !important;
}

/* Loading Overlay */
.src-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.97);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    z-index: 100;
    border-radius: 20px;
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    font-weight: 500;
    color: #0072BC;
}

.src-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(0, 114, 188, 0.1);
    border-top-color: #E5A812;
    border-radius: 50%;
    animation: src-spin 0.7s linear infinite;
}

@keyframes src-spin {
    to { transform: rotate(360deg); }
}

/* Fade Loading States */
.src-loading-fade {
    opacity: 0.4;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.src-cta-button.src-loading-btn {
    background: #cccccc !important;
    cursor: not-allowed;
    pointer-events: none;
}

/* Field Container */
.src-field {
    margin-bottom: 20px;
}

/* Country Selector */
.src-country-selector {
    position: relative;
}

.src-country-display {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px !important;
    background: #ffffff;
    border: 1px solid #e8f3fc !important;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    outline: none !important;
    box-sizing: border-box !important;
    margin: 0 !important;
}

.src-country-selector.active .src-country-display {
    padding: 16px 20px !important;
    border: 1px solid #0072BC !important;
    margin: 0 !important;
}

.src-country-text {
    flex: 1;
    font-family: 'Inter', sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: #333;
}

.src-country-text strong {
    font-size: 18px;
    font-weight: 700;
    color: #0072BC;
}

.src-country-search {
    flex: 1;
    border: none !important;
    background: transparent;
    font-family: 'Inter', sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: #1a1a1a;
    outline: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
    height: auto;
    line-height: 1.2;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.src-country-search:focus,
.src-country-search:active {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.src-country-search::placeholder {
    color: #999;
    font-weight: 500;
}

.src-search-icon {
    width: 28px;
    height: 28px;
    display: none;
    flex-shrink: 0;
    color: #999;
}

.src-country-selector.active .src-search-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}


.src-dropdown-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #0072BC;
    transition: transform 0.2s ease;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.src-dropdown-arrow svg {
    width: 100%;
    height: 100%;
    display: block;
}

.src-country-selector.active .src-dropdown-arrow {
    transform: rotate(180deg);
}

/* Country Custom Dropdown Menu */
.src-country-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #ffffff;
    border: 1px solid #e8f3fc;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 114, 188, 0.08);
    max-height: 300px;
    overflow: hidden;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.src-country-selector.active .src-country-menu {
    display: block;
}

.src-country-option {
    padding: 14px 16px;
    padding-right: 40px;
    cursor: pointer;
    transition: background 0.15s ease;
    font-family: 'Inter', sans-serif;
    font-size: 18px;
    font-weight: 500;
    color: #333;
    position: relative;
    display: flex;
    align-items: center;
    gap: 16px;
}

.src-country-option:hover {
    background: #f8fbfe;
}

.src-country-option.selected {
    font-weight: 600;
    color: #0072BC;
}

.src-country-option.selected::after {
    content: '';
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    background: url('data:image/svg+xml,<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg"><circle cx="9" cy="9" r="9" fill="%230072BC"/><path d="M5 9L8 12L13 6" stroke="white" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/></svg>') no-repeat center;
    background-size: contain;
}

.src-country-option:first-child {
    border-radius: 12px 12px 0 0;
}

.src-country-option:last-child {
    border-radius: 0 0 12px 12px;
}

.src-country-divider {
    height: 1px;
    background: #e8f3fc;
    margin: 8px 0;
}

.src-select-hidden {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    z-index: -1;
}

/* Flags */
.src-flag {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    flex-shrink: 0;
    border: 1px solid #e8f3fc;
    overflow: hidden;
}

.src-flag-placeholder {
    background: #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Amounts Row - Side by Side */
.src-amounts-row {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
}

.src-amount-box {
    flex: 1;
    min-width: 0;
    background: #f8fbfe;
    border-radius: 12px;
    padding: 16px 18px !important;
    border: 1px solid transparent !important;
    transition: all 0.2s ease;
    overflow: hidden;
    outline: none !important;
    box-sizing: border-box !important;
    margin: 0 !important;
}

.src-amount-box:focus-within,
.src-amount-box:focus,
.src-amount-box:active {
    padding: 16px 18px !important;
    border: 1px solid #0072BC !important;
    background: #fff;
    margin: 0 !important;
}

.src-label {
    display: block;
    font-family: 'Lato', sans-serif;
    font-size: 15px;
    font-weight: 700;
    color: #0072BC;
    margin-bottom: 8px;
}

.src-amount-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.src-amount-input {
    flex: 1;
    border: none !important;
    background: transparent;
    font-family: 'Libre Franklin', sans-serif;
    font-size: 22px;
    font-weight: 600;
    color: #1a1a1a;
    outline: none !important;
    box-shadow: none !important;
    min-width: 0;
    max-width: 100%;
    padding: 0 !important;
    margin: 0 !important;
    height: auto;
    line-height: 1.2;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.src-amount-input:focus,
.src-amount-input:active {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.src-amount-input::placeholder {
    color: #999;
}

.src-currency-badge {
    flex-shrink: 0;
    padding: 4px 10px;
    background: rgba(0, 114, 188, 0.08);
    border-radius: 6px;
}

.src-currency-code {
    font-family: 'Lato', sans-serif;
    font-size: 13px;
    font-weight: 700;
    color: #0072BC;
}

/* Rate Banner - Using brand's Keppel color */
.src-rate-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 20px 20px;
    background: #EDFFFD;
    border-radius: 12px;
    margin-bottom: 20px;
}

.src-promo-icon {
    display: none;
}

.src-promo-icon svg {
    stroke: #1dbaa6;
    width: 22px;
    height: 22px;
}

.src-rate-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-align: center;
    align-items: center;
    width: 100%;
}

.src-promo-label {
    font-family: 'Lato', sans-serif;
    font-size: 15px;
    font-weight: 700;
    color: #1dbaa6;
}

.src-rate-value {
    font-family: 'Libre Franklin', sans-serif;
    font-size: 17px;
    font-weight: 800;
    color: #1dbaa6;
}

.src-old-rate {
    text-decoration: line-through;
    color: rgba(29, 186, 166, 0.5);
    margin-right: 6px;
    font-weight: 400;
}

/* Options Row - Stacked */
.src-options-row {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 8px;
    padding: 10px 0;
}

.src-option-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.src-option-label {
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    font-weight: 700;
    color: #666;
    white-space: nowrap;
}

.src-option-select {
    position: relative;
    flex-shrink: 0;
}

/* Custom Dropdown Styling */
.src-custom-select-wrapper {
    position: relative;
    display: inline-block;
    min-width: 180px;
}

.src-custom-select-display {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 28px 8px 0;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    user-select: none;
    outline: none;
}

.src-custom-select-text {
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    font-weight: 700;
    color: #1a1a1a;
    white-space: nowrap;
    flex: 1;
    text-align: right;
}

.src-custom-select-arrow {
    position: absolute;
    right: 0;
    top: 50%;
    margin-top: -8px;
    width: 16px;
    height: 16px;
    pointer-events: none;
    transition: transform 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.src-custom-select-wrapper.active .src-custom-select-arrow {
    transform: rotate(180deg);
}

.src-custom-select-arrow svg {
    stroke: #0072BC;
    display: block;
    width: 100%;
    height: 100%;
}

/* Custom dropdown menu */
.src-custom-select-menu {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    min-width: 220px;
    background: #ffffff;
    border: 1px solid #e8f3fc;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 114, 188, 0.08);
    max-height: 240px;
    overflow: hidden;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.src-custom-select-wrapper.active .src-custom-select-menu {
    display: block;
}

.src-custom-select-option {
    padding: 14px 16px;
    padding-right: 40px;
    cursor: pointer;
    transition: background 0.15s ease;
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    font-weight: 500;
    color: #333;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.src-custom-select-option:hover {
    background: #f8fbfe;
}

.src-custom-select-option.selected {
    font-weight: 600;
    color: #0072BC;
}

.src-custom-select-option.selected::after {
    content: '';
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    background: url('data:image/svg+xml,<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg"><circle cx="9" cy="9" r="9" fill="%230072BC"/><path d="M5 9L8 12L13 6" stroke="white" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/></svg>') no-repeat center;
    background-size: contain;
}

.src-custom-select-option:first-child {
    border-radius: 8px 8px 0 0;
}

.src-custom-select-option:last-child {
    border-radius: 0 0 8px 8px;
}

/* Hide native select */
.src-custom-select-wrapper select {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    z-index: -1;
}

/* Legacy select styling (fallback) */
.src-option-select select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background: transparent;
    border: none;
    font-family: 'Lato', sans-serif;
    font-size: 15px;
    font-weight: 700;
    color: #1a1a1a;
    padding-right: 20px;
    cursor: pointer;
    outline: none;
    text-align: right;
}

.src-option-select::after {
    content: '';
    position: absolute;
    right: -2px;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    background: url('data:image/svg+xml,<svg width="12" height="12" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M2.5 4.5L6 8L9.5 4.5" stroke="%230072BC" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/></svg>') no-repeat center;
    pointer-events: none;
}

/* Fee Row */
.src-fee-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    margin-bottom: 12px;
}

.src-fee-label {
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    font-weight: 700;
    color: #666;
}

.src-fee-value {
    font-family: 'Inter', sans-serif;
    font-size: 16px;
    font-weight: 600;
}

.src-fee-strikethrough {
    text-decoration: line-through;
    color: #9ca3af;
    margin-right: 8px;
}

.src-fee-promo {
    color: #1dbaa6;
    font-weight: 700;
}

/* Footer Row - Total and CTA */
.src-footer-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding-top: 20px;
}

.src-total-section {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.src-total-label {
    font-family: 'Lato', sans-serif;
    font-size: 15px;
    font-weight: 700;
    color: #0072BC;
}

.src-total-value {
    font-family: 'Libre Franklin', sans-serif;
    font-size: 26px;
    font-weight: 700;
    color: #1a1a1a;
}

/* CTA Button - Brand's Harvest Gold */
.src-cta-button {
    display: inline-block;
    padding: 14px 28px;
    background: #E5A812;
    color: #ffffff !important;
    font-family: 'Lato', sans-serif;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none !important;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    white-space: nowrap;
}

.src-cta-button:hover {
    background: #FFCB05;
}

.src-cta-button:active {
    background: #d4960f;
}

/* Loading State */
.src-calculator.src-loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.85);
    z-index: 50;
    border-radius: 20px;
}

.src-calculator.src-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 36px;
    height: 36px;
    margin: -18px 0 0 -18px;
    border: 4px solid rgba(0, 114, 188, 0.1);
    border-top-color: #E5A812;
    border-radius: 50%;
    animation: src-spin 0.7s linear infinite;
    z-index: 51;
}

/* Error State */
.src-error-message {
    padding: 12px 16px;
    background: #fef2f2;
    border: 2px solid #fecaca;
    border-radius: 10px;
    color: #dc2626;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 16px;
}

/* Responsive */
@media (max-width: 520px) {
    .src-calculator {
        padding: 20px;
    }

    .src-amounts-row {
        flex-direction: column;
        gap: 12px;
    }

    /* Options already stacked in desktop */

    .src-option-item {
        padding: 10px 0;
    }

    .src-footer-row {
        gap: 12px;
        padding-top: 16px;
    }

    .src-total-section {
        flex: 1;
    }

    .src-cta-button {
        padding: 14px 32px;
        font-size: 14px;
    }

    .src-amount-input {
        font-size: 22px;
    }

    .src-total-value {
        font-size: 24px;
    }
}
