/* GSF Portfolio - Main Stylesheet */

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 25px;
}

h1 {
    color: #1a1a2e;
    margin-bottom: 25px;
    font-size: 28px;
    font-weight: 600;
}

h2 {
    color: #1a1a2e;
    margin-bottom: 20px;
    font-size: 20px;
    font-weight: 600;
}

/* Cards */
.card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    padding: 25px;
    margin-bottom: 25px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a2e;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.12);
}

.stat-card .value {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 8px;
}

.stat-card .label {
    font-size: 13px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-card.primary {
    background: linear-gradient(135deg, #4CAF50 0%, #2E7D32 100%);
    color: white;
}

.stat-card.primary .label {
    color: rgba(255,255,255,0.85);
}

/* Performance colors */
.positive {
    color: #2E7D32;
}

.negative {
    color: #C62828;
}

/* Tables */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.data-table th {
    background: #f8f9fa;
    font-weight: 600;
    font-size: 13px;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.data-table tbody tr:hover {
    background: #f8fdf8;
}

.data-table .text-right {
    text-align: right;
}

.data-table .text-center {
    text-align: center;
}

/* Performance Table (Monthly) */
.perf-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.perf-table th,
.perf-table td {
    padding: 10px 8px;
    text-align: center;
    border: 1px solid #e0e0e0;
}

.perf-table th {
    background: #1a1a2e;
    color: white;
    font-weight: 500;
}

.perf-table th.year-col {
    background: #16213e;
    font-weight: 700;
}

.perf-table td.year-col {
    background: #f8f9fa;
    font-weight: 600;
}

.perf-table td.positive {
    background: rgba(76, 175, 80, 0.15);
}

.perf-table td.negative {
    background: rgba(198, 40, 40, 0.1);
}

.perf-table td.total-col {
    background: #e8f5e9;
    font-weight: 600;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

.badge-sector {
    background: #e3f2fd;
    color: #1565c0;
}

.badge-industry {
    background: #f3e5f5;
    color: #7b1fa2;
}

/* Charts container */
.chart-container {
    position: relative;
    height: 350px;
    margin-top: 20px;
}

/* Trailing returns grid */
.returns-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
}

.return-item {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
}

.return-item .period {
    font-size: 12px;
    color: #666;
    margin-bottom: 5px;
}

.return-item .value {
    font-size: 20px;
    font-weight: 700;
}

/* Allocation cards */
.allocation-card {
    display: flex;
    align-items: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 10px;
    transition: background 0.2s;
}

.allocation-card:hover {
    background: #f0f4f0;
}

.allocation-card .ticker {
    font-weight: 700;
    font-size: 16px;
    color: #1a1a2e;
    width: 80px;
}

.allocation-card .name {
    flex: 1;
    color: #555;
    font-size: 14px;
}

.allocation-card .weight {
    width: 80px;
    text-align: right;
    font-weight: 600;
    color: #1a1a2e;
}

.allocation-card .performance {
    width: 100px;
    text-align: right;
    font-weight: 600;
}

/* Weight bar */
.weight-bar {
    width: 100px;
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    margin-right: 15px;
}

.weight-bar .fill {
    height: 100%;
    background: linear-gradient(90deg, #4CAF50, #81C784);
    border-radius: 4px;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .stat-card .value {
        font-size: 24px;
    }

    .data-table {
        font-size: 13px;
    }

    .data-table th,
    .data-table td {
        padding: 10px 8px;
    }
}

/* Loading skeleton */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 4px;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Last update */
.last-update {
    font-size: 12px;
    color: #888;
    text-align: right;
    margin-top: 10px;
}
