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

:root {
    --bg: #fafafa;
    --card: #ffffff;
    --border: #e8e8e8;
    --text: #1a1a1a;
    --text-secondary: #666;
    --text-muted: #999;
    --green: #16a34a;
    --green-light: #f0fdf4;
    --red: #dc2626;
    --red-light: #fef2f2;
    --accent: #7c3aed;
    --accent-light: #f5f3ff;
    --mono: 'JetBrains Mono', monospace;
}

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

body {
    font-family: 'Space Grotesk', -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 820px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Hero */
.hero {
    padding: 5rem 0 3rem;
    text-align: center;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    background: var(--accent-light);
    color: var(--accent);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    border-radius: 100px;
    margin-bottom: 2rem;
}

.hero-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    background: var(--accent);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

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

.hero-title {
    font-size: 3.2rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.1;
    margin-bottom: 1rem;
}

.hero-title span {
    background: linear-gradient(135deg, #7c3aed, #2563eb);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 480px;
    margin: 0 auto 2rem;
    font-weight: 400;
    line-height: 1.7;
}

.hero-tags {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.hero-tag {
    padding: 4px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.78rem;
    color: var(--text-secondary);
    font-family: var(--mono);
}

/* Stats */
.stats-bar {
    padding: 0 0 2rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    background: var(--border);
    border-radius: 12px;
    overflow: hidden;
}

.stat-card {
    background: var(--card);
    text-align: center;
    padding: 1.5rem 1rem;
}

.stat-label {
    font-size: 0.68rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.5rem;
    font-family: var(--mono);
}

.stat-value {
    font-size: 1.4rem;
    font-weight: 700;
    font-family: var(--mono);
    letter-spacing: -0.02em;
}

/* Sections */
.section {
    padding: 1.5rem 0;
}

.section-title {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: 1rem;
    font-family: var(--mono);
}

/* Cards */
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
}

/* Chart */
.chart-container {
    position: relative;
    height: 280px;
}

/* Holdings Table */
.holdings-table {
    width: 100%;
    border-collapse: collapse;
    font-family: var(--mono);
    font-size: 0.85rem;
}

.holdings-table th {
    text-align: left;
    padding: 0.5rem 0.75rem;
    font-size: 0.68rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-bottom: 1px solid var(--border);
    font-weight: 500;
}

.holdings-table td {
    padding: 0.65rem 0.75rem;
    border-bottom: 1px solid #f3f3f3;
}

.holdings-table tr:last-child td {
    border-bottom: none;
}

/* Trades */
.trade-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid #f3f3f3;
    font-family: var(--mono);
    font-size: 0.85rem;
}

.trade-item:last-child {
    border-bottom: none;
}

.trade-badge {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.04em;
}

.trade-buy { background: var(--green-light); color: var(--green); }
.trade-sell { background: var(--red-light); color: var(--red); }

.trade-info { flex: 1; }

.trade-ticker {
    font-weight: 600;
    color: var(--text);
}

.trade-details {
    color: var(--text-muted);
    font-size: 0.78rem;
}

.trade-time {
    font-size: 0.72rem;
    color: var(--text-muted);
}

/* Journal Entries */
.journal-entry {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 0.75rem;
    transition: box-shadow 0.2s;
}

.journal-entry:hover {
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
}

.journal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #f3f3f3;
}

.journal-entry-title {
    display: block;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    text-decoration: none;
    margin-bottom: 0.2rem;
    transition: color 0.15s;
}

.journal-entry-title:hover {
    color: var(--accent);
}

.journal-time {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-family: var(--mono);
}

.journal-summary {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1rem;
    padding-left: 0.75rem;
    border-left: 3px solid var(--accent);
}

.journal-market-badge {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.68rem;
    font-weight: 600;
    font-family: var(--mono);
}

.market-open { background: var(--green-light); color: var(--green); }
.market-closed { background: #f5f5f5; color: var(--text-muted); }

.journal-section {
    margin-bottom: 1rem;
}

.journal-section:last-child {
    margin-bottom: 0;
}

.journal-section-title {
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.35rem;
    font-family: var(--mono);
}

.journal-section-content {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.75;
    white-space: pre-wrap;
}

.journal-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.4rem;
}

.action-tag {
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 600;
    font-family: var(--mono);
}

.action-buy { background: var(--green-light); color: var(--green); }
.action-sell { background: var(--red-light); color: var(--red); }
.action-hold { background: var(--accent-light); color: var(--accent); }
.action-watch { background: #fffbeb; color: #d97706; }

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.4rem;
    margin-top: 1.5rem;
}

.page-btn {
    padding: 6px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--card);
    color: var(--text-secondary);
    font-family: var(--mono);
    font-size: 0.78rem;
    cursor: pointer;
    transition: all 0.15s;
}

.page-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.page-btn.active {
    background: var(--text);
    color: white;
    border-color: var(--text);
}

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

.page-info {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-family: var(--mono);
    padding: 0 0.5rem;
}

/* Suggestion Box */
.suggestion-section {
    padding-bottom: 1rem;
}

.suggestion-desc {
    color: var(--text-muted);
    font-size: 0.88rem;
    margin-bottom: 1.25rem;
}

.input-field {
    width: 100%;
    padding: 0.7rem 0.9rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-family: inherit;
    font-size: 0.88rem;
    margin-bottom: 0.6rem;
    outline: none;
    transition: border-color 0.2s;
}

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

.textarea {
    min-height: 80px;
    resize: vertical;
}

.submit-btn {
    padding: 0.6rem 1.5rem;
    background: var(--text);
    color: white;
    border: none;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}

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

.suggestion-status {
    margin-top: 0.5rem;
    font-size: 0.82rem;
}

.suggestions-list {
    margin-top: 1.25rem;
}

.suggestion-item {
    padding: 0.9rem;
    background: var(--bg);
    border-radius: 8px;
    margin-bottom: 0.5rem;
}

.suggestion-item-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.35rem;
}

.suggestion-item-name {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.suggestion-item-time {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-family: var(--mono);
}

.suggestion-item-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.suggestion-ai-response {
    margin-top: 0.6rem;
    padding: 0.75rem;
    background: var(--accent-light);
    border-radius: 8px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.ai-badge {
    display: inline-block;
    padding: 1px 6px;
    background: var(--accent);
    color: white;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 700;
    font-family: var(--mono);
    letter-spacing: 0.03em;
    margin-right: 0.4rem;
    vertical-align: middle;
}

.suggestion-pending {
    margin-top: 0.4rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-style: italic;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 2.5rem 1rem;
    color: var(--text-muted);
    font-size: 0.88rem;
}

/* Footer */
.footer {
    text-align: center;
    padding: 2rem 0;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.82rem;
}

.footer-sub {
    margin-top: 0.2rem;
    font-size: 0.72rem;
}

/* P&L colors */
.positive { color: var(--green); }
.negative { color: var(--red); }
.neutral { color: var(--text-secondary); }

/* Responsive */
@media (max-width: 640px) {
    .hero { padding: 3rem 0 2rem; }
    .hero-title { font-size: 2.2rem; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .stat-value { font-size: 1.1rem; }
    .container { padding: 0 1rem; }
}

/* Selection */
::selection {
    background: var(--accent-light);
    color: var(--accent);
}
