/* ===== GLooPY - Momy & Me Brand Styles ===== */

/* ===== Page Transition ===== */
.gloopy-main-content {
    animation: gloopyFadeIn 0.3s ease-out;
}

@keyframes gloopyFadeIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== Blob Icon Shape ===== */
.gloopy-blob-icon {
    width: 44px;
    height: 44px;
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.25s ease, border-radius 0.4s ease;
}

.gloopy-blob-icon:hover {
    transform: scale(1.08);
    border-radius: 50% 50% 30% 70% / 60% 40% 60% 40%;
}

/* ===== Card Hover Effects ===== */
.mud-paper {
    transition: box-shadow 0.25s ease, transform 0.2s ease;
}

.mud-paper:hover {
    box-shadow: 0 4px 20px rgba(124, 58, 237, 0.08) !important;
}

/* ===== Data Grid / Table Brand Styling ===== */
.mud-table .mud-table-head th,
.mud-data-grid .mud-table-head th {
    background-color: #f5f3ff !important;
    color: #581c87 !important;
    font-weight: 600 !important;
}

.mud-table .mud-table-body tr:hover td,
.mud-data-grid .mud-table-body tr:hover td {
    background-color: #fdf2f8 !important;
}

/* ===== MudChip Pill Shape Override ===== */
.mud-chip {
    border-radius: 999px !important;
}

/* ===== Snackbar Rounded ===== */
.mud-snackbar {
    border-radius: 12px !important;
}

/* ===== Drawer Gradient Background ===== */
.mud-drawer {
    background: linear-gradient(180deg, #581c87 0%, #3b0764 100%) !important;
}

/* ===== Nav Menu Active Link Style ===== */
.mud-nav-link.active {
    background-color: rgba(168, 85, 247, 0.2) !important;
    border-radius: 8px !important;
}

/* ===== Loading Spinner Brand Color ===== */
.mud-progress-circular svg circle {
    stroke: #7c3aed !important;
}

.mud-progress-circular.mud-success-text svg circle {
    stroke: #22c55e !important;
}

/* ===== Form Input Border Radius ===== */
.mud-input-outlined .mud-input-outlined-border {
    border-radius: 12px !important;
}

.mud-select .mud-input-outlined-border {
    border-radius: 12px !important;
}

/* ===== Suppress focus outlines from Blazor Server circuit/SignalR ===== */
*:focus:not(:focus-visible) {
    outline: none;
}

/* ===== Blazor Framework Styles ===== */

/* Form Validation (Blazor convention) */
.valid.modified:not([type=checkbox]) {
    outline: 1px solid #22c55e;
    border-color: #22c55e;
}

.invalid {
    outline: 1px solid #f43f5e;
    border-color: #f43f5e;
}

.validation-message {
    color: #f43f5e;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* Error Boundary */
.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDg5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
    border-radius: 12px;
    margin: 1rem;
}

.blazor-error-boundary::after {
    content: "An error has occurred. Please refresh the page or contact support if the problem persists.";
}

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

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

/* ===== Calendar Component (Custom Grid) ===== */
.calendar-container {
    background: white;
    border-radius: 12px;
    padding: 1rem;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #7c3aed;
}

.calendar-title {
    font-size: 1.25rem;
    font-weight: 600;
    font-family: 'Fredoka', sans-serif;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.5rem;
}

.calendar-day-header {
    text-align: center;
    font-weight: 600;
    color: #7c3aed;
    padding: 0.5rem;
    font-size: 0.875rem;
    text-transform: uppercase;
}

.calendar-day {
    aspect-ratio: 1;
    border: 1px solid #e9d5ff;
    border-radius: 12px;
    padding: 0.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.calendar-day:hover {
    background-color: rgba(124, 58, 237, 0.08);
    border-color: #7c3aed;
    transform: scale(1.03);
}

.calendar-day.today {
    background: linear-gradient(135deg, #22c55e, #4ade80);
    color: white;
    font-weight: 600;
    border-color: #22c55e;
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.3);
}

.calendar-day.has-event {
    border-color: #a855f7;
    border-width: 2px;
}

.calendar-day.has-event::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 6px;
    background-color: #a855f7;
    border-radius: 50%;
}

.calendar-day.other-month {
    color: #c4b5fd;
    background-color: #faf5ff;
}

/* ===== Mobile Responsive — Data Grids & Tables ===== */
.mud-data-grid,
.mud-table {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Prevent table content from shrinking below readable size */
.mud-data-grid .mud-table-root,
.mud-table .mud-table-root {
    min-width: 600px;
}

/* ===== Mobile Responsive — Page header flex-wrap ===== */
/* Ensure page headers with title + action buttons wrap on small screens */
.d-flex.justify-space-between.align-center {
    flex-wrap: wrap;
    gap: 8px;
}

/* ===== Mobile Responsive — Breadcrumbs wrapping ===== */
.mud-breadcrumbs {
    flex-wrap: wrap;
}

/* ===== Mobile Responsive — App Bar title truncation ===== */
@media (max-width: 600px) {
    .mud-appbar .mud-typography-h6 {
        font-size: 0.95rem !important;
    }

    /* Compact main content padding on mobile */
    .gloopy-main-content {
        padding: 12px !important;
        padding-top: 72px !important;
    }

    /* Stack dashboard header text */
    .mud-typography-h4 {
        font-size: 1.4rem !important;
    }

    /* Compact card padding on mobile */
    .mud-paper.pa-4 {
        padding: 12px !important;
    }
}

@media (max-width: 400px) {
    /* Extra-small screens: further compact */
    .gloopy-main-content {
        padding: 8px !important;
        padding-top: 68px !important;
    }

    .mud-typography-h4 {
        font-size: 1.2rem !important;
    }

    .mud-typography-h5 {
        font-size: 1rem !important;
    }
}

/* ===== Responsive Calendar ===== */
@media (max-width: 768px) {
    .calendar-grid {
        gap: 0.25rem;
    }

    .calendar-day {
        padding: 0.25rem;
        font-size: 0.875rem;
    }

    .calendar-day-header {
        font-size: 0.7rem;
        padding: 0.25rem;
    }

    .calendar-header {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
}

@media (max-width: 400px) {
    .calendar-day {
        padding: 0.15rem;
        font-size: 0.75rem;
        border-radius: 8px;
    }

    .calendar-day-header {
        font-size: 0.6rem;
    }
}
