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

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary: #0ea5e9;
    --background: #0f0f1a;
    --surface: #1a1a2e;
    --surface-light: #252540;
    --text: #ffffff;
    --text-secondary: #94a3b8;
    --border: #2d2d4a;
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--background);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
}

.background-effects {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.gradient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.3;
}

.orb-1 {
    width: 600px;
    height: 600px;
    background: var(--primary);
    top: -200px;
    right: -200px;
    animation: float 20s ease-in-out infinite;
}

.orb-2 {
    width: 400px;
    height: 400px;
    background: var(--secondary);
    bottom: -100px;
    left: -100px;
    animation: float 15s ease-in-out infinite reverse;
}

.orb-3 {
    width: 300px;
    height: 300px;
    background: #8b5cf6;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: pulse 10s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(30px, 30px); }
}

@keyframes pulse {
    0%, 100% { opacity: 0.2; transform: translate(-50%, -50%) scale(1); }
    50% { opacity: 0.4; transform: translate(-50%, -50%) scale(1.1); }
}

.container {
    position: relative;
    z-index: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
}

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

.logo-icon {
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 24px;
}

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

.nav-links {
    display: flex;
    gap: 30px;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: var(--text);
}

.main-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 0;
}

.swap-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 40px;
    width: 100%;
    max-width: 550px;
    backdrop-filter: blur(20px);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.card-header {
    text-align: center;
    margin-bottom: 25px;
}

.card-header h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
    background: linear-gradient(135deg, var(--text), var(--text-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

/* Progress Bar */
.progress-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 30px;
    padding: 0 10px;
}

.progress-step {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--surface-light);
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    color: var(--text-secondary);
    transition: all 0.3s;
    flex-shrink: 0;
}

.progress-step.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.progress-step.completed {
    background: var(--success);
    border-color: var(--success);
    color: white;
}

.progress-line {
    flex: 1;
    height: 3px;
    background: var(--border);
    margin: 0 8px;
    border-radius: 2px;
    overflow: hidden;
    max-width: 50px;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: var(--primary);
    transition: width 0.3s;
}

.progress-fill.filled {
    width: 100%;
}

/* Steps */
.step {
    display: none;
}

.step.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.step-content {
    margin-bottom: 25px;
}

.step-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    text-align: center;
    line-height: 1.4;
}

.instruction-box {
    display: flex;
    gap: 15px;
    background: var(--surface-light);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 15px;
}

.instruction-number {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
}

.instruction-box p {
    color: var(--text-secondary);
    line-height: 1.7;
    font-size: 14px;
}

.instruction-box strong {
    color: var(--text);
}

.warning-box {
    display: flex;
    gap: 12px;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid var(--warning);
    border-radius: 12px;
    padding: 15px;
}

.warning-box svg {
    width: 24px;
    height: 24px;
    color: var(--warning);
    flex-shrink: 0;
}

.warning-box p {
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.6;
}

.warning-box strong {
    color: var(--warning);
}

/* Buttons */
.continue-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border: none;
    padding: 16px 32px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.continue-btn:hover {
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
    transform: translateY(-2px);
}

.continue-btn svg {
    width: 20px;
    height: 20px;
}

.step-buttons {
    display: flex;
    gap: 12px;
}

.back-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--surface-light);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 16px 24px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.back-btn:hover {
    background: var(--surface);
    color: var(--text);
    border-color: var(--text-secondary);
}

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

.back-btn-full {
    width: 100%;
    margin-top: 15px;
}

.step-buttons .continue-btn {
    flex: 1;
}

/* Swap Interface */
.swap-interface {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.swap-input-container {
    background: var(--surface-light);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 16px;
}

.swap-input-container label {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.swap-input-box {
    display: flex;
    align-items: center;
    gap: 12px;
}

.swap-input-box input {
    flex: 1;
    background: none;
    border: none;
    color: var(--text);
    font-size: 28px;
    font-weight: 600;
    outline: none;
    min-width: 0;
}

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

.swap-input-box input::-webkit-outer-spin-button,
.swap-input-box input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

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

/* Token Dropdown */
.token-dropdown {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 10px 14px;
    cursor: pointer;
    transition: all 0.3s;
    min-width: 120px;
}

.token-dropdown:hover {
    border-color: var(--primary);
}

.token-dropdown.open {
    border-color: var(--primary);
}

.token-selected {
    display: flex;
    align-items: center;
    gap: 8px;
}

.token-selected img {
    width: 24px;
    height: 24px;
}

.token-selected span {
    font-weight: 600;
    font-size: 14px;
}

.dropdown-arrow {
    width: 16px;
    height: 16px;
    color: var(--text-secondary);
    transition: transform 0.3s;
}

.token-dropdown.open .dropdown-arrow {
    transform: rotate(180deg);
}

.token-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--surface-light);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    display: none;
    z-index: 100;
    min-width: 220px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.token-dropdown.open .token-dropdown-menu {
    display: block;
}

.token-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    cursor: pointer;
    transition: background 0.2s;
}

.token-option:hover {
    background: var(--surface);
}

.token-option img {
    width: 24px;
    height: 24px;
}

.token-option span {
    font-size: 14px;
    font-weight: 500;
}

.token-option.other-tokens {
    border-top: 1px solid var(--border);
}

.other-icon {
    width: 24px;
    height: 24px;
    background: var(--surface);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.other-icon svg {
    width: 16px;
    height: 16px;
    color: var(--text-secondary);
}

.token-option.other-tokens span {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Token Display (KDN) */
.token-display {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 10px 14px;
}

.kdn-icon {
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 12px;
}

.token-display span {
    font-weight: 600;
    font-size: 14px;
}

/* Swap Arrow */
.swap-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5px 0;
}

.swap-arrow svg {
    width: 28px;
    height: 28px;
    color: var(--text-secondary);
    background: var(--surface-light);
    border-radius: 50%;
    padding: 6px;
    border: 1px solid var(--border);
}

/* Connect Wallet Button */
.connect-wallet-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border: none;
    padding: 18px 32px;
    border-radius: 14px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 5px;
}

.connect-wallet-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.3);
}

.connect-wallet-btn svg {
    width: 22px;
    height: 22px;
}

/* Status Bar */
.status-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 20px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 500;
    margin-top: 5px;
}

.status-bar.waiting {
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid var(--warning);
    color: var(--warning);
}

.status-bar.error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid var(--error);
    color: var(--error);
}

.status-bar.success {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid var(--success);
    color: var(--success);
}

.status-icon {
    display: flex;
    align-items: center;
}

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

.status-bar.waiting .status-icon svg {
    animation: spin 2s linear infinite;
}

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

.footer {
    text-align: center;
    padding: 20px;
    color: var(--text-secondary);
    font-size: 14px;
}

/* Responsive */
@media (max-width: 640px) {
    .swap-card {
        padding: 25px 20px;
    }

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

    .nav-links {
        display: none;
    }

    .instruction-box {
        flex-direction: column;
        gap: 12px;
    }

    .step-buttons {
        flex-direction: column;
    }

    .step-buttons .back-btn {
        order: 2;
    }

    .step-buttons .continue-btn {
        order: 1;
    }

    .swap-input-box input {
        font-size: 22px;
    }

    .token-dropdown {
        min-width: 100px;
    }

    .token-dropdown-menu {
        right: -20px;
    }

    .progress-step {
        width: 30px;
        height: 30px;
        font-size: 12px;
    }

    .progress-line {
        max-width: 30px;
    }
}
