/* ============================================
   $MOLTDATA - ON-CHAIN ANALYTICS DASHBOARD
   Modern, Clean, Professional Design
   ============================================ */

:root {
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --secondary: #8b5cf6;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --bg-dark: #0f172a;
    --bg-card: #1e293b;
    --bg-input: #334155;
    --text: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border: #334155;
    --gradient-1: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    --gradient-2: linear-gradient(135deg, #10b981 0%, #3b82f6 100%);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
    --font-main: 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --radius: 12px;
    --radius-sm: 8px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    background: var(--bg-dark);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

/* Top Bar */
.top-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 36px;
    background: rgba(15, 23, 42, 0.95);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
    font-size: 0.8rem;
    z-index: 1001;
    backdrop-filter: blur(10px);
}

.bar-left, .bar-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
}

.status-indicator {
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.bar-center {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.live-text {
    background: var(--danger);
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    animation: livePulse 2s infinite;
}

@keyframes livePulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.gas-mini {
    font-family: var(--font-mono);
}

/* Navigation */
.navbar {
    position: fixed;
    top: 36px;
    left: 0;
    right: 0;
    height: 64px;
    background: rgba(15, 23, 42, 0.95);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.brand-icon {
    width: 36px;
    height: 36px;
    color: var(--primary);
}

.brand-icon.small {
    width: 28px;
    height: 28px;
}

.brand-text {
    font-size: 1.25rem;
    font-weight: 700;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-menu {
    display: flex;
    gap: 0.5rem;
}

.nav-link {
    padding: 0.5rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.nav-link:hover {
    color: var(--text);
    background: var(--bg-input);
}

.nav-link.active {
    color: var(--primary);
    background: rgba(59, 130, 246, 0.1);
}

.btn-connect {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    background: var(--gradient-1);
    border: none;
    border-radius: var(--radius-sm);
    color: white;
    font-family: var(--font-main);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-connect:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

/* Main Content */
.main-content {
    padding-top: 120px;
    padding-bottom: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    padding-left: 2rem;
    padding-right: 2rem;
}

/* Section Header */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
}

.section-header h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.section-header p {
    color: var(--text-secondary);
}

.header-badges {
    display: flex;
    gap: 0.5rem;
}

.badge {
    padding: 0.4rem 0.8rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.badge-live {
    color: var(--success);
    border-color: var(--success);
}

/* Quick Stats */
.quick-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    transition: all 0.2s ease;
}

.stat-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon svg {
    width: 24px;
    height: 24px;
}

.stat-icon.blue {
    background: rgba(59, 130, 246, 0.15);
    color: var(--primary);
}

.stat-icon.green {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
}

.stat-icon.purple {
    background: rgba(139, 92, 246, 0.15);
    color: var(--secondary);
}

.stat-icon.orange {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
}

.stat-info {
    flex: 1;
}

.stat-label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    font-family: var(--font-mono);
}

.stat-change {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.stat-change.positive {
    color: var(--success);
}

.stat-change.negative {
    color: var(--danger);
}

/* Tool Sections */
.tool-section {
    margin-bottom: 3rem;
}

.section-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.section-title h2 {
    font-size: 1.5rem;
    font-weight: 600;
}

.refresh-btn {
    color: var(--primary);
    cursor: pointer;
    font-size: 0.9rem;
    transition: transform 0.3s ease;
}

.refresh-btn:hover {
    transform: rotate(180deg);
}

.live-indicator {
    color: var(--success);
    font-size: 0.85rem;
    animation: pulse 2s infinite;
}

/* Gas Tracker */
.gas-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.gas-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    text-align: center;
    transition: all 0.2s ease;
}

.gas-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.gas-card.slow {
    border-top: 3px solid var(--warning);
}

.gas-card.standard {
    border-top: 3px solid var(--primary);
}

.gas-card.fast {
    border-top: 3px solid var(--success);
}

.gas-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.gas-type {
    font-weight: 600;
}

.gas-time {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.gas-value {
    font-size: 2.5rem;
    font-weight: 700;
    font-family: var(--font-mono);
    color: var(--text);
}

.gas-unit {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.gas-usd {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.gas-chart {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
}

.gas-chart h3 {
    font-size: 1rem;
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

.chart-container {
    height: 200px;
    position: relative;
}

#gasChart {
    width: 100%;
    height: 100%;
}

/* Token Scanner */
.scanner-container {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.search-box {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.search-box input {
    flex: 1;
    padding: 1rem 1.5rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: var(--font-mono);
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s ease;
}

.search-box input:focus {
    border-color: var(--primary);
}

.search-box input::placeholder {
    color: var(--text-muted);
}

.search-btn {
    padding: 1rem 2rem;
    background: var(--gradient-1);
    border: none;
    border-radius: var(--radius-sm);
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.search-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.scanner-result {
    min-height: 200px;
}

.result-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 200px;
    color: var(--text-muted);
    text-align: center;
}

.placeholder-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.result-placeholder p {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.result-placeholder span {
    font-size: 0.9rem;
}

/* Token Result */
.token-result {
    display: none;
}

.token-result.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1rem;
}

.token-name {
    font-size: 1.25rem;
    font-weight: 600;
}

.token-address {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-muted);
}

.security-score {
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
}

.security-score.safe {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
}

.security-score.warning {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
}

.security-score.danger {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
}

.result-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.result-item {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
}

.result-item .label {
    color: var(--text-muted);
}

.result-item .value {
    font-family: var(--font-mono);
    font-weight: 500;
}

.result-item .value.safe {
    color: var(--success);
}

.result-item .value.danger {
    color: var(--danger);
}

/* Recent Scans */
.recent-scans {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
}

.recent-scans h3 {
    font-size: 1rem;
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

.scans-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.scan-item {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
}

.scan-name {
    font-weight: 500;
}

.scan-score {
    font-size: 0.85rem;
}

.scan-score.safe {
    color: var(--success);
}

/* Converter */
.converter-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.converter-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
}

.converter-card h3 {
    font-size: 1rem;
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
}

.converter-inputs {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.converter-inputs.vertical {
    flex-direction: column;
}

.input-group {
    flex: 1;
    width: 100%;
}

.input-group label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.input-group input {
    width: 100%;
    padding: 0.75rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: var(--font-mono);
    font-size: 0.95rem;
    outline: none;
}

.input-group input:focus {
    border-color: var(--primary);
}

.convert-arrow {
    color: var(--text-muted);
    font-size: 1.2rem;
}

.btn-small {
    padding: 0.5rem 1rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-small:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* Whale Watch */
.whale-container {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
}

.whale-filters {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.filter-btn {
    padding: 0.5rem 1rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-btn:hover {
    border-color: var(--primary);
}

.filter-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.whale-feed {
    max-height: 400px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.whale-feed::-webkit-scrollbar {
    width: 6px;
}

.whale-feed::-webkit-scrollbar-track {
    background: var(--bg-input);
    border-radius: 3px;
}

.whale-feed::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 3px;
}

.whale-tx {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--primary);
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

.whale-tx.buy {
    border-left-color: var(--success);
}

.whale-tx.sell {
    border-left-color: var(--danger);
}

.tx-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.tx-type {
    font-weight: 600;
}

.tx-type.buy {
    color: var(--success);
}

.tx-type.sell {
    color: var(--danger);
}

.tx-token {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.tx-amount {
    text-align: right;
}

.tx-value {
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: 1.1rem;
}

.tx-time {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Token Banner */
.token-banner {
    margin-top: 3rem;
}

.banner-content {
    background: var(--gradient-1);
    border-radius: var(--radius);
    padding: 3rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

.banner-info h2 {
    font-size: 1.75rem;
    margin-bottom: 0.75rem;
}

.banner-info p {
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 1.5rem;
    max-width: 500px;
}

.token-stats {
    display: flex;
    gap: 2rem;
}

.t-stat {
    display: flex;
    flex-direction: column;
}

.t-label {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
}

.t-value {
    font-family: var(--font-mono);
    font-size: 1.25rem;
    font-weight: 600;
}

.banner-actions {
    display: flex;
    gap: 1rem;
}

.btn-primary {
    padding: 1rem 2rem;
    background: white;
    color: var(--primary);
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-outline {
    padding: 1rem 2rem;
    background: transparent;
    border: 2px solid white;
    color: white;
    border-radius: var(--radius-sm);
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Footer */
.footer {
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    padding: 3rem 2rem 1.5rem;
    margin-top: 3rem;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.footer-brand p {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.footer-links {
    display: flex;
    gap: 2rem;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s ease;
}

.footer-links a:hover {
    color: var(--primary);
}

.footer-bottom {
    text-align: center;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.footer-bottom p {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Responsive */
@media (max-width: 1200px) {
    .quick-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .converter-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .top-bar {
        padding: 0 1rem;
    }
    
    .navbar {
        padding: 0 1rem;
    }
    
    .nav-menu {
        display: none;
    }
    
    .main-content {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .quick-stats {
        grid-template-columns: 1fr;
    }
    
    .gas-grid {
        grid-template-columns: 1fr;
    }
    
    .section-header {
        flex-direction: column;
        gap: 1rem;
    }
    
    .banner-content {
        flex-direction: column;
        text-align: center;
    }
    
    .token-stats {
        justify-content: center;
    }
    
    .banner-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .footer-content {
        flex-direction: column;
        gap: 2rem;
        text-align: center;
    }
}
