/* =================================================================== */
/* ===         Global & Blazor Framework Styles                === */
/* =================================================================== */

*, *::before, *::after {
    box-sizing: border-box;
}

html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    overflow: hidden; /* Prevent body scroll from interfering */
}

/* =================================================================== */
/* ===                Dashboard Layout & Controls                === */
/* =================================================================== */

.dashboard-wrapper {
    height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 20px;
    background-color: var(--mud-palette-background);
}

.controls {
    text-align: center;
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-shrink: 0;
}

.dashboard-container {
    height: 80vh;
    flex: unset;
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 8px;
    background-color: var(--mud-palette-surface);
    padding: 10px;
    position: relative;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
}

.grid-stack {
    background: transparent;
}

/* =================================================================== */
/* ===                       Card Styles                         === */
/* =================================================================== */

.grid-stack-item {
}

.grid-stack-item-content {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    color: var(--mud-palette-text-primary);
    background-color: var(--mud-palette-surface);
    border-radius: 8px;
    box-shadow: var(--mud-elevation-2);
    border: 1px solid var(--mud-palette-lines-default);
}

    .grid-stack-item-content .card-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 12px 20px;
        font-weight: 600;
        color: var(--mud-palette-text-primary);
        border-bottom: 1px solid var(--mud-palette-lines-default);
        flex-shrink: 0;
        cursor: default;
    }

.card-title {
    flex-grow: 1;
}

.grid-stack-item-content .card-body {
    padding: 20px;
    flex-grow: 1;
    overflow-y: auto;
    cursor: default;
}

.card-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.move-handle {
    color: var(--mud-palette-text-secondary);
    transition: color 0.2s, background-color 0.2s;
    padding: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 3px;
    cursor: move;
}

    .move-handle:hover {
        color: var(--mud-palette-text-primary);
        background-color: var(--mud-palette-action-default-hover);
    }

.delete-handle {
    padding: 5px;
    color: var(--mud-palette-text-secondary);
    transition: color 0.2s, background-color 0.2s;
    border-radius: 3px;
    cursor: pointer;
}

    .delete-handle:hover {
        color: var(--mud-palette-error);
        background-color: rgba(var(--mud-palette-error-rgb), 0.1);
    }

/* =================================================================== */
/* ===         Example Card Content Styles (RESTORED & FIXED)      === */
/* =================================================================== */

/* --- KPI Card --- */
.kpi-card-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.kpi-number {
    font-size: 3rem;
    font-weight: 700;
    color: var(--mud-palette-primary);
}

/* --- Activity Feed --- */
.activity-feed {
    list-style: none;
    padding: 0;
    margin: 0;
}

    .activity-feed li {
        display: flex;
        align-items: center;
        padding: 10px 0;
        border-bottom: 1px solid var(--mud-palette-lines-default);
    }

        .activity-feed li:last-child {
            border-bottom: none;
        }

    .activity-feed .icon {
        margin-right: 15px;
        color: var(--mud-palette-text-secondary);
    }

/* --- Notes Card --- */
.notes-card {
    padding: 15px;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.notes-header {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    color: var(--mud-palette-text-secondary);
    font-weight: 600;
}

    .notes-header i {
        margin-right: 8px;
        color: var(--mud-palette-warning);
    }

.notes-content {
    flex: 1;
    overflow-y: auto;
}

    .notes-content p {
        margin: 8px 0;
        color: var(--mud-palette-text-primary);
        font-size: 14px;
        line-height: 1.4;
    }

/* --- Metrics Card --- */
.metrics-card {
    padding: 15px;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
}

.metric-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--mud-palette-lines-default);
}

    .metric-row:last-child {
        border-bottom: none;
    }

.metric-label {
    font-size: 14px;
    color: var(--mud-palette-text-secondary);
    font-weight: 500;
}

.metric-value {
    font-size: 16px;
    font-weight: 700;
    color: var(--mud-palette-success);
}

/* --- Tasks Card --- */
.tasks-card {
    padding: 15px;
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.task-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--mud-palette-background);
}

    .task-item:last-child {
        border-bottom: none;
    }

    .task-item input[type="checkbox"] {
        margin: 0;
        cursor: pointer;
    }

    .task-item span {
        font-size: 14px;
        color: var(--mud-palette-text-primary);
    }

.task-completed {
    text-decoration: line-through;
    color: var(--mud-palette-text-disabled) !important;
}

.default-card {
    padding: 20px;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: linear-gradient(135deg, var(--mud-palette-background-grey) 0%, var(--mud-palette-drawer-background) 100%);
    border-radius: 8px;
}

.default-card-icon {
    font-size: 48px;
    color: var(--mud-palette-primary);
    margin-bottom: 15px;
}

.default-card-content h4 {
    margin: 0 0 10px 0;
    color: var(--mud-palette-text-primary);
    font-size: 18px;
    font-weight: 600;
}

.default-card-content p {
    margin: 0 0 20px 0;
    color: var(--mud-palette-text-secondary);
    font-size: 14px;
    line-height: 1.5;
}

.default-card-stats {
    display: flex;
    gap: 30px;
    margin-top: 15px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-number {
    font-size: 24px;
    font-weight: 700;
    color: var(--mud-palette-primary);
    line-height: 1;
}

.stat-label {
    font-size: 12px;
    color: var(--mud-palette-text-secondary);
    margin-top: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* =================================================================== */
/* ===                  Responsive Adjustments                     === */
/* =================================================================== */

@media (max-width: 768px) {
    .default-card-stats {
        gap: 20px;
    }

    .stat-number {
        font-size: 20px;
    }

    .default-card-content h4 {
        font-size: 16px;
    }

    .default-card-content p {
        font-size: 13px;
    }
}
