/* General Resets & Body */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: #1a202c;
    color: #e2e8f0;
    line-height: 1.6;
}
.container { max-width: 1400px; margin: 0 auto; padding: 20px; }

/* Header */
.header { background-color: #2d3748; border-radius: 12px; padding: 20px; margin-bottom: 24px; border: 1px solid #4a5568;}
.header-content { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem; }
.title { font-size: 1.8rem; font-weight: 700; color: #fff; }
.etf-toggle { display: flex; background-color: #1a202c; border-radius: 8px; padding: 4px; }
.toggle-btn { padding: 10px 20px; border: none; border-radius: 6px; font-size: 0.9rem; font-weight: 600; cursor: pointer; background: transparent; color: #a0aec0; transition: all 0.3s ease; }
.toggle-btn.active { background-color: #4299e1; color: white; }
.toggle-btn.active.eth { background-color: #667eea; }
.header-stats { display: flex; gap: 24px; align-items: center; }
.stat-item { text-align: right; }
.stat-label { font-size: 0.8rem; color: #a0aec0; }
.stat-value { font-size: 1rem; font-weight: 600; color: #fff; }

/* Summary Cards */
.summary-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; margin-bottom: 24px; }
.card { background-color: #2d3748; border-radius: 12px; padding: 24px; border-left: 4px solid #4299e1; }
.card h3 { font-size: 0.9rem; color: #a0aec0; margin-bottom: 8px; font-weight: 500; }
.metric-value { font-size: 2.2rem; font-weight: 700; color: #fff; }
.metric-change { font-size: 0.8rem; color: #718096; }

/* Table Sections */
.etf-table-section { background-color: #2d3748; border-radius: 12px; padding: 24px; margin-bottom: 24px; }
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.section-header h2 { font-size: 1.5rem; color: #fff; }
.btn-secondary { background-color: #4299e1; color: white; border: none; padding: 10px 16px; border-radius: 8px; cursor: pointer; font-weight: 600; transition: background-color 0.2s; }
.btn-secondary:hover { background-color: #2b6cb0; }
.table-container { overflow-x: auto; }
.etf-table, .flows-table { width: 100%; border-collapse: collapse; }
.etf-table th, .etf-table td, .flows-table th, .flows-table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid #4a5568; white-space: nowrap;}
.etf-table th, .flows-table th { font-size: 0.8rem; color: #a0aec0; text-transform: uppercase; background-color: #1a202c; }
.etf-table tbody tr:hover, .flows-table tbody tr:hover { background-color: #4a5568; }
.price-change.positive, .flow-positive { color: #48bb78; }
.price-change.negative, .flow-negative { color: #f56565; }

/* Historical Flows Table Specifics */
.flows-table { font-family: 'Menlo', 'Monaco', monospace; font-size: 0.9rem; }
.flows-table th, .flows-table td { text-align: right; }
.flows-table th:first-child, .flows-table td:first-child { text-align: left; font-weight: 600; position: sticky; left: 0; background-color: #2d3748; }
.flows-table th.total-col, .flows-table td.total-col { font-weight: bold; background-color: rgba(26, 32, 44, 0.7); }
.flows-table tfoot { border-top: 2px solid #4a5568; font-weight: bold; }

/* Footer */
.footer { text-align: center; margin-top: 40px; padding: 20px; color: #718096; font-size: 0.9rem; }

/* Loading Overlay */
.loading-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background-color: rgba(26, 32, 44, 0.95); display: flex; flex-direction: column; justify-content: center; align-items: center; z-index: 1000; transition: opacity 0.3s ease; }
.loading-overlay.hidden { opacity: 0; pointer-events: none; }
.loading-spinner { width: 50px; height: 50px; border: 4px solid #4a5568; border-left-color: #4299e1; border-radius: 50%; animation: spin 1s linear infinite; margin-bottom: 1rem; }
@keyframes spin { 100% { transform: rotate(360deg); } }

/* Label for table date */
.date-label {
    font-size: 1rem;
    font-weight: 400;
    color: #a0aec0; /* A lighter, less prominent color */
    margin-left: 12px;
}



/* Chart Container */
.chart-container {
    background-color: #2d3748;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
}
.chart-container h3 {
    font-size: 1.5rem;
    color: #fff;
    margin-bottom: 4px;
}
.chart-container .chart-subtitle {
    font-size: 0.9rem;
    color: #a0aec0;
    margin-bottom: 20px;
}

/* Wrapper to control chart height */
.chart-wrapper {
    position: relative;
    height: 400px; /* Puoi cambiare questo valore a tuo piacimento (es. 350px) */
    width: 100%;
}

/* --- New Site Footer Styles --- */
.site-footer {
    border-top: 1px solid #4a5568; /* A line to separate from content */
    padding: 40px 20px;
    margin-top: 40px;
    text-align: center;
}

.footer-content {
    max-width: 800px;
    margin: 0 auto;
}

.footer-tagline {
    font-size: 1.2rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 16px;
}

.footer-tagline .heart {
    color: #e53e3e; /* Red heart */
}

.footer-contact {
    color: #a0aec0;
    margin-bottom: 24px;
}

.footer-contact a {
    color: #4299e1; /* Blue link color */
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease-in-out;
}

.footer-contact a:hover {
    color: #63b3ed; /* Lighter blue on hover */
}

.footer-disclaimer {
    font-size: 0.8rem;
    color: #718096; /* Gray, less prominent color */
    line-height: 1.5;
}