/* ===== Material Design 3 Home / Dashboard - Refined ===== */

/* Typography - Roboto from M3 */
.home-main {
    font-family: var(--md-font);
    padding: 24px;
    min-height: calc(100vh - 70px);
    background: var(--md-surface);
}

/* ===== M3 Hero Section - Floating Container Style ===== */
.md-hero {
    background: var(--md-primary-container);
    border-radius: var(--md-shape-xl);
    padding: 64px 32px 80px;
    text-align: center;
    position: relative;
    margin-bottom: 32px;
    overflow: hidden;
    color: var(--md-on-primary-container);
    box-shadow: var(--md-shadow-1);
    transition: all var(--md-motion-duration-medium) var(--md-motion-easing-standard);
}

.md-hero:hover {
    box-shadow: var(--md-shadow-2);
}

/* Subtle background accent for hero */
.md-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--md-primary) 0%, transparent 70%);
    opacity: 0.15;
    border-radius: 50%;
    pointer-events: none;
}

.md-hero::after {
    content: '';
    position: absolute;
    bottom: -50%;
    left: -20%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--md-tertiary) 0%, transparent 70%);
    opacity: 0.15;
    border-radius: 50%;
    pointer-events: none;
}

.md-hero-content {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.md-hero h1 {
    font-size: 45px;
    /* Display Small */
    font-weight: 400;
    color: var(--md-on-primary-container);
    margin: 0 0 12px;
    line-height: 52px;
}

.md-hero-subtitle {
    font-size: 18px;
    /* Title Medium + */
    color: rgba(var(--md-on-primary-container), 0.8);
    margin: 0 0 32px;
    font-weight: 400;
    line-height: 26px;
}

.md-hero-stats {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.md-stat-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--md-surface);
    color: var(--md-on-surface);
    border-radius: var(--md-shape-sm);
    font-size: 14px;
    font-weight: 500;
    box-shadow: var(--md-shadow-1);
}

.md-stat-chip.accent {
    background: var(--md-tertiary-container);
    color: var(--md-on-tertiary-container);
}

.md-version {
    margin-top: 16px;
    font-size: 12px;
    color: rgba(var(--md-on-primary-container), 0.6);
    font-family: monospace;
}

/* ===== M3 Sections ===== */
.md-section {
    padding: 0 0 32px;
}

.md-section-alt {
    padding: 32px 0;
    margin: 0 -24px;
    /* Breakout of main padding */
    padding-left: 24px;
    padding-right: 24px;
    background: var(--md-surface-container-low);
}

.md-container {
    max-width: 1200px;
    margin: 0 auto;
}

.md-section-title {
    font-size: 24px;
    /* Headline Small */
    font-weight: 400;
    color: var(--md-on-surface);
    margin: 0 0 24px;
    line-height: 32px;
}

/* ===== Bento Grid Redesign ===== */
.bento-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    max-width: 900px;
    /* Keep it focused */
    margin: 0 auto;
}

.bento-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: var(--bg-card);
    /* Glass effect from global */
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 24px;
    text-decoration: none;
    color: var(--md-on-surface);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    overflow: hidden;
    min-height: 180px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02);
}

.bento-card:hover {
    transform: translateY(-4px) scale(1.01);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    border-color: var(--accent);
}

.bento-wide {
    grid-column: span 2;
    min-height: 220px;
    background: var(--bg-card);
    /* Unified background */
}

.bento-content {
    position: relative;
    z-index: 2;
}

.bento-icon-box {
    font-size: 32px;
    margin-bottom: 16px;
    width: 56px;
    height: 56px;
    background: var(--md-surface);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.bento-text h3 {
    font-size: 20px;
    font-weight: 600;
    margin: 0 0 8px;
    color: var(--text-primary);
}

.bento-text p {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.5;
    max-width: 90%;
}

.bento-action {
    margin-top: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 14px;
    color: var(--accent);
}

.bento-action .arrow {
    transition: transform 0.3s ease;
}

.bento-card:hover .bento-action .arrow {
    transform: translateX(4px);
}

/* Unified Theme Hover */
.bento-card:hover {
    background: color-mix(in srgb, var(--accent) 15%, var(--bg-card));
    border-color: var(--accent);
}

/* Mobile */
@media (max-width: 600px) {
    .bento-grid {
        grid-template-columns: 1fr;
    }

    .bento-wide {
        grid-column: span 1;
    }
}

/* ===== M3 Progress Grid ===== */
.md-progress-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
}

.md-progress-content {
    padding: 32px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.md-progress-icon {
    font-size: 40px;
    color: var(--md-primary);
    background: var(--md-surface-container-high);
    padding: 16px;
    border-radius: 50%;
    margin-bottom: 8px;
}

.md-progress-value {
    font-size: 45px;
    /* Display Medium */
    font-weight: 400;
    color: var(--md-on-surface);
    line-height: 52px;
}

.md-progress-label {
    font-size: 16px;
    color: var(--md-on-surface-variant);
}

/* ===== Home Changelog Banner ===== */
.update-banner-card {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    padding: 16px 18px;
    border-radius: 18px;
    background: linear-gradient(135deg, color-mix(in srgb, var(--md-primary) 92%, #7c3aed), color-mix(in srgb, var(--md-secondary) 92%, #fb7185));
    color: var(--md-on-primary);
    box-shadow: var(--md-shadow-2);
    border: 1px solid color-mix(in srgb, var(--md-primary) 45%, transparent);
}

.update-banner-badge {
    flex: 0 0 auto;
    background: rgba(255, 255, 255, 0.16);
    color: var(--md-on-primary);
    padding: 8px 14px;
    border-radius: 9999px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.update-banner-content {
    flex: 1 1 260px;
    min-width: 220px;
}

.update-banner-title {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 8px;
}

.update-banner-features {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.update-banner-feature-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.12);
    font-size: 13px;
    line-height: 1.35;
}

.update-banner-feature-item span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.update-banner-action {
    flex: 0 0 auto;
    background: rgba(255, 255, 255, 0.18);
    color: var(--md-on-primary);
    padding: 10px 16px;
    border-radius: 9999px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: transform 0.2s ease, background 0.2s ease;
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.update-banner-action:hover {
    transform: translateY(-1px);
    background: rgba(255, 255, 255, 0.24);
}

/* ===== M3 Data Management ===== */
.md-data-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 24px;
}

.md-data-icon {
    font-size: 32px;
    color: var(--md-secondary);
}

.md-data-text h3 {
    font-size: 18px;
    font-weight: 500;
    margin: 0 0 4px;
    color: var(--md-on-surface);
}

/* ===== Footer ===== */
.main-footer {
    border-top: 1px solid var(--md-outline-variant);
    padding: 40px 24px;
    background: var(--md-surface-container-low);
    text-align: center;
    margin-top: 32px;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .home-main {
        padding: 16px;
    }

    .md-hero {
        padding: 40px 20px 48px;
        margin-bottom: 24px;
    }

    .md-hero h1 {
        font-size: 32px;
        line-height: 40px;
    }

    .md-card-media {
        height: 140px;
    }

    .md-section-alt {
        margin: 0 -16px;
        padding-left: 16px;
        padding-right: 16px;
    }
}