/* CSS Variables */
:root {
    --bg-primary: #0a0a0a;
    --bg-secondary: #111111;
    --bg-tertiary: #1a1a1a;
    --bg-card: #161616;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --text-muted: #666666;
    --accent: #00D4AA;
    --accent-hover: #00B894;
    --accent-glow: rgba(0, 212, 170, 0.2);
    --danger: #FF6B6B;
    --success: #00D4AA;
    --border: #222222;
    --border-hover: #333333;
    --font-sans: 'Inter', -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.5);
    --transition: 200ms ease;
}

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

body {
    font-family: var(--font-sans);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* App Container */
.app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(12px);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 32px;
}

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

.logo-text {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.nav {
    display: flex;
    gap: 24px;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color var(--transition);
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    color: var(--text-primary);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -20px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--accent);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.network-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    font-size: 13px;
    color: var(--text-secondary);
}

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

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background: var(--accent);
    color: #000;
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--accent-glow);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

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

.btn-large {
    padding: 14px 28px;
    font-size: 16px;
}

/* Main Content */
.main {
    flex: 1;
    padding: 32px 24px;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

/* Hero Section */
.hero {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    margin-bottom: 64px;
    padding: 48px;
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
}

.hero-content h1 {
    font-size: 48px;
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 16px;
}

.highlight {
    color: var(--accent);
}

.hero-subtitle {
    font-size: 18px;
    color: var(--text-secondary);
    margin-bottom: 32px;
    max-width: 500px;
}

.hero-stats {
    display: flex;
    gap: 32px;
}

.stat {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--accent);
    font-family: var(--font-mono);
}

.stat-label {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
}

.hero-visual {
    display: flex;
    align-items: center;
    justify-content: center;
}

.bonding-curve-viz {
    position: relative;
    width: 100%;
    max-width: 400px;
}

.curve-svg {
    width: 100%;
    height: auto;
}

.curve-path {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    animation: drawCurve 2s ease forwards;
}

@keyframes drawCurve {
    to { stroke-dashoffset: 0; }
}

.curve-point {
    animation: moveAlongCurve 4s ease infinite;
}

.curve-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 12px;
    font-size: 12px;
    color: var(--text-muted);
}

/* Sections */
.section {
    margin-bottom: 48px;
}

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

.section-header h2 {
    font-size: 24px;
    font-weight: 600;
}

.section-header p {
    color: var(--text-secondary);
    font-size: 14px;
    margin-top: 4px;
}

.section-actions {
    display: flex;
    gap: 12px;
}

select {
    padding: 8px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
    outline: none;
}

select:focus {
    border-color: var(--accent);
}

/* Launch Form */
.launch-section {
    background: var(--bg-secondary);
    padding: 32px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
}

.launch-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 24px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-group input,
.form-group textarea {
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 14px;
    font-family: var(--font-sans);
    outline: none;
    transition: border-color var(--transition);
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--accent);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
    grid-column: 1 / -1;
}

.form-group .btn-large {
    grid-column: 1 / -1;
    margin-top: 12px;
}

/* Tokens Grid */
.tokens-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.token-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    cursor: pointer;
    transition: all var(--transition);
}

.token-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.token-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.token-icon {
    width: 40px;
    height: 40px;
    background: var(--bg-tertiary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    color: var(--accent);
}

.token-info {
    flex: 1;
}

.token-name {
    font-size: 16px;
    font-weight: 600;
}

.token-symbol {
    font-size: 13px;
    color: var(--text-muted);
}

.token-status {
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 500;
}

.token-status.bonding {
    background: rgba(0, 212, 170, 0.15);
    color: var(--accent);
}

.token-status.graduated {
    background: rgba(100, 100, 255, 0.15);
    color: #6464FF;
}

.token-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.token-stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.token-stat-label {
    font-size: 12px;
    color: var(--text-muted);
}

.token-stat-value {
    font-size: 15px;
    font-weight: 600;
    font-family: var(--font-mono);
}

/* Trading Section */
.trading-container {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 24px;
}

.chart-container {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    font-size: 14px;
    font-weight: 500;
}

.timeframe-selector {
    display: flex;
    gap: 4px;
}

.tf-btn {
    padding: 4px 10px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 12px;
    cursor: pointer;
    transition: all var(--transition);
}

.tf-btn:hover,
.tf-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #000;
}

.chart {
    height: 300px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    position: relative;
}

#chartCanvas {
    width: 100%;
    height: 100%;
}

/* Trade Panel */
.trade-panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
}

.trade-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 20px;
}

.trade-tab {
    padding: 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
}

.trade-tab:hover,
.trade-tab.active {
    border-color: var(--accent);
}

.trade-tab[data-side="buy"].active {
    background: rgba(0, 212, 170, 0.15);
    color: var(--accent);
}

.trade-tab[data-side="sell"].active {
    background: rgba(255, 107, 107, 0.15);
    color: var(--danger);
    border-color: var(--danger);
}

.trade-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.trade-input-group label {
    display: block;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.input-with-max {
    display: flex;
    gap: 8px;
}

.input-with-max input {
    flex: 1;
    padding: 14px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 16px;
    font-family: var(--font-mono);
    outline: none;
}

.input-with-max input:focus {
    border-color: var(--accent);
}

.max-btn {
    padding: 0 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--accent);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
}

.max-btn:hover {
    background: var(--accent);
    color: #000;
}

.trade-estimate {
    display: flex;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    font-size: 14px;
}

.estimate-value {
    font-weight: 600;
    color: var(--accent);
    font-family: var(--font-mono);
}

.trade-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 13px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    color: var(--text-secondary);
}

.info-row span:last-child {
    font-family: var(--font-mono);
    color: var(--text-primary);
}

/* Dashboard */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.dashboard-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
}

.dashboard-card h3 {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.claimable-amount {
    font-size: 36px;
    font-weight: 700;
    color: var(--accent);
    font-family: var(--font-mono);
    margin-bottom: 20px;
}

.performance-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

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

.perf-stat span:last-child {
    font-weight: 600;
    font-family: var(--font-mono);
}

/* Footer */
.footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    padding: 24px;
    margin-top: auto;
}

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

.footer-left span {
    display: block;
}

.footer-left span:first-child {
    font-weight: 600;
    margin-bottom: 4px;
}

.footer-left span:last-child {
    font-size: 13px;
    color: var(--text-muted);
}

.footer-right {
    display: flex;
    gap: 24px;
}

.footer-right a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    transition: color var(--transition);
}

.footer-right a:hover {
    color: var(--text-primary);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 400px;
    animation: modalIn 0.2s ease;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.modal-body {
    padding: 24px;
    text-align: center;
}

.tx-status {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.tx-details {
    text-align: left;
    padding: 16px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
}

.tx-hash {
    font-family: var(--font-mono);
    font-size: 12px;
    word-break: break-all;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.tx-result {
    font-weight: 600;
    color: var(--accent);
}

.tx-result.failed {
    color: var(--danger);
}

/* Responsive */
@media (max-width: 1024px) {
    .hero {
        grid-template-columns: 1fr;
        gap: 32px;
    }
    
    .trading-container {
        grid-template-columns: 1fr;
    }
    
    .launch-form {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .header {
        padding: 12px 16px;
    }
    
    .nav {
        display: none;
    }
    
    .hero {
        padding: 24px;
    }
    
    .hero-content h1 {
        font-size: 32px;
    }
    
    .hero-stats {
        flex-wrap: wrap;
        gap: 20px;
    }
    
    .tokens-grid {
        grid-template-columns: 1fr;
    }
    
    .main {
        padding: 20px 16px;
    }
}
