/* ===================================================================
   fuzzy.fund Dashboard - Clean & Minimalist Design
   =================================================================== */

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-bg: #ffffff;
    --secondary-bg: #f8f9fa;
    --card-bg: #ffffff;
    --text-primary: #1a1a1a;
    --text-secondary: #6c757d;
    --border-color: #e1e4e8;
    --accent-green: #28a745;
    --accent-red: #dc3545;
    --accent-blue: #007bff;
    --accent-orange: #fd7e14;
    --status-active: #28a745;
    --status-inactive: #6c757d;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.12);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--secondary-bg);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

/* ===================================================================
   Header
   =================================================================== */

header {
    background: var(--primary-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
    margin-bottom: 1.5rem;
}

.logo {
    width: 300px;
    height: auto;
    margin-bottom: 0.25rem;
}

header .subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-bottom: 1rem;
}

.last-update {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

#last-update-time {
    font-weight: 600;
    color: var(--text-primary);
}

/* ===================================================================
   Main Content
   =================================================================== */

main {
    flex: 1;
    padding-bottom: 3rem;
}

/* Loading State */
.loading {
    text-align: center;
    padding: 4rem 0;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border-color);
    border-top-color: var(--accent-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

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

.loading p {
    color: var(--text-secondary);
}

/* Error State */
.error {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 2rem;
    text-align: center;
    color: #856404;
}

.hidden {
    display: none;
}

/* ===================================================================
   Dashboard Grid
   =================================================================== */

.dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(600px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

@media (max-width: 768px) {
    .dashboard {
        grid-template-columns: 1fr;
    }
}

/* ===================================================================
   Desk Cards
   =================================================================== */

.desk-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: var(--shadow);
    transition: box-shadow 0.3s ease;
}

.desk-card:hover {
    box-shadow: var(--shadow-hover);
}

.desk-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

.desk-title h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.desk-personality {
    color: var(--text-secondary);
    font-size: 0.875rem;
    display: block;
}

.status-badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.status-badge.active {
    background: rgba(40, 167, 69, 0.1);
    color: var(--status-active);
}

.status-badge.inactive {
    background: rgba(108, 117, 125, 0.1);
    color: var(--status-inactive);
}

/* ===================================================================
   Performance Summary
   =================================================================== */

.performance-summary {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.metric {
    padding: 1rem;
    background: var(--secondary-bg);
    border-radius: 8px;
}

.metric-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    display: block;
}

.metric-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.metric-value.positive {
    color: var(--accent-green);
}

.metric-value.negative {
    color: var(--accent-red);
}

/* ===================================================================
   Charts
   =================================================================== */

.charts-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
    align-items: start;
}

.chart-container {
    background: var(--secondary-bg);
    padding: 1rem;
    border-radius: 8px;
    width: 100%;
    box-sizing: border-box;
}

.chart-container h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    text-align: center;
    color: var(--text-secondary);
}

.chart-container canvas {
    max-height: 200px;
    width: 100%;
}

/* ===================================================================
   Hypothesis Section
   =================================================================== */

.hypothesis-section {
    margin-bottom: 2rem;
}

.hypothesis-section h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.hypothesis-section h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    margin-top: 1.5rem;
    color: var(--text-secondary);
}

.hypothesis-content {
    background: var(--secondary-bg);
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 4px solid var(--accent-blue);
}

.hypothesis-text {
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 0.75rem;
    white-space: pre-wrap;
}

.hypothesis-meta {
    font-size: 0.875rem;
    color: var(--text-secondary);
    display: flex;
    gap: 1rem;
}

.hypothesis-diff {
    margin-top: 1rem;
    padding: 1rem;
    background: #fff9e6;
    border-radius: 8px;
    border-left: 4px solid var(--accent-orange);
}

.hypothesis-diff .hypothesis-text {
    color: var(--text-secondary);
}

/* ===================================================================
   Additional Metrics
   =================================================================== */

.additional-metrics {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 2.5rem;
}

@media (max-width: 768px) {
    .additional-metrics {
        grid-template-columns: repeat(2, 1fr);
    }
}

.metric-small {
    padding: 1rem;
    background: var(--secondary-bg);
    border-radius: 8px;
    text-align: center;
}

.metric-small .metric-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    display: block;
}

.metric-small .metric-value {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* ===================================================================
   Comparison Section
   =================================================================== */

.comparison-section {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.comparison-section h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.comparison-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

@media (max-width: 768px) {
    .comparison-grid {
        grid-template-columns: 1fr;
    }
}

.comparison-metric {
    text-align: center;
    padding: 1.5rem;
    background: var(--secondary-bg);
    border-radius: 8px;
}

.comparison-metric .metric-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.comparison-metric .metric-value {
    font-size: 1.5rem;
    font-weight: 700;
}

/* ===================================================================
   Footer
   =================================================================== */

footer {
    background: var(--primary-bg);
    border-top: 1px solid var(--border-color);
    padding: 2rem 0;
    margin-top: auto;
    text-align: center;
}

footer p {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

footer .disclaimer {
    font-size: 0.75rem;
    font-style: italic;
}

/* ===================================================================
   Utility Classes
   =================================================================== */

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

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

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

/* ===================================================================
   Animations
   =================================================================== */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.desk-card {
    animation: fadeIn 0.5s ease;
}

.desk-card:nth-child(2) {
    animation-delay: 0.1s;
}

