/* ===== CSS Reset & Base ===== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --usdt-green: #26A17B;
    --usdt-green-light: #2dc98e;
    --usdt-green-dark: #1a7a5a;
    --bg-primary: #0a0e17;
    --bg-secondary: #111827;
    --bg-card: rgba(17, 24, 39, 0.7);
    --bg-card-hover: rgba(26, 35, 55, 0.8);
    --text-primary: #f0f2f5;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    --border-color: rgba(255, 255, 255, 0.06);
    --glow-green: rgba(38, 161, 123, 0.3);
    --glow-green-strong: rgba(38, 161, 123, 0.5);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.3);
    --shadow-glow: 0 0 40px rgba(38, 161, 123, 0.15);
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===== Background Particles ===== */
.bg-particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--usdt-green);
    border-radius: 50%;
    opacity: 0;
    animation: particleFloat 8s infinite ease-in-out;
}

@keyframes particleFloat {
    0% {
        opacity: 0;
        transform: translateY(100vh) scale(0);
    }

    20% {
        opacity: 0.6;
    }

    80% {
        opacity: 0.3;
    }

    100% {
        opacity: 0;
        transform: translateY(-20vh) scale(1);
    }
}

/* ===== App Container ===== */
.app-container {
    position: relative;
    z-index: 1;
    max-width: 480px;
    margin: 0 auto;
    padding: 0 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

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

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

.logo-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background: rgba(38, 161, 123, 0.12);
    border: 1px solid rgba(38, 161, 123, 0.2);
}

.logo-text {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.network-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: rgba(38, 161, 123, 0.08);
    border: 1px solid rgba(38, 161, 123, 0.15);
    padding: 6px 12px;
    border-radius: 100px;
}

.network-dot {
    width: 6px;
    height: 6px;
    background: var(--usdt-green);
    border-radius: 50%;
    animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(38, 161, 123, 0.5);
    }

    50% {
        box-shadow: 0 0 0 6px rgba(38, 161, 123, 0);
    }
}

/* ===== Hero ===== */
.hero {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 20px 0 40px;
    position: relative;
}

.hero-glow {
    position: absolute;
    top: 30%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, var(--glow-green) 0%, transparent 70%);
    border-radius: 50%;
    filter: blur(60px);
    pointer-events: none;
    animation: glowPulse 4s infinite ease-in-out;
}

@keyframes glowPulse {

    0%,
    100% {
        opacity: 0.5;
        transform: translate(-50%, -50%) scale(1);
    }

    50% {
        opacity: 0.8;
        transform: translate(-50%, -50%) scale(1.1);
    }
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.1;
    margin-bottom: 16px;
    text-align: center;
}

.gradient-text {
    background: linear-gradient(135deg, var(--usdt-green-light), var(--usdt-green), #50e3c2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.6;
    text-align: center;
    margin-bottom: 32px;
    max-width: 360px;
    margin-left: auto;
    margin-right: auto;
}

/* ===== Stats Row ===== */
.stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 36px;
}

.stat-card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px 12px;
    text-align: center;
    transition: all 0.3s ease;
}

.stat-card:hover {
    background: var(--bg-card-hover);
    border-color: rgba(38, 161, 123, 0.2);
    transform: translateY(-2px);
}

.stat-value {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--usdt-green-light);
    margin-bottom: 4px;
}

.stat-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 500;
}

/* ===== Connect Button ===== */
.connect-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    padding: 18px 32px;
    background: linear-gradient(135deg, var(--usdt-green), var(--usdt-green-dark));
    color: white;
    border: none;
    border-radius: var(--radius-lg);
    font-family: 'Inter', sans-serif;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(38, 161, 123, 0.3), 0 0 0 1px rgba(38, 161, 123, 0.2);
}

.connect-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(38, 161, 123, 0.4), 0 0 0 1px rgba(38, 161, 123, 0.3);
}

.connect-btn:active {
    transform: translateY(0);
}

.btn-shimmer {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% {
        left: -100%;
    }

    100% {
        left: 100%;
    }
}

.btn-icon {
    flex-shrink: 0;
}

.connect-hint {
    text-align: center;
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 14px;
}

/* ===== Approve Section (inside Trust Wallet) ===== */
.approve-card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(38, 161, 123, 0.2);
    border-radius: var(--radius-lg);
    padding: 32px 24px;
    text-align: center;
    box-shadow: var(--shadow-glow);
    animation: fadeInUp 0.5s ease;
}

.approve-icon {
    margin-bottom: 16px;
    display: flex;
    justify-content: center;
}

.approve-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--usdt-green-light);
}

.approve-desc {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 24px;
}

/* ===== Loading State ===== */
.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 32px;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 3px solid rgba(38, 161, 123, 0.15);
    border-top-color: var(--usdt-green);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.loading-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
    animation: loadingPulse 1.5s infinite ease-in-out;
}

@keyframes loadingPulse {

    0%,
    100% {
        opacity: 0.5;
    }

    50% {
        opacity: 1;
    }
}

/* ===== Connected State ===== */
.connected-card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(38, 161, 123, 0.25);
    border-radius: var(--radius-lg);
    padding: 28px 24px;
    text-align: center;
    box-shadow: var(--shadow-glow);
    animation: fadeInUp 0.5s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

.connected-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(38, 161, 123, 0.1);
    border: 1px solid rgba(38, 161, 123, 0.2);
    border-radius: 100px;
    padding: 8px 16px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--usdt-green-light);
    margin-bottom: 20px;
}

.wallet-address {
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 0.82rem;
    color: var(--text-primary);
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    word-break: break-all;
    margin-bottom: 16px;
}

.connected-msg {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.disconnect-btn {
    margin-top: 24px;
    width: 100%;
    padding: 12px;
    border-radius: var(--radius-md);
    background: rgba(255, 59, 48, 0.1);
    color: #ff3b30;
    font-weight: 600;
    font-size: 0.9rem;
    border: 1px solid rgba(255, 59, 48, 0.2);
    cursor: pointer;
    transition: all 0.2s ease;
}

.disconnect-btn:hover {
    background: rgba(255, 59, 48, 0.2);
    transform: translateY(-1px);
}


/* ===== Error State ===== */
.error-card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: var(--radius-lg);
    padding: 28px 24px;
    text-align: center;
    animation: fadeInUp 0.5s ease;
}

.error-icon {
    font-size: 2rem;
    margin-bottom: 12px;
}

.error-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 20px;
    line-height: 1.5;
}

.retry-btn {
    display: inline-flex;
    align-items: center;
    padding: 12px 28px;
    background: transparent;
    color: var(--usdt-green-light);
    border: 1px solid rgba(38, 161, 123, 0.3);
    border-radius: var(--radius-md);
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.retry-btn:hover {
    background: rgba(38, 161, 123, 0.1);
    border-color: var(--usdt-green);
}

/* ===== Features ===== */
.features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    padding: 20px 0 40px;
}

.feature-card {
    background: var(--bg-card);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px 14px;
    text-align: center;
    transition: all 0.3s ease;
}

.feature-card:hover {
    border-color: rgba(38, 161, 123, 0.15);
    transform: translateY(-2px);
}

.feature-icon {
    font-size: 1.6rem;
    margin-bottom: 10px;
}

.feature-card h3 {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 6px;
}

.feature-card p {
    font-size: 0.72rem;
    color: var(--text-muted);
    line-height: 1.4;
}

/* ===== Footer ===== */
.footer {
    padding: 24px 0;
    text-align: center;
    border-top: 1px solid var(--border-color);
}

.footer p {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ===== WalletConnect Modal ===== */
.wc-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.wc-modal {
    background: #1a1a2e;
    border-radius: 24px;
    width: 360px;
    max-width: 92vw;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: modalSlideUp 0.3s ease;
}

@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

.wc-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: linear-gradient(135deg, #3B99FC, #2b7fd9);
}

.wc-modal-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    color: white;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.wc-modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.wc-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.wc-modal-title {
    text-align: center;
    font-size: 1.05rem;
    font-weight: 600;
    color: #e0e0e0;
    padding: 18px 18px 12px;
}

.wc-modal-tabs {
    display: flex;
    gap: 0;
    padding: 0 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.wc-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: #888;
    font-family: 'Inter', sans-serif;
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.wc-tab.active {
    color: #3B99FC;
    border-bottom-color: #3B99FC;
}

.wc-tab:hover {
    color: #ccc;
}

.wc-tab-content {
    padding: 20px 18px 24px;
}

.wc-scan-text {
    text-align: center;
    font-size: 0.8rem;
    color: #888;
    margin-bottom: 16px;
}

.wc-qr-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    border-radius: 16px;
    padding: 16px;
    min-height: 292px;
}

.wc-qr-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    color: #333;
    font-size: 0.82rem;
    position: absolute;
}

.wc-qr-loading .spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #e0e0e0;
    border-top-color: #3B99FC;
}

.wc-qr-logo {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 8px;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wc-desktop-wallets {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: center;
    padding: 12px 0;
}

.wc-wallet-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: #ccc;
    font-size: 0.78rem;
    font-weight: 500;
    padding: 12px;
    border-radius: 12px;
    transition: background 0.2s;
}

.wc-wallet-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* ===== Generic Modal (White Theme for Network Selection) ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: fadeIn 0.2s ease;
}

.modal-card {
    background: #ffffff;
    border-radius: 24px;
    width: 380px;
    max-width: 92vw;
    padding: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    animation: modalSlideUp 0.3s ease;
    color: #000000;
}

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

.modal-back-btn {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
}

.network-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.network-item {
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
    padding: 16px;
    background: #f8f9fa;
    border: 1px solid #edf2f7;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
    font-family: inherit;
    border: 1px solid transparent;
}

.network-item:hover:not(.disabled) {
    background: #ffffff;
    border-color: #e2e8f0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transform: translateY(-2px);
}

.network-item.disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.network-info {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.network-name {
    font-weight: 600;
    font-size: 1rem;
    color: #1a202c;
}

.badge-coming {
    font-size: 0.7rem;
    background: #edf2f7;
    color: #718096;
    padding: 4px 8px;
    border-radius: 8px;
    font-weight: 500;
}

.modal-footer {
    margin-top: 24px;
}

.btn-primary-ghost {
    width: 100%;
    padding: 14px;
    background: #f1f3f5;
    color: #adb5bd;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: not-allowed;
}

/* ===== Utility ===== */
/* Modal Back Button */
.back-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    margin-right: 12px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.back-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-primary);
}

.hidden {
    display: none !important;
}

/* ===== Responsive ===== */
@media (max-width: 380px) {
    .hero-title {
        font-size: 2rem;
    }

    .stats-row {
        gap: 8px;
    }

    .stat-card {
        padding: 12px 8px;
    }

    .stat-value {
        font-size: 1rem;
    }

    .features {
        gap: 8px;
    }
}

@media (min-width: 481px) {
    .app-container {
        max-width: 520px;
    }

    .hero-title {
        font-size: 3rem;
    }
}