.dashboard-container {
    padding: 40px 10%;
}

.dashboard-header {
    margin-bottom: 40px;
}

.dashboard-header .subtitle {
    color: var(--accent-green);
    font-weight: 500;
    margin-top: 8px;
}

.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

.stat-box {
    text-align: center;
}

.stat-box h3 {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.stat-value {
    font-size: 2.5rem;
    font-family: 'Space Grotesk', sans-serif;
    color: var(--text-primary);
    font-weight: 700;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

.progress-bar-bg {
    width: 100%;
    height: 8px;
    background-color: var(--bg-tertiary);
    border-radius: 4px;
    margin-top: 16px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background-color: var(--accent-green);
    width: 0%;
    transition: width 1s ease-in-out;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 24px;
    margin-bottom: 40px;
}

.difficulty-stats {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 24px;
}

.diff-block {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background-color: var(--bg-tertiary);
    border-radius: var(--border-radius-sm);
}

.activity-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.contribution-count {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.activity-wrapper {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

.activity-main {
    flex: 1;
    min-width: 0;
    /* Critical for grid overflow */
}

.month-labels {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    margin-left: 40px;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-size: 0.75rem;
}

.activity-grid-container {
    display: flex;
    gap: 10px;
}

.day-labels {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 10px 0;
    font-size: 0.75rem;
    color: var(--text-secondary);
    height: 110px;
    /* Adjust based on cell height * 7 + gaps */
}

.heatmap-container {
    display: grid;
    grid-template-rows: repeat(7, 14px);
    grid-auto-flow: column;
    grid-auto-columns: 14px;
    gap: 3px;
    overflow-x: visible;
    /* Prevent tooltip clipping */
    padding-bottom: 10px;
}

.heat-cell {
    width: 14px;
    height: 14px;
    background-color: var(--bg-tertiary);
    border-radius: 2px;
    position: relative;
    cursor: pointer;
}

.heat-cell:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-5px);
    background: #161b22;
    color: #fff;
    border: 1px solid var(--border);
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    white-space: nowrap;
    z-index: 1000;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.activity-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
    font-size: 0.75rem;
}

.learn-link {
    color: var(--text-secondary);
    text-decoration: none;
}

.legend {
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--text-secondary);
}

.year-sidebar {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.year-btn {
    padding: 8px 16px;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 6px;
    text-align: left;
    font-size: 0.9rem;
    transition: 0.2s;
}

.year-btn:hover {
    background: var(--bg-tertiary);
}

.year-btn.active {
    background: var(--accent-green);
    color: #000;
    font-weight: 600;
}

/* Colors for heatmap */
.heat-0 {
    background-color: #161b22;
}

.heat-1 {
    background-color: #0e4429;
}

.heat-2 {
    background-color: #006d32;
}

.heat-3 {
    background-color: #26a641;
}

.heat-4 {
    background-color: #39d353;
}

.badges-section {
    margin-bottom: 40px;
}

.badges-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-top: 24px;
}

.badge-card {
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--border-radius-md);
    padding: 24px;
    text-align: center;
    transition: 0.3s;
}

.badge-earned {
    border-color: var(--accent-yellow-alpha);
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.1);
}

.badge-card.unearned {
    opacity: 0.4;
    filter: grayscale(1);
}

.badge-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
}

.badge-card h4 {
    font-size: 1rem;
    margin-bottom: 8px;
}

.badge-card p {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* MOBILE RESPONSIVENESS */
@media (max-width: 900px) {
    .dashboard-container {
        padding: 40px 5%;
    }

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

    .activity-wrapper {
        flex-direction: column-reverse;
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    .activity-section {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    .year-sidebar {
        flex-direction: row;
        overflow-x: auto;
        width: 100%;
        padding-bottom: 8px;
    }

    .activity-main {
        overflow-x: auto;
        padding-bottom: 16px;
        width: 100%;
        max-width: 100%;
    }

    .activity-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .activity-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

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

@media (max-width: 480px) {
    .stats-row {
        grid-template-columns: 1fr;
    }

    .month-labels {
        font-size: 0.65rem;
    }

    .heat-cell {
        width: 12px;
        height: 12px;
    }
}