:root {
    --primary-yellow: #FFD54F;
    /* Lighter Amber */
    --primary-yellow-dark: #FFCA28;
    --accent-color: #3E2723;
    /* Dark brown for text/contrast */
    --bg-color: #FFF8E1;
    /* Very light yellow cream */
    --card-bg: #FFFFFF;
    --text-color: #333333;
    --text-muted: #757575;
    --font-family: 'Outfit', sans-serif;
    --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 12px 32px rgba(0, 0, 0, 0.1);
    --radius-lg: 24px;
    --radius-md: 16px;
    --radius-sm: 12px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font-family);
    background-color: #F0F2F5;
    /* Desktop background */
    color: var(--text-color);
    display: flex;
    justify-content: center;
    min-height: 100vh;
    padding: 0;
    /* Remove padding to let app-container touch edges on mobile if needed, or keep for desktop centering */
    align-items: flex-start;
}

.app-container {
    width: 100%;
    max-width: 420px;
    /* Standard mobile width */
    min-height: 100vh;
    background-color: var(--bg-color);
    /* App background */
    display: flex;
    flex-direction: column;
    gap: 20px;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.1);
    /* Shadow to separate from desktop bg */
    position: relative;
    padding: 0 0 20px 0;
    /* Remove side padding so header touches edges */
    padding-top: 0;
    /* Header is sticky at top */
}

main {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-bottom: 20px;
    /* Ensure space at bottom */
}

header {
    text-align: center;
    padding-bottom: 0px;
}

header h1 {
    font-size: 26px;
    font-weight: 700;
    color: var(--accent-color);
    letter-spacing: -0.5px;
    margin-bottom: 8px;
}

.section-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--accent-color);
    margin-bottom: 12px;
    text-align: center;
}

/* Single Card Layout */
.main-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
    gap: 24px;
    /* Space between sections */
    margin: 0 20px;
    /* Restore side margin for content */
}

.section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Toggle Selector */
.toggle-container {
    display: flex;
    background-color: #F8F8F8;
    border-radius: var(--radius-md);
    padding: 4px;
    position: relative;
    gap: 4px;
    border: 1px solid #EEEEEE;
}

.toggle-btn {
    flex: 1;
    border: none;
    background: transparent;
    padding: 14px 8px;
    border-radius: var(--radius-sm);
    font-family: var(--font-family);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.toggle-btn.active {
    background-color: var(--primary-yellow);
    color: var(--accent-color);
    box-shadow: 0 2px 8px rgba(255, 213, 79, 0.3);
}

.arrow {
    font-size: 14px;
    opacity: 0.7;
}

/* Inputs & Labels */
.input-label {
    display: block;
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-left: 4px;
    /* Align with input text start */
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

input[type="number"] {
    width: 100%;
    border: 2px solid #F0F0F0;
    border-radius: var(--radius-md);
    padding: 16px 16px 16px 16px;
    font-size: 22px;
    font-weight: 700;
    font-family: var(--font-family);
    color: var(--accent-color);
    outline: none;
    transition: all 0.2s;
    background: #FAFAFA;
}

input[type="text"] {
    width: 100%;
    border: 2px solid #F0F0F0;
    border-radius: var(--radius-md);
    padding: 16px;
    font-size: 16px;
    /* Smaller than money input */
    font-weight: 500;
    /* Less bold */
    font-family: var(--font-family);
    color: var(--accent-color);
    outline: none;
    transition: all 0.2s;
    background: #FAFAFA;
}

/* Specific padding for inputs with currency symbol */
.input-wrapper input[type="number"] {
    padding-right: 60px;
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

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

input[type="number"]:focus,
input[type="text"]:focus {
    border-color: var(--primary-yellow);
    background: #FFFFFF;
}

/* Fix MMK currency overlap */
.currency {
    position: absolute;
    right: 16px;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-muted);
    pointer-events: none;
    background-color: transparent;
}

/* Result Display */
.result-display {
    background-color: #FFFDF5;
    border: 2px solid #FFE082;
    /* Slightly darker than bg to show border */
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 62px;
    /* Match input height roughly */
    position: relative;
}

.result-display span#receive-amount {
    font-size: 24px;
    font-weight: 700;
    color: var(--accent-color);
    word-break: break-all;
    margin-right: 40px;
    /* Ensure space for currency */
    display: block;
    width: 100%;
}

.currency-static {
    position: absolute;
    /* Fix position like input */
    right: 16px;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-muted);
}

/* Checkbox */
.checkbox-section {
    padding: 4px 0;
}

.custom-checkbox {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
    padding: 4px;
}

.custom-checkbox input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    height: 22px;
    width: 22px;
    min-width: 22px;
    /* Prevent shrinking */
    background-color: #F8F8F8;
    border-radius: 6px;
    margin-right: 12px;
    position: relative;
    border: 2px solid #DDD;
    transition: all 0.2s;
}

.custom-checkbox:hover input~.checkmark {
    background-color: #F0F0F0;
}

.custom-checkbox input:checked~.checkmark {
    background-color: var(--primary-yellow);
    border-color: var(--primary-yellow);
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

.custom-checkbox input:checked~.checkmark:after {
    display: block;
}

.custom-checkbox .checkmark:after {
    left: 7px;
    top: 3px;
    width: 5px;
    height: 10px;
    border: solid var(--accent-color);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.label-text {
    font-size: 15px;
    color: var(--text-color);
    font-weight: 500;
    line-height: 1.4;
}

/* Button */
.confirm-btn {
    width: 100%;
    padding: 20px;
    background-color: var(--accent-color);
    color: var(--primary-yellow);
    border: none;
    border-radius: var(--radius-md);
    font-size: 16px;
    font-weight: 700;
    font-family: var(--font-family);
    cursor: pointer;
    transition: transform 0.1s, box-shadow 0.2s, background-color 0.2s;
    box-shadow: 0 4px 12px rgba(62, 39, 35, 0.2);
    margin-top: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.confirm-btn:active {
    transform: scale(0.98);
}

.confirm-btn:hover {
    box-shadow: 0 6px 16px rgba(62, 39, 35, 0.3);
    background-color: #2D1B18;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.main-card {
    animation: fadeIn 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

@media (max-width: 360px) {
    .app-container {
        padding: 0;
    }

    body {
        padding: 10px;
    }
}

/* Top Toolbar */
.top-toolbar {
    display: flex;
    justify-content: space-between;
    /* Center title since icons are removed/hidden? Or just remove icons in HTML */
    align-items: center;
    padding: 16px;
    min-height: 64px;
    margin-bottom: 0;
    /* Remove margin, let content flow */
    position: sticky;
    /* Sticky stays within parent width */
    top: 0;
    /* width: 100%; removed to fit container */
    background-color: rgba(255, 213, 79, 0.95);
    /* Transparent Yellow-ish */
    z-index: 10;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    /* Slight shadow */
}

/* Adjust body padding now that header is in flow */
body {
    padding-top: 0;
    /* No body padding needed, container handles it */
    padding-bottom: 20px;
}

.top-toolbar h1 {
    font-size: 20px;
    margin: 0;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--accent-color);
    font-weight: 700;
}

.icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-color);
    transition: background-color 0.2s;
    width: 40px;
    height: 40px;
    text-decoration: none;
    /* For links */
}

.icon-btn:hover {
    background-color: rgba(62, 39, 35, 0.05);
}

.back-btn {
    position: absolute;
    left: 20px;
    /* Align with content margin */
    top: 50%;
    transform: translateY(-50%);
    background-color: #FFFFFF !important;
    /* Force white background */
    border-radius: 12px;
    /* Rounded corners */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.icon-btn svg {
    width: 24px;
    height: 24px;
    stroke: currentColor;
}

/* Info Rows for Transfer Page */
.info-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
    background-color: #FAFAFA;
    border-radius: var(--radius-md);
    padding: 20px;
    border: 1px solid #F0F0F0;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px dashed #E0E0E0;
    padding-bottom: 12px;
}

.info-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
    padding-top: 4px;
}

.info-label {
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 500;
}

.info-value {
    font-size: 16px;
    color: var(--accent-color);
    font-weight: 700;
    text-align: right;
}

.info-row.highlight .info-value {
    font-size: 20px;
    color: #2E7D32;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    /* Dimmed background */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.loading-overlay.visible {
    opacity: 1;
    pointer-events: all;
}

.success-message {
    text-align: center;
    color: var(--text-color);
    margin-bottom: 16px;
    font-size: 15px;
    line-height: 1.5;
    padding: 0 10px;
}

.loading-content {
    background-color: #FFFFFF;
    padding: 30px;
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    width: 80%;
    max-width: 300px;
    text-align: center;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #F0F0F0;
    border-top: 4px solid var(--primary-yellow-dark);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

.loading-text {
    font-size: 16px;
    font-weight: 600;
    color: var(--accent-color);
    line-height: 1.4;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.warning-text {
    text-align: center;
    color: #D32F2F;
    /* Red warning color */
    font-weight: 500;
    margin-bottom: 20px;
    font-size: 14px;
    line-height: 1.5;
}

.exchange-text {
    text-align: center;
    font-size: 14px;
    color: #D32F2F;
    font-weight: 500;
    margin-top: 12px;
}

/* Swap Icon Decoration */
.swap-icon-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: -12px 0;
    /*  Overlap slightly or pull close */
    position: relative;
    z-index: 5;
    pointer-events: none;
    /* Just decoration */
}

.swap-icon {
    background-color: #FFFFFF;
    border: 1px solid #EEEEEE;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--primary-yellow-dark);
    /* Or accent color */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.swap-icon svg {
    width: 20px;
    height: 20px;
}

.fee-hint {
    color: #D32F2F;
    font-size: 13px;
    font-weight: 500;
    margin-left: 4px;
}

/* Copy Button */
.copy-btn {
    background: rgba(255, 213, 79, 0.2);
    /* Soft Yellow */
    border: 1px solid rgba(255, 213, 79, 0.3);
    cursor: pointer;
    padding: 8px;
    border-radius: 10px;
    /* Softer corners */
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-color);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.copy-btn:hover {
    background: var(--primary-yellow);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 213, 79, 0.4);
    border-color: var(--primary-yellow);
}

/* Readonly Input Style */
input[readonly] {
    background-color: #F8F8F8;
    color: var(--text-color);
    cursor: default;
    border-color: #E0E0E0;
}

input[readonly]:focus {
    /* No focus highlight */
    background-color: #F8F8F8;
}

/* Decorative Warning Icon */
.warning-icon {
    width: 64px;
    height: 64px;
    background-color: #FFEBEE;
    /* Light Red */
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
    color: #D32F2F;
    position: relative;
    box-shadow: 0 0 0 8px rgba(244, 67, 54, 0.1);
    /* Outer glow ring */
    animation: popIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
    from {
        transform: scale(0.5);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.thank-you-msg {
    text-align: center;
    margin-top: 30px;
    margin-bottom: 8px;
    font-size: 14px;
    color: #D32F2F;
    /* Red as requested */
    font-weight: 500;
    opacity: 0;
    animation: fadeIn 0.8s ease-out 0.5s forwards;
    background: linear-gradient(to right, transparent, rgba(211, 47, 47, 0.1), transparent);
    padding: 8px 0;
    border-radius: 8px;
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

/* Transfer Warning Box */
.transfer-warning-box {
    background-color: #FAFAFA;
    border: 1px solid #EEEEEE;
    border-radius: 12px;
    padding: 16px;
    margin-top: 24px;
    margin-bottom: 24px;
}

.warning-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.warning-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: #333;
}

.warning-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.warning-list li {
    font-size: 13px;
    color: #666;
    margin-bottom: 10px;
    padding-left: 18px;
    position: relative;
    line-height: 1.5;
    text-align: left;
}

.warning-list li::before {
    content: "◆";
    color: #D32F2F;
    position: absolute;
    left: 0;
    top: 2px;
    font-size: 8px;
}

/* Support Button */
.support-btn {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    background-color: transparent !important;
    border: none;
    box-shadow: none;
    z-index: 10;
    cursor: pointer;
}

/* Modal specific for support */
.support-modal-content {
    background-color: #FFFFFF;
    padding: 24px;
    border-radius: 20px;
    width: 85%;
    max-width: 320px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    text-align: center;
}

.support-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.support-option-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px;
    border-radius: 12px;
    font-weight: 600;
    font-family: var(--font-family);
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    border: 1px solid #F0F0F0;
    background-color: #FAFAFA;
    color: var(--accent-color);
}

.support-option-btn:active {
    transform: scale(0.98);
}

.support-telegram {
    background-color: #E3F2FD;
    color: #1976D2;
    border: none;
}

.support-phone {
    background-color: #F1F8E9;
    color: #2E7D32;
    border: none;
}

.support-close-btn {
    background: transparent;
    border: none;
    font-size: 14px;
    color: #999;
    margin-top: 8px;
    cursor: pointer;
    text-decoration: underline;
}