:root {
    --bg-color: #0d1117;
    /* Deep matte black/blue */
    --card-bg: #161b22;
    /* Dark slate */
    --border-color: #30363d;
    /* Subtle borders */
    --text-primary: #e6edf3;
    --text-secondary: #8b949e;

    /* Professional Status Colors */
    --accent-blue: #2f81f7;
    /* GitHub/Professional Blue */
    --accent-green: #238636;
    /* Muted Success Green */
    --accent-red: #da3633;
    /* Muted Error Red */
    --accent-subtle: #58a6ff;

    --font-mono: 'JetBrains Mono', 'SF Mono', 'Segoe UI Mono', 'Roboto Mono', monospace;
    --font-std: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

    --radius-sm: 4px;
    --radius-md: 6px;
}

/* Global Reset */
* {
    box-sizing: border-box;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-std);
    margin: 0;
    padding: 0;
    line-height: 1.6;
    /* Increased for better readability */
    -webkit-font-smoothing: antialiased;
    font-size: 16px;
    /* Base size */
}

h1,
h2,
h3,
h4,
.brand-title,
.logo,
.value,
th,
td {
    font-family: var(--font-std);
    /* Keep titles clean sans-serif */
}

/* Login Overlay - Professional Splash */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-color);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.login-box {
    background: var(--card-bg);
    padding: 3rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    text-align: center;
    max-width: 480px;
    width: 100%;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.brand-title {
    font-size: 2rem;
    margin: 0 0 0.5rem 0;
    color: var(--text-primary);
    font-weight: 700;
    letter-spacing: -0.5px;
}

.brand-tagline {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-style: italic;
    margin-bottom: 2rem;
    line-height: 1.4;
}

.login-separator {
    height: 1px;
    background: var(--border-color);
    margin: 1.5rem 0;
    width: 100%;
}

.login-instruction {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.login-box input {
    width: 100%;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 12px;
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    margin-bottom: 1rem;
    outline: none;
    transition: border-color 0.2s;
}

.login-box input:focus {
    border-color: var(--accent-blue);
}

.login-box button {
    width: 100%;
    background: var(--text-primary);
    color: var(--bg-color);
    border: none;
    padding: 12px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}

.login-box button:hover {
    opacity: 0.9;
}

.error-msg {
    color: var(--accent-red);
    font-size: 0.85rem;
    margin-top: 1rem;
    min-height: 1.2em;
}

/* Dashboard Structure */
.dashboard {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px;
    opacity: 0;
    /* Handled by fade-in */
}

.dashboard:not(.hidden) {
    opacity: 1;
    transition: opacity 0.6s ease-out;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 40px;
}

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

.version {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 400;
    margin-left: 8px;
    font-family: var(--font-mono);
    background: var(--border-color);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
}

.tagline {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* Controls */
.controls {
    display: flex;
    gap: 16px;
    align-items: flex-end;
}

.input-group label {
    display: block;
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 6px;
    font-family: var(--font-mono);
    letter-spacing: 0.5px;
}

.input-group input {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 0.85rem;
}

#run-btn {
    background: linear-gradient(135deg, var(--accent-blue), #1a6fe9);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 6px rgba(47, 129, 247, 0.2);
    min-width: 140px;
    text-align: center;
}

#run-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 12px rgba(47, 129, 247, 0.3);
    filter: brightness(1.1);
}

#run-btn:active {
    transform: translateY(1px);
    box-shadow: 0 2px 4px rgba(47, 129, 247, 0.2);
}

/* Strategy Description - "Bloomberg Report" Style */
.strategy-info {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 40px;
    margin-bottom: 40px;
}

.strategy-info h1 {
    font-size: 1.25rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.highlight-text {
    font-size: 1.1rem;
    line-height: 1.7;
    color: var(--text-primary);
    margin-bottom: 30px;
    max-width: 900px;
}

.highlight-text strong {
    color: #fff;
    font-weight: 600;
}

.separator {
    border: 0;
    border-top: 1px solid var(--border-color);
    margin: 30px 0;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.info-card h2,
.pros-col h2,
.cons-col h2 {
    font-size: 0.85rem;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 15px;
    letter-spacing: 0.5px;
    border-left: 3px solid var(--accent-blue);
    padding-left: 10px;
}

.cons-col h2 {
    border-left-color: var(--accent-secondary);
}

/* Just use blue for all headers for consistency */

.info-card ul,
.pros-col ul,
.cons-col ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.info-card li,
.pros-col li,
.cons-col li {
    font-size: 0.9rem;
    margin-bottom: 10px;
    padding-left: 15px;
    position: relative;
    color: var(--text-primary);
}

.info-card li::before,
.pros-col li::before,
.cons-col li::before {
    content: "›";
    position: absolute;
    left: 0;
    color: var(--accent-blue);
    font-weight: bold;
}

.cross-list li::before {
    content: "×";
    color: var(--text-secondary);
}

.pros-cons-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

/* Metrics - Financial Dashboard Style */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 30px;
}

.metric-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 16px;
    transition: border-color 0.2s;
}

.metric-card:hover {
    border-color: var(--accent-subtle);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.metric-card h3 {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    margin-top: 0;
    margin-bottom: 12px;
    letter-spacing: 0.5px;
}

.metric-compare div {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 0.9rem;
    margin-bottom: 4px;
}

.metric-compare .label {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.value {
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: 1.1rem;
    /* Slightly larger values */
}

.value.strat {
    color: var(--accent-blue);
}

.value.bh {
    color: var(--text-secondary);
}

/* Charts */
.charts-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 40px;
}

.chart {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 20px;
    min-height: 500px;
    /* Restored height for proper visibility */
}

/* Positions Table - Data Terminal Look */
.positions-container {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0;
    /* Flush table */
    overflow: hidden;
}

.positions-container h3 {
    padding: 15px 20px;
    margin: 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
    text-transform: uppercase;
    color: var(--text-primary);
}

.table-wrapper {
    max-height: 500px;
    overflow-y: auto;
    overflow-x: auto;
    /* Enable horizontal scroll */
}

table {
    width: 100%;
    border-collapse: collapse;
    font-family: var(--font-mono);
    font-size: 0.8rem;
}

th {
    background: var(--bg-color);
    color: var(--text-secondary);
    font-weight: 600;
    text-align: right;
    padding: 10px 20px;
    position: sticky;
    top: 0;
    border-bottom: 1px solid var(--border-color);
}

th:first-child {
    text-align: left;
}

td {
    padding: 8px 20px;
    border-bottom: 1px solid var(--border-color);
    text-align: right;
    color: var(--text-primary);
}

td:first-child {
    text-align: left;
    color: var(--text-secondary);
}

tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

.text-green {
    color: var(--accent-green);
}

.text-red {
    color: var(--accent-red);
}

/* Utilities */
.hidden {
    display: none !important;
}

.fade-in {
    animation: fadeIn 0.4s ease-out forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Logo Pulse Animation */
/* Logo Pulse Animation */
@keyframes ripple {
    0% {
        width: 0;
        height: 0;
        opacity: 0.8;
        border-width: 2px;
    }

    100% {
        width: 200%;
        height: 200%;
        opacity: 0;
        border-width: 0px;
    }
}

.logo-container {
    position: relative;
    display: inline-block;
    margin-bottom: 20px;
    padding: 10px;
}

.brand-logo {
    height: 60px;
    width: auto;
    display: block;
    position: relative;
    z-index: 2;
}

.blip-pulse {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: transparent;
    z-index: 1;
}

.blip-pulse::before,
.blip-pulse::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 1px solid var(--accent-blue);
    opacity: 0;
    box-shadow: 0 0 10px var(--accent-blue);
    animation: ripple 2.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) infinite;
}

.blip-pulse::after {
    animation-delay: 1.25s;
}

/* --- Chart Toggle Button --- */
.chart-wrapper {
    position: relative;
    width: 100%;
}

.chart-toggle-btn {
    position: absolute;
    top: 10px;
    left: 60px;
    z-index: 9999;
    background: rgba(30, 41, 59, 0.9);
    color: var(--text-muted);
    border: 1px solid var(--border-color);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: block;
}

.chart-toggle-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.chart-toggle-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* --- Market Simulation Animation --- */
.simulation-container {
    position: relative;
    width: 100%;
    height: 250px;
    /* Grid Background */
    background-color: var(--card-bg);
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 40px 40px;
    /* Grid Size */
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.5);
}

#market-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* --- TERMINAL STYLE OVERLAY --- */
.sim-overlay {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 5;
    text-align: left;
    pointer-events: none;
    font-family: var(--font-mono);
    /* Monospace */
}

#sim-status {
    font-size: 0.85rem;
    /* Small & Sharp */
    font-weight: 500;
    letter-spacing: 0.5px;
    color: var(--text-primary);
    text-transform: uppercase;

    /* Remove 'Box' styling, make it raw text */
    text-shadow: none;
    background: transparent;
    padding: 0;
    border: none;
}

#sim-status.blip-detected {
    color: #22d3ee;
    /* Cyan - Tech/Neutral */
    border-color: transparent;
    font-size: 0.85rem;
    animation: none;
    /* No pulse, just static terminal text or blink cursor if desired */
}

/* Add a blink cursor effect optionally? Let's keep it simple first as requested */

.blip-marker {
    position: absolute;
    width: 20px;
    height: 20px;
    background: #22d3ee;
    /* Cyan */
    border-radius: 50%;
    z-index: 4;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 20px #22d3ee;
    pointer-events: none;
    /* Ensure no interaction */
}

.blip-marker::before,
.blip-marker::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 1px solid #22d3ee;
    animation: ripple 1.5s infinite ease-out;
}

.blip-marker::after {
    animation-delay: 0.5s;
}

/* Header Alignment */
.header-content {
    display: flex;
    flex-direction: column;
}

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

.mini-logo {
    height: 40px;
    width: auto;
}

.logo-text {
    display: flex;
    flex-direction: column;
}

/* Download Button (Ghost Style) */
.icon-btn {
    text-decoration: none;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s;
    background: transparent;
    display: flex;
    align-items: center;
    gap: 8px;
    height: 38px;
    /* Match inputs */
}

.icon-btn:hover {
    color: var(--accent-blue);
    border-color: var(--accent-blue);
    background: rgba(47, 129, 247, 0.1);
}

/* Footer Attribution */
.footer-note {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.6;
    margin-top: 20px;
    text-align: center;
}

footer {
    padding-top: 40px;
    border-top: 1px solid var(--border-color);
    margin-top: 40px;
    display: flex;
    justify-content: center;
}

/* Responsive (Tablet/Small Desktop) */
@media (max-width: 900px) {
    .info-grid {
        grid-template-columns: 1fr;
    }

    .pros-cons-grid {
        grid-template-columns: 1fr;
    }
}

/* --- FAQ SECTION (Box Style) --- */
.faq-container {
    max-width: 900px;
    margin: 80px auto 40px auto;
    /* Increased margin */

    /* Box Styling */
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 30px;
    /* Internal Padding */
}

.faq-item {
    border-bottom: 1px solid var(--border-color);
}

.faq-item:last-child {
    border-bottom: none;
    /* Clean look */
}

.faq-question {
    padding: 20px 0;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-primary);
    transition: color 0.2s;
}

.faq-question:hover {
    color: var(--accent-blue);
}

.faq-question .icon {
    font-size: 1.2rem;
    color: var(--text-secondary);
    transition: transform 0.3s ease;
}

.faq-item.active .faq-question .icon {
    transform: rotate(45deg);
    color: var(--accent-blue);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-out;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.faq-answer p {
    margin: 0 0 15px 0;
}

.faq-answer ul {
    margin: 0 0 15px 20px;
    padding: 0;
}

.tldr {
    background: rgba(47, 129, 247, 0.1);
    border-left: 3px solid var(--accent-blue);
    padding: 10px 15px;
    margin-bottom: 20px;
    font-size: 0.85rem;
    color: var(--text-primary);
}

/* --- MOBILE OPTIMIZATION (Phone) --- */
@media (max-width: 600px) {
    .dashboard {
        padding: 20px;
    }

    header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .logo-wrapper {
        width: 100%;
        justify-content: center;
        flex-direction: column;
        /* Stack logo specific content */
        gap: 10px;
    }

    .logo-text,
    .version,
    .tagline {
        text-align: center;
    }

    /* Reveal Download Button on Mobile */
    .icon-btn {
        display: flex;
        /* Was none */
        width: 100%;
        justify-content: center;
        margin-top: 10px;
        background: rgba(47, 129, 247, 0.1);
        /* Make it pop slightly */
    }

    .controls {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        gap: 10px;
    }

    .input-group input {
        width: 100%;
    }

    #run-btn {
        width: 100%;
        margin-top: 10px;
    }

    .simulation-container {
        height: 200px;
    }

    .sim-overlay {
        top: 10px;
        left: 10px;
    }

    #sim-status {
        font-size: 0.75rem;
    }

    .metrics-grid {
        grid-template-columns: 1fr 1fr;
    }

    .chart {
        padding: 10px;
        min-height: 350px;
    }

    .login-box {
        margin: 20px;
        padding: 2rem;
    }

    .brand-title {
        font-size: 1.5rem;
    }

    .faq-container {
        padding: 20px;
        /* Reduced padding for mobile */
    }
}
/* Monthly Returns Table */
.monthly-table-wrapper {
    margin: 30px 0;
    overflow-x: auto;
    background: rgba(17, 24, 39, 0.4);
    border: 1px solid rgba(75, 85, 99, 0.4);
    border-radius: 8px;
    padding: 10px;
}

#monthly-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.75rem; /* Compact font */
    font-family: 'Inter', sans-serif;
    color: #e2e8f0;
}

#monthly-table th, #monthly-table td {
    padding: 6px 4px;
    text-align: center;
    border: 1px solid rgba(75, 85, 99, 0.3);
}

#monthly-table th {
    background-color: #1e293b;
    font-weight: 600;
    color: #94a3b8;
    position: sticky;
    top: 0;
    z-index: 10;
}

#monthly-table .sticky-col {
    position: sticky;
    left: 0;
    background-color: #0f172a;
    z-index: 20;
    border-right: 2px solid rgba(75, 85, 99, 0.5);
}

#monthly-table td.sticky-col {
    font-weight: bold;
    color: #cbd5e1;
}

/* Color classes for table cells */
.cell-pos-high { background-color: rgba(16, 185, 129, 0.8); color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,0.5); }
.cell-pos-med { background-color: rgba(16, 185, 129, 0.5); color: #fff; }
.cell-pos-low { background-color: rgba(16, 185, 129, 0.2); color: #e2e8f0; }

.cell-neg-high { background-color: rgba(239, 68, 68, 0.8); color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,0.5); }
.cell-neg-med { background-color: rgba(239, 68, 68, 0.5); color: #fff; }
.cell-neg-low { background-color: rgba(239, 68, 68, 0.2); color: #e2e8f0; }

.cell-zero { color: #64748b; }

/* Special columns */
.col-total { font-weight: bold; border-left: 2px solid rgba(75, 85, 99, 0.5); }
.col-benchmark { background-color: #0f172a; }
.col-alpha { font-weight: bold; }
