@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600&display=swap');

body {
    font-family: 'Inter', sans-serif;
    background-color: #f3f4f6;
}

.editable-cell {
    transition: all 0.2s;
    outline: none;
}

.editable-cell:hover {
    background-color: #f9fafb;
}

.editable-cell:focus {
    background-color: #ffffff;
    box-shadow: inset 0 0 0 2px #3b82f6;
}

.priority-badge {
    background-color: #fee2e2;
    color: #991b1b;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
    display: inline-block;
    margin-bottom: 4px;
}

.note-text {
    font-size: 0.8rem;
    color: #6b7280;
    font-style: italic;
    display: block;
    margin-top: 2px;
}

/* Pill styles for meal items */
.meal-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background-color: #f0f9ff;
    color: #0c4a6e;
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: 12px;
    border: 1px solid #bae6fd;
    margin: 2px;
    cursor: move;
    transition: all 0.2s ease, transform 0.2s ease, opacity 0.2s ease;
    user-select: none;
}

.meal-pill.high-priority {
    background-color: #fef2f2;
    color: #991b1b;
    border: 1px solid #fca5a5;
    font-weight: 600;
}

.meal-pill.high-priority .priority-indicator {
    color: #dc2626;
    font-weight: bold;
    margin-right: 2px;
}

.meal-pill:hover {
    background-color: #e0f2fe;
    border-color: #7dd3fc;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.meal-pill.high-priority:hover {
    background-color: #fee2e2;
    border-color: #f87171;
}

.meal-pill.dragging {
    opacity: 0.5;
    transform: rotate(2deg);
}

.meal-pill.editing {
    box-shadow: 0 0 0 2px #3b82f6;
}

.meal-pill .pill-text {
    outline: none;
}

.meal-pill .pill-buttons {
    display: inline-flex;
    gap: 2px;
    margin-left: 4px;
}

.meal-pill .pill-btn {
    cursor: pointer;
    opacity: 0.6;
    font-weight: bold;
    padding: 0 2px;
    transition: opacity 0.2s;
    font-size: 0.7rem;
}

.meal-pill .pill-btn:hover {
    opacity: 1;
}

.meal-pill .edit-btn:hover {
    color: #2563eb;
}

.meal-pill .priority-btn:hover {
    color: #d97706;
}

.meal-pill .remove-btn:hover {
    color: #dc2626;
}

.unassigned-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.unassigned-remove {
    cursor: pointer;
    font-weight: bold;
    opacity: 0.6;
    margin-left: 2px;
    transition: opacity 0.2s;
}

.unassigned-remove:hover {
    opacity: 1;
    color: #dc2626;
}

.editable-cell {
    min-height: 2.5rem;
}

.editable-cell.drag-over {
    background-color: #dbeafe !important;
    box-shadow: inset 0 0 0 2px #3b82f6;
}

.editable-cell[contenteditable="true"]:empty:before {
    content: attr(data-placeholder);
    color: #cbd5e1;
    font-style: italic;
}

.unassigned-chip {
    cursor: grab;
}

.unassigned-chip:active {
    cursor: grabbing;
}

.unassigned-chip.dragging {
    opacity: 0.5;
}

/* Print styles */
@media print {
    @page {
        size: landscape;
        margin: 0.5cm;
    }

    body {
        background-color: white;
        padding: 0 !important;
        margin: 0 !important;
        height: auto !important;
    }

    .no-print {
        display: none !important;
    }

    /* Hide header section in print */
    body > div:first-child {
        display: none !important;
    }

    /* Hide unassigned items section */
    .bg-orange-50 {
        display: none !important;
    }

    /* Main layout adjustments */
    .max-w-6xl {
        max-width: 100%;
        margin: 0 !important;
        padding: 0 !important;
    }

    .grid {
        display: block;
        gap: 0 !important;
    }

    /* Table takes full width */
    .lg\:col-span-3 {
        width: 100%;
        margin: 0 0 1rem 0 !important;
        padding: 0 !important;
    }

    /* Show cooking list below table at full width */
    .lg\:col-span-1 {
        width: 100%;
        margin: 0 !important;
        padding: 0 !important;
        page-break-before: avoid;
    }

    .space-y-5 {
        gap: 0 !important;
    }

    .bg-blue-50 {
        display: block !important;
        width: 100%;
        margin: 0 !important;
        padding: 1rem !important;
        page-break-inside: avoid;
        background-color: #eff6ff !important;
        border-color: #bfdbfe !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .bg-blue-50 h3 {
        color: #1e40af !important;
        margin-bottom: 0.5rem !important;
    }

    .bg-blue-50 p {
        color: #1e3a8a !important;
        margin-bottom: 0.5rem !important;
    }

    /* Remove shadows and rounded corners for print */
    .shadow-sm,
    .shadow-lg,
    .rounded-xl {
        box-shadow: none !important;
        border-radius: 0 !important;
    }

    /* Table styling for print */
    table {
        width: 100%;
        border-collapse: collapse;
        margin: 0 !important;
    }

    td,
    th {
        border: 1px solid #000 !important;
        padding: 0.5rem !important;
    }

    thead {
        background-color: #e5e7eb !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    /* Day column styling */
    .bg-slate-50\/50 {
        background-color: #f9fafb !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    /* Hide interactive elements in print */
    .pill-buttons,
    .pill-btn,
    select,
    button,
    input[type="checkbox"] {
        display: none !important;
    }

    /* Simplify pills for print */
    .meal-pill {
        border: 1px solid #3b82f6 !important;
        background-color: #dbeafe !important;
        color: #1e3a8a !important;
        margin: 2px;
        page-break-inside: avoid;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .meal-pill.high-priority {
        border: 1px solid #dc2626 !important;
        background-color: #fee2e2 !important;
        color: #991b1b !important;
        font-weight: bold;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    /* Cooking list items */
    #cooking-list-container > div {
        border: 1px solid #3b82f6 !important;
        background-color: #dbeafe !important;
        color: #1e3a8a !important;
        margin-bottom: 0.25rem;
        page-break-inside: avoid;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    /* Hide day copy controls */
    .space-y-1 {
        display: none !important;
    }

    /* Show only day name */
    .bg-slate-50\/50 > div:first-child {
        display: block !important;
        margin: 0 !important;
    }

    /* Ensure proper spacing */
    .p-4 {
        padding: 0.5rem !important;
    }

    .mb-6,
    .mb-3,
    .mb-2 {
        margin-bottom: 0.25rem !important;
    }

    .mt-1 {
        margin-top: 0 !important;
    }

    /* Remove excessive padding from body and containers */
    .p-8,
    .md\:p-8 {
        padding: 0 !important;
    }

    .h-screen {
        height: auto !important;
    }

    .flex-col {
        display: block !important;
    }
}