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

:root {
    --primary-color: #00ff88;
    --secondary-color: #00d97e;
    --bg-dark: #000000;
    --bg-card: #0a0a0a;
    --bg-input: #111111;
    --text-primary: #ffffff;
    --text-secondary: #8a8a8a;
    --border-color: #1a1a1a;
    --hover-color: #0ade7e;
    --glow-color: rgba(0, 255, 136, 0.5);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}


.background-gradient {
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 40%, rgba(0, 255, 136, 0.05) 0%, transparent 50%),
                radial-gradient(circle at 70% 60%, rgba(0, 217, 126, 0.04) 0%, transparent 50%);
    z-index: 0;
}

@keyframes gradientMove {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg);
    }
    50% {
        transform: translate(50px, 50px) rotate(180deg);
    }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
    z-index: 1;
}

header {
    padding: 20px 0;
    position: relative;
    z-index: 10;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
}

.logo h1 {
    font-size: 32px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

.connect-btn {
    background: linear-gradient(135deg, var(--primary-color), var(--hover-color));
    color: #000000;
    border: none;
    padding: 12px 28px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    min-width: 180px;
    height: 50px;
    box-shadow: 0 4px 12px rgba(0, 255, 136, 0.2);
}

.connect-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 255, 136, 0.3);
    filter: brightness(1.05);
}

.connect-btn.loading {
    pointer-events: none;
}

.connect-btn .btn-text {
    display: inline-block;
    transition: opacity 0.3s;
}

.connect-btn.loading .btn-text {
    opacity: 0;
}

.loader {
    display: none;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(0, 0, 0, 0.3);
    border-top-color: #000000;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.connect-btn.loading .loader {
    display: block;
}

.wallet-address {
    font-weight: 700;
    letter-spacing: 0.5px;
}

@keyframes spin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

main {
    padding: 40px 0;
    position: relative;
    z-index: 1;
}

.swap-container {
    max-width: 480px;
    margin: 0 auto;
}

.swap-card {
    background: var(--bg-card);
    border-radius: 24px;
    padding: 28px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(0, 255, 136, 0.15);
    position: relative;
}

.card-header {
    margin-bottom: 28px;
    border-bottom: 1px solid rgba(0, 255, 136, 0.1);
    padding-bottom: 20px;
}

.card-header h2 {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.subtitle {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.6;
}

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

.input-group {
    background: var(--bg-input);
    border-radius: 16px;
    padding: 18px;
    border: 1px solid rgba(0, 255, 136, 0.15);
    transition: all 0.3s ease;
    position: relative;
}

.input-group:focus-within {
    border-color: rgba(0, 255, 136, 0.3);
}

.input-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
}

.input-header label {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
}

.balance {
    color: var(--text-secondary);
    font-size: 14px;
}

.input-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.input-wrapper input {
    flex: 1;
    min-width: 0;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 24px;
    font-weight: 600;
    outline: none;
}

.input-wrapper input::placeholder {
    color: var(--text-secondary);
}

.input-wrapper input:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

/* Remove number input spinner arrows */
.input-wrapper input[type=number]::-webkit-outer-spin-button,
.input-wrapper input[type=number]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

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

.max-btn {
    background: rgba(0, 255, 136, 0.1);
    border: 1px solid rgba(0, 255, 136, 0.3);
    color: var(--primary-color);
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.max-btn:hover {
    background: rgba(0, 255, 136, 0.2);
    border-color: rgba(0, 255, 136, 0.5);
}

.max-btn:active {
    transform: scale(0.95);
}

.token-selector {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(0, 0, 0, 0.3);
    padding: 6px 10px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 255, 136, 0.2);
    white-space: nowrap;
    flex-shrink: 0;
}

.token-selector:hover {
    background: rgba(0, 0, 0, 0.5);
    border-color: rgba(0, 255, 136, 0.3);
}

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

.token-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
}

.swap-arrow-container {
    display: flex;
    justify-content: center;
    margin: -8px 0;
    position: relative;
    z-index: 2;
}

.swap-arrow {
    background: var(--bg-card);
    border: 2px solid rgba(0, 255, 136, 0.2);
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--primary-color);
    transition: all 0.3s ease;
}

.swap-arrow:hover {
    transform: rotate(180deg);
    border-color: rgba(0, 255, 136, 0.4);
}

.swap-info {
    background: rgba(0, 255, 136, 0.03);
    border-radius: 12px;
    padding: 16px;
    margin-top: 16px;
    border: 1px solid rgba(0, 255, 136, 0.1);
}

.info-row {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
}

.info-label {
    color: var(--text-secondary);
}

.info-value {
    color: var(--text-primary);
    font-weight: 600;
}

.swap-btn {
    width: 100%;
    background: linear-gradient(135deg, var(--primary-color), var(--hover-color));
    color: #000000;
    border: none;
    padding: 18px;
    border-radius: 14px;
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 20px;
    box-shadow: 0 4px 12px rgba(0, 255, 136, 0.2);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.swap-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 255, 136, 0.3);
    filter: brightness(1.05);
}

.swap-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: linear-gradient(135deg, #1a1a1a, #2a2a2a);
    box-shadow: none;
    color: var(--text-secondary);
}

.info-banner {
    margin-top: 24px;
    background: rgba(0, 255, 136, 0.04);
    border: 1px solid rgba(0, 255, 136, 0.15);
    border-radius: 14px;
    padding: 16px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
    color: var(--primary-color);
}

.info-banner svg {
    flex-shrink: 0;
    margin-top: 2px;
}

.info-banner p {
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-secondary);
}

.status-message {
    margin-top: 16px;
    padding: 14px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.5;
    text-align: center;
}

.status-message.success {
    background: rgba(0, 255, 136, 0.1);
    border: 1px solid rgba(0, 255, 136, 0.3);
    color: var(--primary-color);
}

.status-message.warning {
    background: rgba(255, 193, 7, 0.1);
    border: 1px solid rgba(255, 193, 7, 0.3);
    color: #ffc107;
}

.status-message.error {
    background: rgba(244, 67, 54, 0.1);
    border: 1px solid rgba(244, 67, 54, 0.3);
    color: #f44336;
}

.status-message.info {
    background: rgba(33, 150, 243, 0.1);
    border: 1px solid rgba(33, 150, 243, 0.3);
    color: #2196f3;
}

footer {
    padding: 40px 0;
    text-align: center;
    color: var(--text-secondary);
    position: relative;
    z-index: 1;
}

footer p {
    font-size: 14px;
}


@media (max-width: 768px) {
    .logo {
        gap: 8px;
    }

    .logo-icon {
        width: 32px;
        height: 32px;
    }

    .logo h1 {
        font-size: 24px;
    }

    .connect-btn {
        padding: 10px 20px;
        font-size: 14px;
        min-width: 140px;
        height: 44px;
    }

    .swap-card {
        padding: 20px;
    }

    .card-header h2 {
        font-size: 22px;
    }

    .input-wrapper {
        gap: 6px;
    }

    .input-wrapper input {
        font-size: 18px;
    }

    .input-group {
        padding: 14px;
    }

    .token-selector {
        padding: 5px 8px;
        gap: 4px;
    }

    .token-icon {
        width: 18px;
        height: 18px;
    }

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

@media (max-width: 480px) {
    .input-wrapper input {
        font-size: 16px;
    }

    .token-name {
        font-size: 12px;
    }

    .token-icon {
        width: 16px;
        height: 16px;
    }
}

/* ToS Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: var(--bg-card);
    margin: 5% auto;
    padding: 30px;
    border: 1px solid rgba(0, 255, 136, 0.2);
    border-radius: 24px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    position: relative;
}

.modal-content h2 {
    color: var(--primary-color);
    margin-bottom: 20px;
    font-size: 28px;
    font-weight: 800;
    text-align: center;
}

.tos-scroll-container {
    max-height: 400px;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 20px;
    background: var(--bg-input);
    border-radius: 16px;
    border: 1px solid rgba(0, 255, 136, 0.15);
    margin-bottom: 20px;
}

.tos-scroll-container::-webkit-scrollbar {
    width: 8px;
}

.tos-scroll-container::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
}

.tos-scroll-container::-webkit-scrollbar-thumb {
    background: rgba(0, 255, 136, 0.3);
    border-radius: 4px;
}

.tos-scroll-container::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 255, 136, 0.5);
}

.tos-content h3 {
    color: var(--text-primary);
    font-size: 18px;
    font-weight: 700;
    margin-top: 20px;
    margin-bottom: 10px;
}

.tos-content h3:first-child {
    margin-top: 0;
}

.verification-notice {
    background: rgba(0, 255, 136, 0.05);
    border: 1px solid rgba(0, 255, 136, 0.15);
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 24px;
}

.verification-notice h3 {
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 700;
    margin-top: 0 !important;
    margin-bottom: 10px;
}

.verification-notice p {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 0;
}

.tos-content p {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 12px;
}

.tos-content ul {
    margin: 10px 0;
    padding-left: 20px;
}

.tos-content li {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 8px;
}

.tos-footer {
    margin-top: 30px;
    font-size: 12px;
    color: var(--text-secondary);
    font-style: italic;
    text-align: center;
    padding-top: 15px;
    border-top: 1px solid rgba(0, 255, 136, 0.1);
}

.tos-accept-btn {
    width: 100%;
    background: linear-gradient(135deg, var(--primary-color), var(--hover-color));
    color: #000000;
    border: none;
    padding: 16px;
    border-radius: 14px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 255, 136, 0.2);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tos-accept-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 255, 136, 0.3);
    filter: brightness(1.05);
}

.tos-accept-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: linear-gradient(135deg, #1a1a1a, #2a2a2a);
    box-shadow: none;
    color: var(--text-secondary);
}

@media (max-width: 768px) {
    .modal-content {
        margin: 10% auto;
        padding: 20px;
        width: 95%;
    }

    .tos-scroll-container {
        max-height: 300px;
        padding: 15px;
    }

    .modal-content h2 {
        font-size: 22px;
    }
}
