/* Count Trackula — custom styles */

html, body {
    font-family: 'Roboto', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 0;
    height: 100%;
}

/* ── Loading screen ──────────────────────────────────────── */
.loading-progress {
    position: relative;
    display: block;
    width: 8rem;
    height: 8rem;
    margin: 20vh auto 1rem auto;
}

.loading-progress circle {
    fill: none;
    stroke: #3D007A;
    stroke-width: 0.6rem;
    transform-origin: 50% 50%;
    transform: rotate(-90deg);
}

.loading-progress circle:last-child {
    stroke: #6A0DAD;
    stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
    transition: stroke-dasharray 0.05s ease-in-out;
}

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
    color: #6A0DAD;
}

.loading-progress-text:after {
    content: var(--blazor-load-percentage-text, "Loading");
}

/* ── Error UI ────────────────────────────────────────────── */
#blazor-error-ui {
    background: #b32121;
    color: white;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.4);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 9999;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

.blazor-error-boundary {
    padding: 1rem;
    color: white;
    background: #b32121;
}

.blazor-error-boundary::after {
    content: "An error has occurred.";
}

/* ── Inline entry form ───────────────────────────────────── */
.entry-form-panel {
    border-left: 4px solid #6A0DAD;
    animation: slideDown 0.2s ease-out;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Entry cards ─────────────────────────────────────────── */
.entry-card {
    transition: box-shadow 0.15s ease;
}

.entry-card:hover {
    box-shadow: 0 2px 8px rgba(106, 13, 173, 0.15) !important;
}

.entry-card--expanded {
    border-left: 3px solid #6A0DAD;
}

/* ── Trackable cards ─────────────────────────────────────── */
.trackable-card {
    cursor: pointer;
    transition: box-shadow 0.15s ease, transform 0.1s ease;
}

.trackable-card:hover {
    transform: translateY(-1px);
}

.trackable-card--due {
    border-left: 4px solid #FF6B35;
}

/* ── Completion heatmap ──────────────────────────────────── */
.completion-chart {
    overflow-x: auto;
}

.completion-day {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    background-color: var(--mud-palette-action-disabled-background, #e0e0e0);
    cursor: default;
    transition: background-color 0.2s;
}

.completion-day--done {
    background-color: #6A0DAD;
}

/* ── SubForm row ─────────────────────────────────────────── */
.subform-row {
    padding: 0.5rem;
    border: 1px solid rgba(106, 13, 173, 0.2);
    border-radius: 8px;
    background: rgba(106, 13, 173, 0.04);
}

.subform-field {
    min-width: 100px;
}

/* ── Textarea auto-grow ──────────────────────────────────── */
/* overflow-y: hidden is required so scrollHeight equals full content height */
.mud-input-slot textarea {
    overflow-y: hidden !important;
    resize: none;
}

/* ── Utility ─────────────────────────────────────────────── */
.fw-medium { font-weight: 500; }
.fw-bold   { font-weight: 700; }

/* Mobile-first adjustments */
@media (max-width: 600px) {
    .field-editor-row .d-flex {
        flex-wrap: wrap;
    }
}
