/* Productivity Dashboard Styles - Theme Adaptive (Light & Dark Mode) */

.productivity-dashboard {
    color: var(--mud-palette-text-primary);
}

.productivity-dashboard .page-heading {
    font-weight: 700;
    letter-spacing: -0.5px;
}

.productivity-dashboard .page-subheading {
    color: var(--mud-palette-text-secondary);
    font-size: 14px;
    margin-top: 4px;
}

/* Filters Card */
.productivity-dashboard .filters-card {
    background-color: var(--mud-palette-surface);
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02);
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.productivity-dashboard .filters-card:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
}

.mud-theme-dark .productivity-dashboard .filters-card {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    border-color: rgba(255, 255, 255, 0.12);
}

.productivity-dashboard .filters-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
}

.productivity-dashboard .date-range-filter {
    width: 290px;
    min-width: 260px;
}

.productivity-dashboard .date-range-filter .mud-input-outlined-border,
.productivity-dashboard .area-filter .mud-input-outlined-border {
    border-radius: 8px !important;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.productivity-dashboard .date-range-filter .mud-input-control:focus-within .mud-input-outlined-border,
.productivity-dashboard .area-filter .mud-input-control:focus-within .mud-input-outlined-border {
    border-color: var(--mud-palette-primary) !important;
    box-shadow: 0 0 0 3px rgba(var(--mud-palette-primary-rgb), 0.12);
}

.productivity-dashboard .area-filter {
    width: 240px;
    min-width: 200px;
}

.productivity-dashboard .checkbox-filter {
    display: inline-flex;
    align-items: center;
    margin-inline-end: auto;
}

.productivity-dashboard .filter-actions {
    display: flex;
    align-items: center;
    margin-inline-start: auto;
}

.productivity-dashboard .search-btn-group {
    display: inline-flex;
    align-items: stretch;
    border-radius: 28px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(var(--mud-palette-primary-rgb), 0.25);
}

.productivity-dashboard .search-btn-group .search-btn {
    border-radius: 0 !important;
    text-transform: none !important;
    padding: 8px 24px !important;
    font-weight: 600 !important;
}

.productivity-dashboard .search-btn-group .reset-btn {
    border-radius: 0 !important;
    background: var(--mud-palette-background-grey) !important;
    color: var(--mud-palette-text-secondary) !important;
    border-inline-start: 1px solid var(--mud-palette-lines-default) !important;
    transition: background 0.2s ease;
}

.productivity-dashboard .area-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* Metric Cards Grid */
.productivity-dashboard .metric-cards-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 16px;
}

.productivity-dashboard .metric-card {
    background-color: var(--mud-palette-surface);
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 8px;
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 142px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.2s ease;
}

.productivity-dashboard .metric-card:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

.productivity-dashboard .metric-card.focused-card {
    border-color: var(--mud-palette-lines-inputs);
}

.mud-theme-dark .productivity-dashboard .metric-card {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    border-color: rgba(255, 255, 255, 0.12);
}

.mud-theme-dark .productivity-dashboard .metric-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.productivity-dashboard .metric-card-header {
    font-size: 13px;
    font-weight: 500;
    color: var(--mud-palette-text-secondary);
    margin-bottom: 8px;
}

.productivity-dashboard .metric-card-stat {
    font-size: 34px;
    font-weight: 700;
    color: var(--mud-palette-text-primary);
    line-height: 1.1;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.productivity-dashboard .metric-card-stat.text-area {
    font-size: 20px;
    line-height: 1.25;
    font-weight: 700;
    word-break: break-word;
}

.productivity-dashboard .pct-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 9999px;
    letter-spacing: -0.2px;
    line-height: 1.2;
    white-space: nowrap;
    flex-shrink: 0;
}

.productivity-dashboard .metric-card-caption {
    font-size: 12px;
    color: var(--mud-palette-text-secondary);
    font-weight: 400;
}

/* Where the time goes Section */
.productivity-dashboard .time-breakdown-card {
    background-color: var(--mud-palette-surface);
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.mud-theme-dark .productivity-dashboard .time-breakdown-card {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    border-color: rgba(255, 255, 255, 0.12);
}

.productivity-dashboard .breakdown-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--mud-palette-text-primary);
}

.productivity-dashboard .breakdown-subtitle {
    font-size: 13px;
    color: var(--mud-palette-text-secondary);
}

.productivity-dashboard .info-btn {
    color: var(--mud-palette-text-secondary) !important;
}

.productivity-dashboard .focus-chip {
    font-size: 12px;
    font-weight: 600;
}

.productivity-dashboard .breakdown-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.productivity-dashboard .breakdown-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 8px 14px;
    border-radius: 8px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: background-color 0.15s ease, opacity 0.2s ease, border-color 0.15s ease, transform 0.1s ease;
}

.productivity-dashboard .breakdown-row:hover {
    background-color: var(--mud-palette-table-hover);
}

.productivity-dashboard .breakdown-row.focused-row {
    background-color: var(--mud-palette-background-grey);
    border-color: var(--mud-palette-lines-default);
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.mud-theme-dark .productivity-dashboard .breakdown-row.focused-row {
    background-color: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.2);
}

.productivity-dashboard .breakdown-row.dimmed-row {
    opacity: 0.45;
}

.productivity-dashboard .breakdown-row.dimmed-row:hover {
    opacity: 0.85;
}

.productivity-dashboard .area-label {
    width: 220px;
    min-width: 180px;
    display: flex;
    align-items: center;
    font-size: 13px;
    font-weight: 500;
    color: var(--mud-palette-text-primary);
}

.productivity-dashboard .area-name-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.productivity-dashboard .progress-track-wrapper {
    flex: 1;
    min-width: 120px;
}

.productivity-dashboard .progress-track {
    height: 10px;
    background-color: var(--mud-palette-background-grey);
    border-radius: 9999px;
    overflow: hidden;
    position: relative;
}

.mud-theme-dark .productivity-dashboard .progress-track {
    background-color: rgba(255, 255, 255, 0.08);
}

.productivity-dashboard .progress-bar-fill {
    height: 100%;
    border-radius: 9999px;
    min-width: 4px;
    margin-inline-start: 0;
    margin-inline-end: auto;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.productivity-dashboard .area-metric {
    width: 120px;
    min-width: 100px;
    text-align: end;
    font-size: 13px;
    font-weight: 500;
    color: var(--mud-palette-text-secondary);
    white-space: nowrap;
}

.productivity-dashboard .breakdown-footer {
    display: flex;
    align-items: center;
    border-top: 1px solid var(--mud-palette-lines-default);
}

.productivity-dashboard .footer-clock-icon {
    color: var(--mud-palette-primary) !important;
}

.productivity-dashboard .footer-duration-text {
    color: var(--mud-palette-text-secondary);
    font-size: 13px;
}

.productivity-dashboard .footer-duration-text strong {
    color: var(--mud-palette-text-primary);
}

/* Responsive adjustments */
@media (max-width: 1280px) {
    .productivity-dashboard .metric-cards-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 960px) {
    .productivity-dashboard .checkbox-filter {
        margin-inline-end: 0;
    }

    .productivity-dashboard .metric-cards-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .productivity-dashboard .area-label {
        width: 180px;
        min-width: 150px;
    }
}

@media (max-width: 900px) {
    .productivity-dashboard .filters-row {
        gap: 12px;
    }

    .productivity-dashboard .date-range-filter,
    .productivity-dashboard .area-filter {
        width: 100%;
        max-width: 100%;
    }

    .productivity-dashboard .checkbox-filter {
        width: 100%;
        margin-inline-end: 0;
        justify-content: flex-start;
    }

    .productivity-dashboard .filter-actions,
    .productivity-dashboard .search-btn-group {
        width: 100%;
    }

    .productivity-dashboard .search-btn-group .search-btn {
        flex: 1;
    }
}

@media (max-width: 600px) {
    .productivity-dashboard .metric-cards-grid {
        grid-template-columns: 1fr;
    }

    .productivity-dashboard .filters-row {
        flex-direction: column;
        align-items: stretch;
    }

    .productivity-dashboard .filter-actions {
        justify-content: flex-end;
        margin-top: 8px;
    }

    .productivity-dashboard .breakdown-row {
        flex-wrap: wrap;
        gap: 8px;
    }

    .productivity-dashboard .area-label {
        width: 100%;
    }

    .productivity-dashboard .progress-track-wrapper {
        width: calc(100% - 120px);
    }
}
