/* Custom overrides for Vis-Timeline and generic styling */
.vis-timeline {
    border: none;
    font-family: 'Inter', sans-serif;
}

.vis-item {
    border-radius: 4px;
    font-size: 12px;
    border: none;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    transition: transform 0.1s ease;
}

.vis-item.vis-selected {
    border: 2px solid #4f46e5; /* indigo-600 */
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.vis-item.shift-unassigned {
    color: #6b7280;
    border-width: 1.5px !important;
    border-style: dashed !important;
}

.vis-item.shift-assigned {
    border-width: 1.5px !important;
    border-style: solid !important;
}

.vis-item.shift-error {
    background-color: #fee2e2; /* red-100 */
    color: #991b1b; /* red-800 */
    border: 2px solid #ef4444; /* red-500 */
    animation: shake 0.4s 1 linear;
}

.vis-group {
    font-weight: 500;
    color: #374151; /* gray-700 */
    padding: 8px !important;
}

.vis-time-axis .vis-text {
    color: #6b7280;
}

.staff-item {
    cursor: grab;
}

.staff-item:active {
    cursor: grabbing;
}

/* Toast Animations */
@keyframes slide-up {
    from { transform: translateY(100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.toast {
    animation: slide-up 0.3s ease forwards;
}

@keyframes shake {
    0% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    50% { transform: translateX(4px); }
    75% { transform: translateX(-4px); }
    100% { transform: translateX(0); }
}

@media print {
    body {
        background-color: white !important;
        overflow: visible !important;
    }
    aside, header, #toast-container, #timeline-area, #settings-modal, #copy-schedule-modal,
    #assignment-modal, #add-shift-modal, #print-modal, #select-action-bar, .vis-timeline {
        display: none !important;
    }
    main {
        display: block !important;
        width: 100% !important;
        height: auto !important;
        overflow: visible !important;
    }

    #print-container {
        display: block !important;
        width: 100%;
    }

    /* ── Per-day page ── */
    .print-day-page {
        page-break-after: always;
    }
    .print-day-page:last-child {
        page-break-after: avoid;
    }

    .print-day-header h1 {
        font-size: 20px;
        font-weight: bold;
        margin: 0 0 1px 0;
        color: #111827;
    }
    .print-day-header p {
        font-size: 10px;
        color: #6b7280;
        margin: 0 0 10px 0;
    }
    .print-no-shifts {
        font-size: 10px;
        color: #9ca3af;
        font-style: italic;
    }

    /* ── Timeline table ── */
    .print-timeline {
        width: 100%;
        border-collapse: collapse;
        table-layout: fixed;
        font-size: 8px;
        margin-bottom: 10px;
    }

    /* Name column ~14%, remaining 86% split across 18 hour cols */
    .pth-name  { width: 14%; }
    .pth-hour  { width: 4.78%; }

    .print-timeline th {
        background-color: #f3f4f6 !important;
        -webkit-print-color-adjust: exact;
        color-adjust: exact;
        border: 1px solid #d1d5db;
        padding: 2px 1px;
        text-align: center;
        font-size: 7px;
        font-weight: 600;
        color: #6b7280;
    }
    .pth-name { text-align: left; padding-left: 3px; color: #374151; }

    .print-timeline td {
        border: 1px solid #e5e7eb;
        vertical-align: middle;
        overflow: hidden;
    }

    .ptd-name {
        font-size: 9px;
        font-weight: 700;
        padding: 3px 4px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        color: #111827;
    }

    .ptd-empty {
        background-color: #fafafa;
    }

    .ptd-shift {
        -webkit-print-color-adjust: exact;
        color-adjust: exact;
        border-width: 1.5px !important;
        border-style: solid !important;
        padding: 2px 3px;
        vertical-align: top;
    }

    .ps-zone {
        font-size: 7px;
        font-weight: 700;
        opacity: 0.75;
        line-height: 1.1;
        white-space: nowrap;
        overflow: hidden;
    }
    .ps-name {
        font-size: 8px;
        font-weight: 600;
        line-height: 1.2;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .ps-time {
        font-size: 7px;
        opacity: 0.65;
        line-height: 1.1;
        white-space: nowrap;
    }

    /* ── Unassigned chips ── */
    .print-unassigned-section {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 4px;
        margin-top: 8px;
    }
    .pu-label {
        font-size: 8px;
        font-weight: 700;
        color: #b91c1c;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        margin-right: 2px;
    }
    .pu-chip {
        font-size: 8px;
        border: 1px solid;
        border-radius: 3px;
        padding: 1px 5px;
        -webkit-print-color-adjust: exact;
        color-adjust: exact;
    }

    @page {
        size: landscape;
        margin: 1.2cm;
    }
}
