/* Print Stylesheet for Rota Page */
/* Uses @media print to create print-friendly output */

@media print {
    /* ===== PAGE SETUP ===== */
    @page {
        size: landscape;
        margin: 0.5in;
    }

    /* ===== HIDE NON-PRINTABLE ELEMENTS ===== */

    /* Layout elements */
    .mud-appbar,
    .mud-drawer,
    .mud-drawer-overlay,
    #blazor-error-ui {
        display: none !important;
    }

    /* Rota page controls - hide entire controls row */
    .rota-container > .mud-stack.mb-4,
    .rota-container > .mud-stack:has(.stats-card),
    .rota-container > .mud-stack:has(.week-navigator),
    .week-navigator,
    .stats-card,
    .mud-progress-linear,
    .mud-alert,
    .rounded-xl {
        display: none !important;
    }

    /* Interactive elements */
    .cell-actions-bottom,
    .empty-cell-actions,
    .cell-edit-content,
    .cell-backdrop,
    .hours-badge,
    .mud-chip-close-button {
        display: none !important;
    }

    /* Avatars - hide for cleaner print */
    .employee-avatar,
    .mud-avatar {
        display: none !important;
    }

    /* Empty cell plus icons */
    .empty-cell-plus {
        display: none !important;
    }

    /* Expanded cells - collapse them */
    .day-cell.cell-expanded {
        position: relative !important;
        width: auto !important;
        max-width: none !important;
        transform: none !important;
        box-shadow: none !important;
        animation: none !important;
        z-index: auto !important;
    }

    /* ===== LAYOUT RESET ===== */

    body {
        background: white !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .mud-main-content,
    .mud-container {
        padding: 0 !important;
        margin: 0 !important;
        max-width: 100% !important;
    }

    .rota-container {
        background: white !important;
        padding: 0 !important;
        border-radius: 0 !important;
    }

    /* ===== PRINT HEADER ===== */

    .print-header {
        display: block !important;
        text-align: center;
        margin-bottom: 16px;
        padding-bottom: 12px;
        border-bottom: 2px solid #333;
    }

    .print-header h2 {
        margin: 0 0 4px 0;
        font-size: 20px;
        font-weight: 700;
        color: #000;
    }

    .print-header .print-date {
        font-size: 14px;
        color: #444;
        margin: 0;
    }

    /* ===== TABLE STYLING ===== */

    .rota-grid {
        box-shadow: none !important;
        border-radius: 0 !important;
        border: 1px solid #333 !important;
        overflow: visible !important;
        height: auto !important;
        max-height: none !important;
    }

    /* Ensure scrollable areas expand for print */
    .mud-table-container,
    [style*="calc(100vh"] {
        height: auto !important;
        max-height: none !important;
        overflow: visible !important;
    }

    .rota-table {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        table-layout: fixed !important;
        height: auto !important;
        max-height: none !important;
    }

    /* Force all table cells to auto-size */
    .rota-table th,
    .rota-table td,
    .rota-table col,
    .rota-table colgroup {
        width: auto !important;
        min-width: 0 !important;
        max-width: none !important;
    }

    /* Employee column - smaller for print */
    .employee-header,
    .employee-cell {
        width: 80px !important;
        min-width: 80px !important;
        max-width: 80px !important;
    }

    /* Day columns - equal distribution */
    .day-header {
        width: auto !important;
        min-width: 0 !important;
    }

    /* Remove fixed height from MudTable container */
    .mud-table,
    .mud-table-container,
    .mud-table-root {
        height: auto !important;
        max-height: none !important;
        overflow: visible !important;
    }

    /* Headers repeat on each page */
    .rota-table thead {
        display: table-header-group !important;
    }

    .rota-table tbody {
        display: table-row-group !important;
    }

    /* Header styling - remove gradients and fixed widths */
    .rota-table th {
        background: #f0f0f0 !important;
        color: #000 !important;
        border: 1px solid #333 !important;
        padding: 8px 6px !important;
        font-weight: 600 !important;
        font-size: 11px !important;
        width: auto !important;
        min-width: 0 !important;
    }

    .day-header {
        background: #f0f0f0 !important;
        min-width: 0 !important;
        width: auto !important;
    }

    .day-header.today-header {
        background: #e0e0e0 !important;
        color: #000 !important;
        border-radius: 0 !important;
    }

    .employee-header {
        background: #f0f0f0 !important;
        box-shadow: none !important;
        position: static !important;
    }

    /* Cell styling - remove fixed widths */
    .rota-table td {
        border: 1px solid #999 !important;
        padding: 4px !important;
        vertical-align: top !important;
        width: auto !important;
        min-width: 0 !important;
    }

    .employee-cell {
        background: white !important;
        box-shadow: none !important;
        position: static !important;
        width: auto !important;
        min-width: auto !important;
        max-width: none !important;
    }

    .employee-info {
        padding: 4px !important;
    }

    /* Employee name styling */
    .employee-info .mud-typography {
        font-size: 11px !important;
    }

    /* Remove today column highlight */
    .today-column {
        background: white !important;
    }

    /* Day cell styling */
    .day-cell {
        min-height: auto !important;
        height: auto !important;
        min-width: 0 !important;
        width: auto !important;
        background: white !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        transition: none !important;
        cursor: default !important;
        padding: 2px !important;
    }

    .day-cell:hover {
        background: white !important;
        box-shadow: none !important;
    }

    .day-cell.empty-cell,
    .day-cell.empty-cell *,
    .empty-cell .mud-drop-zone {
        background: white !important;
        border: none !important;
    }

    .day-cell.time-off-cell {
        background: #f5f5f5 !important;
        border: none !important;
    }

    /* ===== SHIFT CHIPS ===== */

    .shift-chip-component {
        background: white !important;
        color: #000 !important;
        border: 1px solid #666 !important;
        border-radius: 3px !important;
        box-shadow: none !important;
        font-size: 9px !important;
        padding: 1px 2px !important;
        min-height: 16px !important;
        height: auto !important;
        min-width: 0 !important;
        max-width: 100% !important;
        overflow: hidden !important;
        white-space: nowrap !important;
    }

    .shift-chip-component.mud-chip-filled {
        background: white !important;
    }

    .shift-chip-component .mud-chip-content {
        font-size: 10px !important;
    }

    .time-off-chip {
        background: #eee !important;
        border-style: dashed !important;
    }

    /* Shifts container */
    .shifts-container {
        gap: 2px !important;
    }

    .shift-chip-wrapper {
        margin-bottom: 2px !important;
    }

    /* MudDropZone - remove borders and sizing */
    .mud-drop-zone {
        height: auto !important;
        min-height: auto !important;
        border: none !important;
    }

    /* Remove inner cell borders */
    .shifts-container,
    .shift-chip-wrapper {
        border: none !important;
    }

    /* ===== PAGE BREAKS ===== */

    .rota-table tr {
        page-break-inside: avoid;
    }

    /* ===== REMOVE ALL TRANSITIONS & ANIMATIONS ===== */

    * {
        transition: none !important;
        animation: none !important;
    }

    /* ===== MUDBLAZOR OVERRIDES ===== */

    .mud-elevation-1,
    .mud-elevation-2,
    .mud-elevation-3,
    .mud-elevation-4 {
        box-shadow: none !important;
    }

    .mud-paper {
        box-shadow: none !important;
        border-radius: 0 !important;
    }

    /* Hide MudBlazor drop indicators */
    .mud-drop-zone {
        background: transparent !important;
    }

    .mud-drop-zone-drag-block {
        background: transparent !important;
        box-shadow: none !important;
    }

    /* MudStack spacing adjustments */
    .mud-stack {
        gap: 4px !important;
    }
}

/* ===== SCREEN-ONLY: HIDE PRINT HEADER ===== */
.print-header {
    display: none;
}
