* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background-color: #000;
    color: #fff;
}
.container {
    margin: 0;
    text-align: center;
    width: 100%;
    max-width: 600px;
    padding: 20px;
}
h1 { text-align: center; }
.price-section {text-align: center;padding: 15px;}
.uusd-price { font-size: 16px; margin: 0; }
#uusdPrice { font-weight: 600; font-size: 18px; }
.wallet-section {text-align: center;}
.wallet-address { font-family: monospace; font-size: 14px; }
button {border: none;padding: 12px 24px;font-size: 16px;cursor: pointer;transition: background 0.3s;box-shadow: 0 0 96px #ffffff40;border-radius: 6px;color: #fff;background-color: transparent;/* margin: 20px auto; */}
button:hover {box-shadow: inset 0 0 96px #ffffff40;}
button:disabled { cursor: not-allowed; }
.tabs {display: flex;margin-bottom: 15px;}
.tab { flex: 1; padding: 15px; text-align: center; cursor: pointer; background: none; border: none; font-size: 18px; }
.tab.active { box-shadow: inset 0 0 96px #ffffff40;}
.tab-content { display: none; }
.tab-content.active { display: block; }
.form-group {margin: 20px auto;}
label {/* display: block; */margin: 8px;font-weight: 600;}
input, select {padding: 10px;border: 1px solid #ddd;border-radius: 6px;font-size: 16px;background-color: transparent;border-color: transparent;box-shadow: 0 0 96px #ffffff40;color: #fff; }
input:focus, select:focus { outline: none; }
.output-section { margin-top: 20px; padding: 20px; border-radius: 8px; }
.output-row { display: flex; justify-content: space-between; margin-bottom: 10px; }
.output-label { }
.output-value { font-weight: 600; }
.action-button {width: 100%;/* margin-top: 20px; */padding: 15px;font-size: 18px;}
.error { margin-top: 10px; padding: 10px; border-radius: 6px; display: none;

        text-align: left;
    white-space: pre;
    font-family: monospace;
    color: #ff4040;
    overflow:scroll;
}
.success { margin-top: 10px; padding: 10px; border-radius: 6px; display: none; }
.loading { display: inline-block; width: 16px; height: 16px; border: 2px solid #f3f3f3; border-top: 2px solid #3498db; border-radius: 50%; animation: spin 1s linear infinite; margin-left: 8px; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
.info-text { font-size: 14px; margin-top: 5px; }
#background{position:fixed;top:0;left:0;width:100%;height:100%;z-index:-1;background-size:cover;background-position:center center;}
#dollar-logo {
    width: 100vw;
    height: 100vh;
    fill: #ffffff20;
    /* filter: blur(8px); */
    -webkit-mask: radial-gradient(circle,
    #00000000 0%,
    /* #00000000 25%,  */
    #000000FF 100%
    );
    mask: radial-gradient(circle,
    #00000000 0%,
    /* #00000000 25%,  */
    #000000FF 100%
    );
}

input,button,select {
 backdrop-filter:blur(8px);
}

/* CSS Chart Background with Grid Lines and Labels */
#sparkline-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -2;
    overflow: hidden;
}

/* Horizontal Grid Lines - $0.99 and $1.01 levels */
#sparkline-background::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        /* $1.01 line (top) */
        linear-gradient(to right, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.1) 100%),
        /* $1.00 line (middle) */
        linear-gradient(to right, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.15) 100%),
        /* $0.99 line (bottom) */
        linear-gradient(to right, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.1) 100%);
    background-size:
        100% 1px,
        100% 1px,
        100% 1px;
    background-position:
        0% 20%,   /* $1.01 */
        0% 50%,   /* $1.00 */
        0% 80%;   /* $0.99 */
    background-repeat: no-repeat;
}

/* Vertical Grid Lines - Date markers */
#sparkline-background::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        repeating-linear-gradient(
            to right,
            transparent 0%,
            transparent calc(14.28% - 1px),
            rgba(255, 255, 255, 0.05) 14.28%,
            rgba(255, 255, 255, 0.05) calc(14.28% + 1px),
            transparent calc(14.28% + 1px)
        );
}

/* Price Chart Line - Dynamic data will be applied via JavaScript */
.sparkline-chart {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        /* to right, */
        /* #00FFFF08 0%, */
        #00FFFF20 0%,
        #00FFFF00 100%
    );

    /* Default: hide until real data loads */
    clip-path: polygon(0% 100%, 0% 100%, 0% 100%);
    opacity: 0;
    transition: opacity 1s ease-in-out;
}

.sparkline-stroke {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.1);
    /* Default: hide until real data loads */
    clip-path: polygon(0% 100%, 0% 100%, 0% 100%);
    opacity: 0;
    transition: opacity 1s ease-in-out;
}

.sparkline-chart.ready,
.sparkline-stroke.ready {
    opacity: 1;
}

/* Chart Labels */
.chart-labels {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    font-family: monospace;
    font-size: 10px;
    color: rgba(255, 255, 255, 0.4);
}

/* Price Labels */
.price-label-high {
    position: absolute;
    left: 10px;
    top: 18%;
    content: '$1.01';
}

.price-label-mid {
    position: absolute;
    left: 10px;
    top: 48%;
    content: '$1.00';
}

.price-label-low {
    position: absolute;
    left: 10px;
    top: 78%;
    content: '$0.99';
}

/* Date Labels */
.date-labels {
    position: absolute;
    bottom: 100px;
    width: 100%;
    display: flex;
    justify-content: space-around;
    padding: 0 20px;
}

.date-label {
    font-size: 9px;
    opacity: 0.4;
}

/* Add the chart elements to the background */
#sparkline-background .sparkline-chart,
#sparkline-background .sparkline-stroke,
#sparkline-background .chart-labels {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Price Trend Styles */
.price-section {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

/* Price trend indicators */
.price-up {
    color: #00ff88 !important;
}

.price-down {
    color: #ff4757 !important;
}

.price-flat {
    color: #ffa502 !important;
}

.price-change {
    font-weight: 500;
    opacity: 0.8;
}

.price-change.price-up {
    color: #00ff88;
}

.price-change.price-down {
    color: #ff4757;
}

.price-change.price-flat {
    color: #ffa502;
}

/* Sparkline tooltip styles */
.sparkline-tooltip {
    background: rgba(0, 0, 0, 0.9) !important;
    color: white !important;
    padding: 8px 12px !important;
    border-radius: 6px !important;
    font-size: 12px !important;
    line-height: 1.4 !important;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Inventory Bar Styles */
.inventory-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    /* background-color: transparent; */
    /* backdrop-filter: blur(8px); */
    /* box-shadow: 0 0 96px #ffffff40; */
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 16px 20px;
    z-index: 1000;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.inventory-bar.disconnected {
    opacity: 0.6;
}

.inventory-bar.connected {
    opacity: 1;
}

.inventory-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.inventory-header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    min-width: 140px;
}

.inventory-title {
    font-size: 14px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.total-value {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    font-family: monospace;
}

.inventory-tokens {
    display: flex;
    align-items: center;
    gap: 24px;
    flex: 1;
    justify-content: right;
}

.token-balance {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    /* border: 1px solid rgba(255, 255, 255, 0.1); */
    backdrop-filter: blur(4px);
    transition: all 0.3s ease;
    /* width: 100%; */
    flex-shrink: 0;
}

.token-balance:hover {
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
}

.token-balance.zero-balance {
    opacity: 0.5;
}

.token-info {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
}

.token-info>div{
        font-size: 12px;
        font-weight: 600;
        /* color: #fff; */
        font-family: monospace;
}

.token-symbol {
    /* font-size: 16px; */
    /* font-weight: 600; */
    color: rgba(255, 255, 255, 0.7);
    /* text-transform: uppercase; */
    /* letter-spacing: 0.5px; */
    /* font-family: monospace; */
}

.token-amount {
    /* font-size: 16px; */
    /* font-weight: 600; */
    color: #fff;
    /* font-family: monospace; */
}

.token-usd-value::before {
    content: '(';
}
.token-usd-value::after {
    content: ')';
}
.token-usd-value {
    /* display: inline-flex; */
    /* font-size: 11px; */
    color: rgba(255, 255, 255, 0.6);
    /* font-family: monospace; */
    /* margin-top: 2px; */
    /* font-size: 16px; */
    /* font-weight: 600; */
    /* color: #fff; */
    /* font-family: monospace; */
}

/* Loading states */
.loading-message {
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
}

.loading-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-top: 2px solid rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Message states */
.disconnected-message,
.no-balances-message,
.error-message {
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
    text-align: center;
    padding: 12px 20px;
}

.error-message {
    color: #ff4757;
    display: flex;
    align-items: center;
    gap: 12px;
}

.retry-button {
    padding: 6px 12px;
    font-size: 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.retry-button:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Responsive design */
@media (max-width: 768px) {
    .inventory-content {
        flex-direction: column;
        gap: 12px;
    }

    .inventory-header {
        align-items: center;
        text-align: center;
        display: none;
    }

    .inventory-tokens {
        gap: 16px;
        justify-content: space-around;
        width: 100%;
    }

    .token-balance {
        min-width: 80px;
        padding: 10px 12px;
    }

    .token-amount {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .inventory-bar {
        padding: 12px 16px;
    }

    .inventory-tokens {
        gap: 12px;
    }

    .token-balance {
        min-width: 70px;
        padding: 8px 10px;
    }

    .token-symbol {
        font-size: 11px;
    }

    .token-amount {
        font-size: 13px;
    }

    .token-usd-value {
        font-size: 10px;
    }
}

.twap-warning {
    color: #ffc107;
    background-color: #332c1e;
    border: 1px solid #ffc107;
    border-radius: 8px;
    padding: 10px;
    margin-top: 15px;
    text-align: center;
}

.tooltip {
    position: relative;
    display: inline-block;
    cursor: pointer;
}

.tooltip .tooltip-icon {
    width: 16px;
    height: 16px;
    vertical-align: middle;
    margin-left: 4px;
}

.tooltip .tooltip-text {
    visibility: hidden;
    width: 220px;
    background-color: #333;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 5px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -110px;
    opacity: 0;
    transition: opacity 0.3s;
}

.tooltip:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}
hr{border: 0.5px solid #ffffff40;margin-bottom: 10px;margin-left: 8px;margin: 20px 10px;}

.token-symbol svg{
    width: 16px;
    height: 16px;
    vertical-align: middle;
    margin-right: 4px;
}

/* Direction Toggle Styles */
.direction-toggle {
    display: flex;
    margin-bottom: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 4px;
    backdrop-filter: blur(8px);
}

.direction-button {
    flex: 1;
    padding: 12px 20px;
    background: transparent;
    color: rgba(255, 255, 255, 0.7);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 16px;
    font-weight: 500;
}

.direction-button.active {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.2);
}

.direction-button:hover:not(.active) {
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.9);
}

/* Unified Exchange Form Styles */
.exchange-form {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 16px;
    padding: 24px;
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Route Display Styles */
.route-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.route-action {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

.route-action span:first-child {
    font-size: 18px;
    font-weight: 600;
    color: #fff;
}

.market-price {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    font-family: monospace;
}

.savings-positive {
    background: rgba(0, 255, 136, 0.1);
    color: #00ff88;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid rgba(0, 255, 136, 0.2);
}

.main-output {
    background: rgba(255, 255, 255, 0.03);
    padding: 16px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 16px;
}

.main-output .output-label {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
}

.main-output .output-value {
    color: #fff;
    font-size: 18px;
    font-weight: 700;
    font-family: monospace;
}

.route-explanation {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    padding: 12px;
    border-left: 3px solid rgba(0, 123, 255, 0.5);
}

.route-reason {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.4;
}

.route-warning {
    background: rgba(255, 193, 7, 0.1);
    color: #ffc107;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid rgba(255, 193, 7, 0.3);
    font-size: 14px;
    text-align: center;
    margin-top: 12px;
}

/* Notification Container */
.notification-container {
    margin-top: 16px;
}

.notification-container .error,
.notification-container .success {
    display: block;
    margin-top: 12px;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.4;
}

.notification-container .error {
    background: rgba(255, 71, 87, 0.1);
    color: #ff4757;
    border: 1px solid rgba(255, 71, 87, 0.3);
}

.notification-container .success {
    background: rgba(0, 255, 136, 0.1);
    color: #00ff88;
    border: 1px solid rgba(0, 255, 136, 0.3);
}

/* Hide old tab styles when using unified interface */
.tabs {
    display: none !important;
}

.tab-content {
    display: none !important;
}

/* Responsive adjustments for unified interface */
@media (max-width: 768px) {
    .exchange-form {
        padding: 20px;
    }

    .route-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .direction-toggle {
        margin-bottom: 16px;
    }

    .direction-button {
        padding: 10px 16px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .exchange-form {
        padding: 16px;
        margin: 0 -4px;
    }

    .main-output .output-value {
        font-size: 16px;
    }

    .route-action span:first-child {
        font-size: 16px;
    }
}

/* Mint Options Styling */
.checkbox-group {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #007bff;
    cursor: pointer;
}

.checkbox-group label {
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    cursor: pointer;
    margin: 0;
}

/* Simplified Exchange Component Styles */
.route-type {
    font-size: 14px;
    color: #888;
    margin-bottom: 8px;
    display: block;
}

.output-row.main-output {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 16px 0;
    font-size: 18px;
}

.option-explanation {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 6px;
    padding: 12px;
    border-left: 3px solid rgba(0, 123, 255, 0.3);
}

.explanation-text {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.4;
}


button#connectWallet {
    margin: 20px auto;
}
