@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    --bg-primary: #0a0a14;
    --bg-secondary: #0d0d1a;
    --bg-tertiary: #121229;
    --text-primary: #ffffff;
    --text-secondary: #98b2d4;
    --text-tertiary: #5e75a0;
    --accent: #00d4ff;
    --accent-hover: #00b8e6;
    --neon-gold: #00d4ff;
    --border: rgba(0, 212, 255, 0.15);
    --border-hover: rgba(0, 212, 255, 0.3);
}

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

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

body::after {
    content: '';
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(700px, 90vw);
    height: min(700px, 90vw);
    background: radial-gradient(circle, rgba(0, 212, 255, 0.02), transparent 70%);
    pointer-events: none;
    z-index: 0;
}

/* ========== HEADER ========== */
.header {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: clamp(6px, 1.5vw, 12px) clamp(10px, 3vw, 24px);
    background: rgba(10, 10, 20, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 100;
    border-bottom: 1px solid rgba(0, 212, 255, 0.2);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
    flex-shrink: 0;
    min-height: clamp(40px, 8vw, 56px);
}

.header-left {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    justify-self: start;
}

.logo {
    display: flex;
    align-items: center;
    gap: clamp(4px, 1vw, 8px);
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 600;
    font-size: clamp(14px, 3vw, 20px);
    text-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
    white-space: nowrap;
}

.logo img {
    width: clamp(24px, 5vw, 32px);
    height: clamp(24px, 5vw, 32px);
    border-radius: 50%;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: clamp(16px, 4vw, 32px);
    justify-self: center;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: clamp(12px, 2.8vw, 15px);
    font-weight: 500;
    transition: color 0.2s;
    white-space: nowrap;
}

.nav-link:hover {
    color: var(--accent);
}

.header-right {
    display: flex;
    gap: clamp(4px, 1.2vw, 8px);
    align-items: center;
    flex-shrink: 0;
    justify-self: end;
}

.network-btn {
    display: flex;
    align-items: center;
    gap: clamp(3px, 0.8vw, 6px);
    padding: clamp(5px, 1.2vw, 8px) clamp(6px, 1.5vw, 12px);
    background: rgba(0, 212, 255, 0.1);
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: clamp(8px, 2vw, 12px);
    color: var(--text-primary);
    font-size: clamp(10px, 2.5vw, 14px);
    font-weight: 500;
    cursor: default;
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.1);
    white-space: nowrap;
    flex-shrink: 0;
}

.network-icon {
    width: clamp(16px, 3vw, 20px);
    height: clamp(16px, 3vw, 20px);
    border-radius: 50%;
    object-fit: cover;
}

.wallet-btn {
    padding: clamp(5px, 1.2vw, 8px) clamp(10px, 2.5vw, 16px);
    background: linear-gradient(135deg, var(--accent), var(--neon-gold));
    border: none;
    border-radius: 24px;
    color: white;
    font-size: clamp(11px, 2.5vw, 14px);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.3);
    white-space: nowrap;
    flex-shrink: 0;
}

.wallet-btn.connected {
    display: flex;
    align-items: center;
    gap: clamp(4px, 1vw, 8px);
    padding: clamp(4px, 1vw, 6px) clamp(8px, 2vw, 14px) clamp(4px, 1vw, 6px) clamp(4px, 1vw, 8px);
    background: rgba(18, 18, 41, 0.9);
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: 24px;
}

.wallet-btn.connected:hover {
    border-color: rgba(0, 212, 255, 0.5);
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.2);
}

.wallet-avatar {
    width: clamp(20px, 4vw, 28px);
    height: clamp(20px, 4vw, 28px);
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.wallet-btn:hover {
    box-shadow: 0 0 30px rgba(0, 212, 255, 0.5);
}

/* ========== MAIN CONTENT ========== */
.main-content {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    padding: clamp(16px, 4vw, 40px) clamp(8px, 3vw, 24px);
    min-height: calc(100vh - 120px);
}

/* ========== CARD ========== */
.card {
    background: #0d0d1a;
    border-radius: clamp(12px, 3vw, 20px);
    border: 1px solid rgba(0, 212, 255, 0.2);
    box-shadow:
        0 0 30px rgba(0, 212, 255, 0.05),
        0 0 60px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: min(480px, 92vw);
    padding: clamp(16px, 4vw, 24px);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: clamp(16px, 4vw, 24px);
}

.card-header h2 {
    font-size: clamp(14px, 3vw, 16px);
    font-weight: 600;
}

/* ========== FORM ========== */
.form-group {
    margin-bottom: clamp(12px, 3vw, 20px);
}

.form-group label {
    display: block;
    color: var(--text-secondary);
    font-size: clamp(11px, 2.5vw, 13px);
    margin-bottom: clamp(4px, 1vw, 8px);
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: clamp(10px, 2.5vw, 14px) clamp(12px, 3vw, 16px);
    background: rgba(18, 18, 41, 0.8);
    border: 1px solid rgba(0, 212, 255, 0.2);
    border-radius: clamp(8px, 2vw, 12px);
    color: var(--text-primary);
    font-size: clamp(13px, 3vw, 16px);
    font-family: inherit;
    outline: none;
    transition: all 0.2s;
}

.form-group input:focus {
    border-color: var(--neon-gold);
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.2);
}

.form-group input::placeholder {
    color: var(--text-tertiary);
}

.form-group input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.form-row {
    display: flex;
    gap: clamp(8px, 2vw, 12px);
}

.form-row .form-group {
    flex: 1;
}

.supply-preview {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: clamp(10px, 2.5vw, 14px) clamp(12px, 3vw, 16px);
    background: rgba(18, 18, 41, 0.6);
    border: 1px solid rgba(0, 212, 255, 0.1);
    border-radius: clamp(8px, 2vw, 12px);
    margin-bottom: clamp(16px, 4vw, 20px);
    font-size: clamp(11px, 2.5vw, 14px);
}

.supply-preview span:first-child {
    color: var(--text-secondary);
}

.supply-preview span:last-child {
    color: var(--neon-gold);
    font-weight: 600;
    font-family: monospace;
}

/* ========== BUTTONS ========== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: clamp(10px, 2.5vw, 14px);
    border: none;
    border-radius: clamp(10px, 2.5vw, 16px);
    font-size: clamp(13px, 3vw, 16px);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    font-family: inherit;
}

.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.btn-create {
    width: 100%;
    background: #00d4ff;
    color: white;
    box-shadow: 0 0 25px rgba(0, 212, 255, 0.3);
}

.btn-create:hover:not(:disabled) {
    box-shadow: 0 0 35px rgba(0, 212, 255, 0.5);
    transform: translateY(-2px);
}

.btn-create:disabled {
    background: rgba(18, 18, 41, 0.5);
    color: var(--text-tertiary);
    box-shadow: none;
}

.loader {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.hidden {
    display: none !important;
}

/* ========== TOAST ========== */
.toast-container {
    position: fixed;
    bottom: clamp(16px, 4vw, 24px);
    right: clamp(16px, 4vw, 24px);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: min(360px, 85vw);
    width: 100%;
}

.toast {
    display: flex;
    align-items: flex-start;
    gap: clamp(8px, 2vw, 12px);
    padding: clamp(12px, 3vw, 16px);
    background: rgba(13, 13, 26, 0.95);
    border-radius: clamp(10px, 2.5vw, 14px);
    border: 1px solid rgba(0, 212, 255, 0.2);
    backdrop-filter: blur(20px);
    box-shadow: 0 0 30px rgba(0, 212, 255, 0.1), 0 8px 32px rgba(0, 0, 0, 0.4);
    animation: toastSlideIn 0.3s ease-out;
    transition: all 0.3s ease;
}

.toast.removing {
    animation: toastSlideOut 0.3s ease-in forwards;
}

@keyframes toastSlideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes toastSlideOut {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}

.toast-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 12px;
}

.toast-icon.pending {
    border: 2px solid #00d4ff;
    border-top-color: transparent;
    animation: spin 0.8s linear infinite;
}

.toast-icon.success {
    background: rgba(0, 212, 255, 0.15);
    color: #00d4ff;
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.2);
}

.toast-icon.error {
    background: rgba(255, 80, 80, 0.15);
    color: #ff5050;
    box-shadow: 0 0 10px rgba(255, 80, 80, 0.2);
}

.toast-content {
    flex: 1;
    min-width: 0;
}

.toast-title {
    font-size: clamp(12px, 2.8vw, 14px);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.toast-message {
    font-size: clamp(11px, 2.5vw, 13px);
    color: var(--text-secondary);
    line-height: 1.4;
    word-break: break-word;
}

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

@media (max-width: 480px) {
    .toast-container {
        bottom: 16px;
        right: 16px;
        left: 16px;
        max-width: none;
        width: auto;
    }
}

/* ========== RESULT CARD ========== */
.result-card {
    text-align: center;
}

.success-icon {
    width: 56px;
    height: 56px;
    background: rgba(168, 85, 247, 0.15);
    border: 2px solid rgba(168, 85, 247, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    margin: 0 auto clamp(16px, 4vw, 20px);
    color: #c084fc;
}

.result-card h2 {
    font-size: clamp(16px, 4vw, 20px);
    margin-bottom: clamp(16px, 4vw, 24px);
}

.result-details {
    text-align: left;
    background: rgba(18, 18, 41, 0.6);
    border: 1px solid rgba(0, 212, 255, 0.1);
    border-radius: clamp(8px, 2vw, 12px);
    padding: clamp(12px, 3vw, 16px);
    margin-bottom: clamp(16px, 4vw, 24px);
}

.result-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: clamp(8px, 2vw, 12px) 0;
    border-bottom: 1px solid rgba(0, 212, 255, 0.1);
}

.result-row:last-child {
    border-bottom: none;
}

.result-row span:first-child {
    color: var(--text-secondary);
    font-size: clamp(11px, 2.5vw, 13px);
}

.result-row span:last-child {
    font-weight: 600;
    font-size: clamp(11px, 2.5vw, 13px);
    color: var(--text-primary);
}

.mono {
    font-family: monospace;
    font-size: clamp(10px, 2.2vw, 12px) !important;
}

.result-actions {
    display: flex;
    gap: clamp(8px, 2vw, 12px);
}

.result-actions .btn {
    flex: 1;
}

.btn-secondary {
    background: rgba(18, 18, 41, 0.8);
    border: 1px solid rgba(0, 212, 255, 0.2);
    color: var(--text-primary);
}

.btn-secondary:hover {
    border-color: var(--neon-gold);
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.2);
}

/* ========== FOOTER ========== */
.footer {
    text-align: center;
    padding: clamp(8px, 2vw, 16px) clamp(8px, 2vw, 16px);
    flex-shrink: 0;
}

.footer-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: clamp(10px, 2.2vw, 13px);
    color: var(--text-tertiary);
    flex-wrap: wrap;
}

.footer-brand strong {
    color: var(--text-secondary);
    font-weight: 600;
}

/* ========== SCROLLBAR ========== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb { background: rgba(0, 212, 255, 0.3); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

@media (max-width: 480px) {
    .card {
        border-radius: clamp(12px, 3vw, 16px);
    }

    .form-row {
        flex-direction: column;
        gap: 0;
    }

    .result-actions {
        flex-direction: column;
    }

    .header-nav {
        gap: clamp(12px, 3vw, 20px);
    }
}
