* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica', 'Arial', sans-serif;
    background: linear-gradient(180deg, #1a1b3d 0%, #27273f 50%, #1f2029 100%);
    color: #ffffff;
    min-height: 100vh;
}

/* Navigation */
.navbar {
    background: rgba(26, 27, 61, 0.98);
    backdrop-filter: blur(10px);
    padding: 0.8rem 1rem;
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 600px;
    margin: 0 auto;
}

.nav-left .logo svg {
    width: 32px;
    height: 32px;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.settings-btn,
.icon-btn {
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.4rem;
    border-radius: 8px;
    transition: background 0.2s;
}

.settings-btn:hover,
.icon-btn:hover {
    background: rgba(255, 255, 255, 0.05);
}

.icon-btn.dropdown {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.4rem 0.6rem;
    background: rgba(255, 255, 255, 0.05);
}

.icon-btn.dropdown svg {
    width: 18px;
    height: 18px;
}

.icon-btn.dropdown span {
    font-size: 0.7rem;
}

.connect-wallet {
    background: linear-gradient(135deg, #1fc7d4 0%, #0098a6 100%);
    color: #ffffff;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: transform 0.2s;
}

.connect-wallet:hover {
    transform: scale(1.05);
}

/* Swap Container */
.swap-container {
    max-width: 600px;
    margin: 1rem auto;
    padding: 0 1rem;
}

/* Swap Tabs */
.swap-tabs {
    display: flex;
    gap: 0.5rem;
    background: rgba(39, 39, 63, 0.6);
    padding: 0.5rem;
    border-radius: 20px;
    margin-bottom: 1rem;
}

.tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: #a0a0c0;
    padding: 0.8rem 1rem;
    border-radius: 16px;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s;
}

.tab-btn.active {
    background: rgba(180, 167, 230, 0.3);
    color: #ffffff;
}

.tab-btn.icon-only {
    flex: 0 0 auto;
    width: 50px;
    padding: 0.8rem;
}

/* Swap Card */
.swap-card {
    background: rgba(45, 46, 70, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

/* Swap Section */
.swap-section {
    margin-bottom: 1rem;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    font-size: 0.8rem;
}

.label {
    color: #a0a0c0;
    font-weight: 600;
}

.address {
    color: #ffffff;
    font-weight: 600;
}

.copy-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    padding: 0.2rem;
}

.balance {
    margin-left: auto;
    color: #ffffff !important;
    font-weight: 700;
    -webkit-text-fill-color: #ffffff !important;
}

/* Ensure balance text stays white on all devices */
.section-header .balance {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    text-decoration: none !important;
}

/* Override any browser default link/text colors */
span.balance {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

/* Token Input Wrapper */
.token-input-wrapper {
    background: rgba(52, 53, 80, 0.8);
    border-radius: 16px;
    padding: 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.token-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    flex-shrink: 0;
}

.token-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.token-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.8rem;
}

.token-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.token-name {
    font-weight: 800;
    font-size: 1rem;
    color: #ffffff;
}

.token-bottom-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.token-network {
    font-size: 0.75rem;
    color: #a0a0c0;
    font-weight: 500;
}

.dropdown-icon {
    font-size: 0.7rem;
    color: #a0a0c0;
    margin-left: 0.3rem;
}

.amount-input {
    background: transparent;
    border: none;
    outline: none;
    color: #ffffff !important;
    font-size: 1.5rem;
    font-weight: 800;
    text-align: right;
    flex: 1;
    min-width: 0;
    max-width: 100%;
    -webkit-text-fill-color: #ffffff !important;
}

/* Prevent any blue color on focus or selection */
.amount-input:focus,
.amount-input:active,
.amount-input::selection {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

.amount-input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.usd-value {
    font-size: 0.85rem;
    color: #a0a0c0;
    font-weight: 600;
}

/* Swap Arrow */
.swap-arrow-container {
    display: flex;
    justify-content: center;
    margin: 0.5rem 0;
}

.swap-arrow-btn {
    background: rgba(31, 199, 212, 0.2);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #1fc7d4;
    transition: background 0.2s;
}

.swap-arrow-btn:hover {
    background: rgba(31, 199, 212, 0.3);
}

/* Slippage Section */
.slippage-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    margin-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.slippage-label {
    color: #a0a0c0;
    font-size: 0.9rem;
    font-weight: 600;
}

.slippage-value {
    background: transparent;
    border: none;
    color: #ff8c42;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    transition: background 0.2s;
}

.slippage-value:hover {
    background: rgba(255, 140, 66, 0.1);
}

.warning-icon {
    font-size: 1rem;
}

.edit-icon {
    font-size: 0.8rem;
}

/* Swap Button */
.swap-btn {
    width: 100%;
    background: linear-gradient(135deg, #1fc7d4 0%, #0098a6 100%);
    color: #000000;
    border: none;
    padding: 1.2rem;
    border-radius: 16px;
    font-size: 1.1rem;
    font-weight: 800;
    cursor: pointer;
    margin-top: 1rem;
    transition: transform 0.2s;
}

.swap-btn:hover {
    transform: scale(1.02);
}

/* Swap Info */
.swap-info {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.swap-rate,
.fee-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0;
    font-size: 0.85rem;
    color: #ffffff;
    font-weight: 600;
}

.refresh-icon {
    font-size: 1rem;
    cursor: pointer;
}

.arrow {
    color: #1fc7d4;
}

.fee-info {
    color: #a0a0c0;
    justify-content: space-between;
}

.fee-info span:nth-child(2) {
    flex: 1;
    text-align: right;
    color: #ffffff;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 80%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    z-index: 2000;
    align-items: flex-end;
    justify-content: center;
    padding: 0;
}

.modal-content {
    background: linear-gradient(180deg, #2d2e46 0%, #1f2029 100%);
    border-radius: 24px 24px 0 0;
    padding: 1.5rem;
    max-width: 600px;
    width: 100%;
    height: 100%;
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-header h2 {
    font-size: 1.3rem;
    font-weight: 800;
    color: #ffffff;
}

.close-btn {
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    line-height: 1;
    transition: color 0.2s;
}

.close-btn:hover {
    color: #1fc7d4;
}

.swap-amounts {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

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

.amount {
    font-size: 1.8rem;
    font-weight: 800;
    color: #ffffff;
}

.token-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.05);
    padding: 0.5rem 1rem;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1rem;
}

.token-badge img {
    border-radius: 50%;
}

.arrow-down {
    text-align: center;
    font-size: 1.5rem;
    color: #a0a0c0;
    margin: 1rem 0;
}

.swap-details {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 16px;
    padding: 1.2rem;
    margin-bottom: 1.5rem;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 0;
}

.detail-row:not(:last-child) {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.detail-label {
    color: #a0a0c0;
    font-size: 0.9rem;
    font-weight: 600;
}

.detail-value {
    color: #ffffff;
    font-weight: 700;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.detail-value.green {
    color: #00d4aa;
}

.detail-value.orange {
    color: #ff8c42;
}

.detail-value .refresh {
    color: #1fc7d4;
    cursor: pointer;
    font-size: 1rem;
}

.confirm-swap-btn {
    width: 100%;
    background: linear-gradient(135deg, #1fc7d4 0%, #0098a6 100%);
    color: #000000;
    border: none;
    padding: 1.2rem;
    border-radius: 16px;
    font-size: 1.1rem;
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.2s;
}

.confirm-swap-btn:hover {
    transform: scale(1.02);
}

/* Gas Modal Styles */
.gas-modal {
    max-width: 500px;
}

.gas-message {
    color: #a0a0c0;
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.gas-info {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 1.2rem;
    margin-bottom: 1.5rem;
}

.gas-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.gas-label {
    color: #a0a0c0;
    font-size: 0.95rem;
    font-weight: 600;
}

.gas-value {
    color: #ffffff;
    font-size: 0.95rem;
    font-weight: 700;
}

.gas-station-btn {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: rgba(180, 167, 230, 0.15);
    padding: 1.2rem;
    border-radius: 16px;
    text-decoration: none;
    transition: background 0.2s;
    border: 1px solid rgba(180, 167, 230, 0.2);
}

.gas-station-btn:hover {
    background: rgba(180, 167, 230, 0.25);
}

.gas-icon {
    font-size: 2rem;
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gas-text {
    flex: 1;
}

.gas-title {
    color: #ffffff;
    font-weight: 700;
    font-size: 1.05rem;
    margin-bottom: 0.3rem;
}

.gas-subtitle {
    color: #a0a0c0;
    font-size: 0.9rem;
}

.arrow-right {
    color: #a0a0c0;
    font-size: 2rem;
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(26, 27, 61, 0.98);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: space-around;
    padding: 0.5rem 0;
    z-index: 1000;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    color: #a0a0c0;
    text-decoration: none;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.5rem 0.8rem;
    transition: color 0.2s;
}

.nav-item:hover {
    color: #ffffff;
}

.nav-icon {
    font-size: 1.2rem;
}

/* Footer */
.footer {
    background: rgba(26, 27, 61, 0.95);
    padding: 3rem 2rem 2rem;
    margin-top: 4rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-container {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-column h4 {
    font-size: 0.9rem;
    margin-bottom: 1rem;
    color: #a0a0c0;
    font-weight: 600;
}

.footer-column ul {
    list-style: none;
}

.footer-column ul li {
    margin-bottom: 0.7rem;
}

.footer-column ul li a {
    color: #ffffff;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s;
}

.footer-column ul li a:hover {
    color: #1fc7d4;
}

.footer-logo svg {
    width: 120px;
    height: auto;
}

.footer-bottom {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-social {
    display: flex;
    gap: 1rem;
}

.footer-social a {
    color: #a0a0c0;
    text-decoration: none;
    font-size: 1.2rem;
    transition: color 0.3s;
}

.footer-social a:hover {
    color: #ffffff;
}

.footer-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.price-display {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.05);
    padding: 0.5rem 1rem;
    border-radius: 12px;
}

.cake-icon {
    font-size: 1.2rem;
}

.buy-cake-btn {
    background: linear-gradient(135deg, #1fc7d4 0%, #0098a6 100%);
    color: #ffffff;
    border: none;
    padding: 0.7rem 1.5rem;
    border-radius: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s;
}

.buy-cake-btn:hover {
    transform: scale(1.05);
}

/* Responsive */
@media (max-width: 768px) {
    body {
        padding-bottom: 70px;
    }

    .swap-container {
        padding: 0 0.8rem;
    }

    .swap-card {
        padding: 1.2rem;
    }

    .token-input-wrapper {
        gap: 0.6rem;
        padding: 1rem;
    }

    .token-row {
        gap: 0.5rem;
    }

    .amount-input {
        font-size: 1.1rem;
        width: 100%;
    }

    .token-name {
        font-size: 0.9rem;
    }

    .usd-value {
        font-size: 0.75rem;
    }

    .footer-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }

    .footer-logo {
        grid-column: 1 / -1;
        text-align: center;
    }

    .footer-logo svg {
        width: 100px;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 1.5rem;
        text-align: center;
    }

    .footer-info {
        flex-direction: column;
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    .swap-tabs {
        gap: 0.3rem;
        padding: 0.4rem;
    }

    .tab-btn {
        padding: 0.7rem 0.6rem;
        font-size: 0.85rem;
    }

    .token-name {
        font-size: 0.95rem;
    }

    .amount-input input {
        font-size: 1.3rem;
    }

    .footer-container {
        grid-template-columns: 1fr;
    }

    .footer-column h4 {
        font-size: 0.85rem;
    }

    .footer-column ul li a {
        font-size: 0.85rem;
    }
}