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

:root {
    /* Green & White Code Vibe */
    --primary: #4ADE80;
    --primary-dark: #22C55E;
    --primary-light: #86EFAC;
    --primary-glow: rgba(74, 222, 128, 0.15);
    
    --bg-dark: #0A0F0A;
    --bg-card: #0F1A0F;
    --bg-card-hover: #142014;
    --bg-terminal: #0D120D;
    
    --text-primary: #F0FDF4;
    --text-secondary: #A7F3D0;
    --text-muted: #6EE7A0;
    
    --border: #1F3D1F;
    --border-light: #2D5A2D;
    
    --yes-color: #4ADE80;
    --no-color: #F87171;
    --yes-bg: rgba(74, 222, 128, 0.12);
    --no-bg: rgba(248, 113, 113, 0.12);
    
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

body {
    font-family: var(--font-sans);
    background: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.5;
    background-image: 
        radial-gradient(ellipse at top, rgba(74, 222, 128, 0.03) 0%, transparent 50%),
        radial-gradient(ellipse at bottom, rgba(74, 222, 128, 0.02) 0%, transparent 50%);
}

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

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

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

.logo-img {
    width: 36px;
    height: 36px;
    object-fit: contain;
}

.logo-text {
    font-family: var(--font-mono);
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.logo-dot {
    color: var(--primary);
}

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

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 500;
    font-size: 14px;
    font-family: var(--font-mono);
    transition: all 0.2s;
    border: 1px solid transparent;
}

.nav-link:hover {
    color: var(--text-primary);
    background: var(--primary-glow);
    border-color: var(--border);
}

.nav-link.active {
    color: var(--primary);
    background: var(--yes-bg);
    border-color: var(--border-light);
}

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

.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 12px;
    width: 16px;
    height: 16px;
    color: var(--text-muted);
}

.search-input {
    background: var(--bg-terminal);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 10px 16px 10px 38px;
    color: var(--text-primary);
    font-size: 13px;
    font-family: var(--font-mono);
    width: 220px;
    outline: none;
    transition: all 0.2s;
}

.search-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.search-input::placeholder {
    color: var(--text-muted);
    opacity: 0.6;
}

.wallet-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--primary);
    color: var(--bg-dark);
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 13px;
    font-family: var(--font-mono);
    cursor: pointer;
    transition: all 0.2s;
}

.wallet-btn:hover {
    background: var(--primary-light);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(74, 222, 128, 0.3);
}

.wallet-btn.connected {
    background: var(--bg-terminal);
    color: var(--primary);
    border: 1px solid var(--primary);
}

.sol-icon {
    width: 18px;
    height: 18px;
    border-radius: 50%;
}

/* Hero */
.hero {
    background: var(--bg-card);
    padding: 48px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(74, 222, 128, 0.02) 2px,
            rgba(74, 222, 128, 0.02) 4px
        );
    pointer-events: none;
}

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

.hero-content h1 {
    font-family: var(--font-mono);
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.hero-content h1::before {
    content: '> ';
    color: var(--primary);
}

.hero-content p {
    color: var(--text-secondary);
    font-size: 16px;
    font-family: var(--font-mono);
    opacity: 0.8;
}

.hero-stats {
    display: flex;
    gap: 48px;
    position: relative;
    z-index: 1;
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    padding: 16px 24px;
    background: var(--bg-terminal);
    border: 1px solid var(--border);
    border-radius: 8px;
}

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

.stat-label {
    font-size: 12px;
    font-family: var(--font-mono);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Categories */
.categories {
    padding: 20px 32px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
}

.category-tabs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.category-tab {
    background: var(--bg-terminal);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 8px 20px;
    border-radius: 4px;
    font-size: 13px;
    font-family: var(--font-mono);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.category-tab:hover {
    border-color: var(--primary);
    color: var(--text-primary);
}

.category-tab.active {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--bg-dark);
}

/* Markets Grid */
.markets-container {
    padding: 32px;
    max-width: 1400px;
    margin: 0 auto;
}

.markets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 16px;
}

/* Market Card */
.market-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.market-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background: var(--primary);
    border-radius: 8px 0 0 8px;
    opacity: 0;
    transition: opacity 0.2s;
}

.market-card:hover {
    border-color: var(--border-light);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.market-card:hover::before {
    opacity: 1;
}

.market-header {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.market-icon {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    object-fit: cover;
    background: var(--bg-terminal);
    border: 1px solid var(--border);
}

.market-icon-text {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    background: var(--bg-terminal);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 14px;
    color: var(--primary);
}

.market-info {
    flex: 1;
}

.market-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
    line-height: 1.4;
    color: var(--text-primary);
}

.market-meta {
    display: flex;
    gap: 12px;
    font-size: 11px;
    font-family: var(--font-mono);
    color: var(--text-muted);
}

.market-volume {
    color: var(--primary);
}

.market-outcomes {
    display: flex;
    gap: 10px;
    margin-bottom: 14px;
}

.outcome {
    flex: 1;
    padding: 10px 12px;
    border-radius: 6px;
    text-align: center;
    font-weight: 600;
    transition: all 0.2s;
    font-family: var(--font-mono);
}

.outcome.yes {
    background: var(--yes-bg);
    color: var(--yes-color);
    border: 1px solid transparent;
}

.outcome.yes:hover {
    border-color: var(--yes-color);
}

.outcome.no {
    background: var(--no-bg);
    color: var(--no-color);
    border: 1px solid transparent;
}

.outcome.no:hover {
    border-color: var(--no-color);
}

.outcome-label {
    display: block;
    font-size: 10px;
    margin-bottom: 2px;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.outcome-value {
    font-size: 18px;
}

.market-bar {
    height: 4px;
    background: var(--no-bg);
    border-radius: 2px;
    overflow: hidden;
}

.market-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-dark), var(--primary));
    border-radius: 2px;
    transition: width 0.3s;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    backdrop-filter: blur(4px);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    width: 100%;
    max-width: 420px;
    transform: translateY(20px);
    transition: transform 0.3s;
}

.modal-overlay.active .modal {
    transform: translateY(0);
}

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

.modal-header h3 {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
    padding-right: 16px;
    color: var(--text-primary);
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    transition: color 0.2s;
    font-family: var(--font-mono);
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 20px;
}

.outcome-selector {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.outcome-btn {
    flex: 1;
    padding: 14px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-terminal);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.outcome-btn .outcome-label {
    font-size: 12px;
    font-weight: 600;
    font-family: var(--font-mono);
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.outcome-btn .outcome-price {
    font-size: 22px;
    font-weight: 700;
    font-family: var(--font-mono);
}

.outcome-btn.yes .outcome-price {
    color: var(--yes-color);
}

.outcome-btn.no .outcome-price {
    color: var(--no-color);
}

.outcome-btn.yes.active {
    border-color: var(--yes-color);
    background: var(--yes-bg);
}

.outcome-btn.no.active {
    border-color: var(--no-color);
    background: var(--no-bg);
}

.amount-input {
    margin-bottom: 20px;
}

.amount-input label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    font-family: var(--font-mono);
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.input-wrapper {
    position: relative;
}

.input-wrapper input {
    width: 100%;
    background: var(--bg-terminal);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 14px;
    font-size: 20px;
    font-weight: 600;
    font-family: var(--font-mono);
    color: var(--text-primary);
    outline: none;
    transition: all 0.2s;
}

.input-wrapper input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.quick-amounts {
    display: flex;
    gap: 6px;
    margin-top: 10px;
}

.quick-amt {
    flex: 1;
    padding: 8px;
    background: var(--bg-terminal);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    font-family: var(--font-mono);
    cursor: pointer;
    transition: all 0.2s;
}

.quick-amt:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.trade-summary {
    background: var(--bg-terminal);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 14px;
    margin-bottom: 20px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    font-family: var(--font-mono);
    padding: 6px 0;
}

.summary-row:first-child {
    padding-top: 0;
}

.summary-row:last-child {
    padding-bottom: 0;
}

.summary-row span:first-child {
    color: var(--text-muted);
}

.summary-row span:last-child {
    font-weight: 600;
    color: var(--primary);
}

.trade-btn {
    width: 100%;
    padding: 14px;
    background: var(--primary);
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    font-family: var(--font-mono);
    color: var(--bg-dark);
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.trade-btn:hover {
    background: var(--primary-light);
    box-shadow: 0 4px 16px rgba(74, 222, 128, 0.3);
}

.trade-btn:disabled {
    background: var(--border);
    color: var(--text-muted);
    cursor: not-allowed;
    box-shadow: none;
}

/* Footer */
.footer {
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    padding: 32px;
    margin-top: 64px;
}

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

.footer-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 16px;
    font-family: var(--font-mono);
    color: var(--text-primary);
}

.footer-logo {
    width: 28px;
    height: 28px;
}

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

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 13px;
    font-family: var(--font-mono);
    transition: color 0.2s;
}

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

.footer-disclaimer {
    color: var(--text-muted);
    font-size: 11px;
    font-family: var(--font-mono);
    opacity: 0.7;
}

/* Responsive */
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 16px;
        padding: 16px;
    }
    
    .header-left {
        flex-direction: column;
        gap: 16px;
        width: 100%;
    }
    
    .header-right {
        width: 100%;
        justify-content: space-between;
    }
    
    .search-input {
        width: 100%;
    }
    
    .hero {
        flex-direction: column;
        gap: 32px;
        text-align: center;
        padding: 32px 16px;
    }
    
    .hero-content h1 {
        font-size: 24px;
    }
    
    .hero-stats {
        gap: 16px;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .stat {
        align-items: center;
    }
    
    .categories {
        padding: 16px;
    }
    
    .markets-container {
        padding: 16px;
    }
    
    .markets-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        flex-direction: column;
        text-align: center;
    }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* Selection */
::selection {
    background: var(--primary);
    color: var(--bg-dark);
}
