/* Hourflo Prototype - Minimal Custom Styles */
/* MudBlazor handles most styling via the light theme */

html, body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

/* Ensure full height for app layout */
.mud-layout {
    min-height: 100vh;
}

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

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

/* Reconnect modal styling */
#components-reconnect-modal {
    background-color: rgba(0, 0, 0, 0.5);
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Remove focus outlines from non-interactive elements */
/* MudText, MudStack, MudPaper, and typography elements should not show focus rings */
.mud-typography,
.mud-paper,
.mud-stack,
.mud-container,
.mud-grid,
.mud-item,
.mud-text,
h1, h2, h3, h4, h5, h6,
p, span {
    outline: none !important;
}

/* Keep focus visible on interactive elements for accessibility */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
    outline: 2px solid var(--mud-palette-primary);
    outline-offset: 2px;
}

/* Custom scrollbar for light theme (webkit browsers) */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* ===================================
   Marketing Dropdown Menu Styling
   =================================== */

/* Simple dropdown: square corners, subtle shadow */
.mud-popover .mud-paper {
    border-radius: 0 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;
}

/* ===================================
   Mobile Nav Drawer Enhancements
   =================================== */

/* Mobile nav group styling */
.mud-drawer .mud-nav-group .mud-collapse-container {
    background-color: rgba(0, 0, 0, 0.02);
}

/* Mobile nav link padding for nested items */
.mud-drawer .mud-nav-group .mud-navlink {
    padding-left: 48px !important;
}

/* ===================================
   Hourflo Dialog Styling (MANDATORY)
   All dialogs MUST use this pattern
   =================================== */

/* Remove default MudDialog title padding for colored headers */
.hourflo-dialog .mud-dialog-title,
.form-dialog .mud-dialog-title,
.confirmation-dialog .mud-dialog-title {
    padding: 0 !important;
}

/* Ensure dialog content has proper spacing */
.hourflo-dialog .mud-dialog-content,
.form-dialog .mud-dialog-content,
.confirmation-dialog .mud-dialog-content {
    padding-top: 0 !important;
}

/* ===================================
   Mobile DataGrid Card View Styling
   MANDATORY for all MudDataGrid components
   =================================== */

/* Mobile breakpoint (matches MudBlazor Breakpoint.Sm) */
@media (max-width: 959.95px) {
    /* DataGrid card view - each row becomes a card */
    .mud-table-container .mud-table-body .mud-table-row {
        position: relative;
        display: flex;
        flex-direction: column;
        padding: 16px;
        padding-right: 48px; /* Space for checkbox */
        margin: 8px;
        border: 1px solid var(--mud-palette-divider);
        border-radius: 4px;
        background: var(--mud-palette-surface);
    }

    /* Card cell layout - label-value pairs */
    .mud-table-container .mud-table-body .mud-table-cell {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        padding: 6px 0;
        border: none;
        min-height: 32px;
    }

    /* Card cell label styling (data-label attribute) */
    .mud-table-container .mud-table-body .mud-table-cell[data-label]::before {
        content: attr(data-label);
        font-weight: 500;
        color: var(--mud-palette-text-secondary);
        font-size: 0.875rem;
        flex-shrink: 0;
        min-width: 90px;
        margin-right: 16px;
        white-space: nowrap;
    }

    /* Selection checkbox - position at top right of card */
    .mud-table-container .mud-table-body .mud-table-cell[data-label=""] {
        position: absolute;
        top: 12px;
        right: 12px;
        padding: 0;
        min-height: auto;
        width: auto;
    }

    /* Hide the empty label for checkbox cells */
    .mud-table-container .mud-table-body .mud-table-cell[data-label=""]::before {
        display: none;
    }

    /* Prevent MudStack from stacking vertically in card values */
    .mud-table-container .mud-table-body .mud-table-cell .mud-stack {
        flex-direction: row !important;
        gap: 6px !important;
        flex-wrap: nowrap !important;
        align-items: center !important;
    }

    /* Card values should not wrap */
    .mud-table-container .mud-table-body .mud-table-cell > * {
        white-space: nowrap;
    }

    /* Actions row - special styling */
    .mud-table-container .mud-table-body .mud-table-cell[data-label="Actions"] {
        justify-content: flex-end;
        padding-top: 12px;
        margin-top: 8px;
        border-top: 1px solid var(--mud-palette-divider);
    }

    .mud-table-container .mud-table-body .mud-table-cell[data-label="Actions"]::before {
        display: none;
    }

    /* Hide table header on mobile (cards are self-describing) */
    .mud-table-container .mud-table-head {
        display: none;
    }
}

/* ===================================
   Mobile-First Layout Utilities
   Use these classes for consistent mobile behavior
   =================================== */

/* Prevent text wrapping on mobile */
.mobile-nowrap {
    white-space: nowrap !important;
}

/* Compact date display for mobile */
.date-compact {
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
    white-space: nowrap;
}

.date-compact .date-day {
    font-weight: 500;
}

.date-compact .date-weekday {
    color: var(--mud-palette-text-secondary);
    font-size: 0.75rem;
}

/* Mobile-friendly chip sizing */
@media (max-width: 599.95px) {
    .mud-chip.mud-chip-size-small {
        height: 24px;
        font-size: 0.75rem;
    }
}

/* Responsive filter panel */
@media (max-width: 959.95px) {
    /* Stack filters vertically on tablet/mobile */
    .filter-panel .mud-stack {
        flex-direction: column !important;
    }

    .filter-panel .mud-select,
    .filter-panel .mud-input {
        width: 100% !important;
        min-width: unset !important;
    }
}
