/* ========== Speiseplan Page Styles ========== */
.speiseplan-container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 20px;
    flex: 1 0 auto;
    /* Push footer to bottom */
    box-sizing: border-box;
}

.speiseplan-header {
    background: linear-gradient(135deg, #5a6c7d 0%, #3d4f5f 100%);
    color: white;
    padding: 30px;
    border-radius: 16px;
    margin-bottom: 30px;
    text-align: center;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.speiseplan-header h1 {
    font-size: 28px;
    font-weight: 600;
    margin: 0 0 8px 0;
    color: white;
}

.speiseplan-header .subtitle {
    font-size: 16px;
    opacity: 0.9;
}

.speiseplan-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.controls-group {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* Select wrapper to ensure proper arrow styling */
.select-wrapper {
    position: relative;
    display: inline-block;
}

.select-wrapper::after {
    content: '';
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid white;
    pointer-events: none;
}

.month-select {
    padding: 10px 40px 10px 20px;
    font-size: 14px;
    border: none;
    border-radius: 8px;
    background-color: rgba(255, 255, 255, 0.15);
    color: white;
    cursor: pointer;
    min-width: 180px;
    /* Reset all browser appearance styles completely */
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    /* Remove any background image - use wrapper ::after instead */
    background-image: none !important;
}

/* Hide browser default dropdown arrow in all browsers */
.month-select::-ms-expand {
    display: none;
}

/* Firefox specific */
.month-select:-moz-focusring {
    color: transparent;
    text-shadow: 0 0 0 white;
}

.month-select:focus {
    outline: 2px solid rgba(255, 255, 255, 0.5);
    outline-offset: 2px;
}

.month-select option {
    background: #3d4f5f;
    color: white;
    padding: 10px;
}

.nav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 6px 20px;
    background: rgba(255, 255, 255, 0.15);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-size: 14px;
    transition: background 0.2s;
    border: none;
    cursor: pointer;
    white-space: nowrap;
    width: auto;
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    color: white;
}

.print-btn {
    background: #4caf50;
}

.print-btn:hover {
    background: #388e3c;
}

.week-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 15px;
    margin-bottom: 30px;
    width: 100%;
}

.day-card {
    position: relative;
    background: var(--bg-card, white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--border-color, #e0e0e0);
}

.holiday-corner-icon {
    position: absolute;
    top: 8px;
    right: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: rgba(61, 45, 5, 0.9);
    color: #fff6c7;
    border: 1px solid rgba(255, 224, 102, 0.72);
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.28);
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    opacity: 0.95;
    z-index: 10;
    pointer-events: none;
}

.holiday-corner-icon.holiday-marker-combo,
.holiday-notice-icon.holiday-marker-combo {
    width: auto;
    min-width: 34px;
    height: 20px;
    padding: 0 5px;
}

.holiday-icon-stack {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    line-height: 1;
}

.holiday-icon-stack span {
    display: block;
    height: 14px;
    line-height: 14px;
}

.holiday-corner-icon .holiday-icon-stack,
.holiday-notice-icon .holiday-icon-stack {
    flex-direction: row;
}

[data-theme='dark'] .holiday-corner-icon {
    opacity: 1;
}

.day-header {
    position: relative;
    background: linear-gradient(135deg, #ff8947 0%, #ed7e43 100%);
    color: white;
    padding: 12px 15px;
    font-weight: 600;
    font-size: 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 2px;
}

.day-header .date {
    font-weight: 400;
    opacity: 0.9;
    font-size: 12px;
}

.day-header.holiday {
    background: linear-gradient(135deg, #ffc107 0%, #ffb300 100%);
}

.day-content {
    padding: 15px;
    min-height: 100px;
}

.meal {
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color, #eee);
}

.meal:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.meal-name {
    font-weight: 600;
    color: var(--text-primary, #333);
    font-size: 14px;
    margin-bottom: 4px;
}

.meal-side {
    color: var(--text-muted, #888);
    font-size: 12px;
}

.meal-zusatzstoffe-info {
    color: var(--text-muted, #999);
    font-size: 10px;
    font-style: italic;
    margin-top: 2px;
}

[data-theme='dark'] .meal-zusatzstoffe-info {
    color: var(--text-secondary, #aaa);
}

.no-meals {
    color: var(--text-muted, #999);
    font-style: italic;
    font-size: 13px;
}

.holiday-notice {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    color: #8b6914;
    font-weight: 500;
    font-size: 14px;
    min-height: 94px;
    padding: 16px 10px;
    text-align: center;
}

.holiday-notice-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    min-height: 24px;
    padding: 2px 7px;
    border-radius: 999px;
    background: rgba(61, 45, 5, 0.9);
    color: #fff6c7;
    border: 1px solid rgba(255, 224, 102, 0.72);
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.22);
    font-size: 14px;
    line-height: 1;
}

.holiday-notice-text {
    font-weight: 700;
    line-height: 1.2;
}

.holiday-notice-name {
    max-width: 100%;
    font-size: 11px;
    line-height: 1.3;
    opacity: 0.88;
    overflow-wrap: anywhere;
}

.week-separator {
    height: 2px;
    background: linear-gradient(
        90deg,
        transparent,
        var(--border-color, rgba(0, 0, 0, 0.1)),
        transparent
    );
    margin: 20px 0 30px;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted, #5a6c7d);
    text-decoration: none;
    font-size: 14px;
    margin-bottom: 20px;
}

.back-link:hover {
    color: var(--accent-orange, #ff8947);
}

/* Dark mode adjustments */
[data-theme='dark'] .speiseplan-header {
    background: linear-gradient(135deg, #2d3a47 0%, #1e2830 100%);
}

[data-theme='dark'] .day-card {
    background: var(--bg-card, #2d2d2d);
}

[data-theme='dark'] .holiday-notice {
    color: #ffc107;
}

/* Responsive */
@media (max-width: 900px) {
    .speiseplan-container {
        padding: 15px 10px;
    }

    .week-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 500px) {
    .week-grid {
        grid-template-columns: 1fr;
    }

    .speiseplan-header {
        padding: 20px 15px;
    }

    .speiseplan-controls {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }

    /* Sticky controls bar that appears on scroll-up on mobile */
    .speiseplan-controls.sticky-controls {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 999;
        background: linear-gradient(135deg, #5a6c7d 0%, #3d4f5f 100%);
        padding: 10px 15px;
        margin: 0;
        border-radius: 0;
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
        transform: translateY(-100%);
        transition: transform 0.3s ease;
    }

    .speiseplan-controls.sticky-controls.sticky-visible {
        transform: translateY(0);
    }

    [data-theme='dark'] .speiseplan-controls.sticky-controls {
        background: linear-gradient(135deg, #2d3a47 0%, #1e2830 100%);
    }

    .controls-group {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }

    .month-select {
        width: 100%;
        max-width: 250px;
    }

    .nav-btn {
        width: auto;
        min-width: 120px;
        padding: 8px 16px;
    }
}

/* Print-only elements hidden on screen */
.print-only-header,
.print-only-footer {
    display: none;
}

/* Meal type highlighting */
.meal.meal-type-veg {
    background: rgba(76, 175, 80, 0.08) !important;
    border-left: 3px solid rgba(76, 175, 80, 0.5);
    padding-left: 8px;
}

.meal.meal-type-meat {
    background: rgba(255, 152, 0, 0.08) !important;
    border-left: 3px solid rgba(255, 152, 0, 0.5);
    padding-left: 8px;
}

[data-theme='dark'] .meal.meal-type-veg {
    background: rgba(76, 175, 80, 0.12) !important;
    border-left-color: rgba(76, 175, 80, 0.6);
}

[data-theme='dark'] .meal.meal-type-meat {
    background: rgba(255, 152, 0, 0.12) !important;
    border-left-color: rgba(255, 152, 0, 0.6);
}

/* Print styles - optimized to use full page */
@media print {
    @page {
        size: A4 landscape;
        margin: 6mm;
    }

    html,
    body {
        background: white !important;
        padding: 0 !important;
        margin: 0 !important;
        font-size: 9px !important;
        line-height: 1.2 !important;
        height: 100%;
    }

    .speiseplan-container {
        max-width: 100%;
        padding: 0;
        margin: 0;
        min-height: 100vh;
        display: flex;
        flex-direction: column;
    }

    /* Hide screen header, show print header */
    .speiseplan-header {
        display: none !important;
    }

    .print-only-header {
        display: grid !important;
        grid-template-columns: 80px 1fr 80px;
        align-items: center;
        gap: 8px;
        margin-bottom: 4px;
        padding: 2px 0 4px 0;
        padding-top: 0 !important;
        margin-top: 0 !important;
        border-bottom: 2px solid #333;
        page-break-before: avoid;
    }

    .print-header-left,
    .print-header-right {
        text-align: center;
    }

    .print-logo {
        max-height: 35px;
        max-width: 100%;
        object-fit: contain;
    }

    .print-header-center {
        text-align: center;
    }

    .print-superheader {
        font-size: 8px;
        color: #666 !important;
        margin-bottom: 1px;
        font-weight: bold;
    }

    .print-header-center h2 {
        margin: 0;
        font-size: 14px;
        color: #333 !important;
        font-weight: bold;
    }

    .print-period {
        font-size: 11px;
        color: #666 !important;
        margin-top: 1px;
        font-weight: bold;
    }

    .speiseplan-controls,
    .back-link {
        display: none !important;
    }

    .week-grid {
        gap: 4px;
        margin-bottom: 4px;
        grid-template-columns: repeat(5, 1fr) !important;
    }

    /* Weekly print: 3+2 layout with larger cards and fonts */
    .is-week-view .week-grid {
        grid-template-columns: repeat(6, 1fr) !important;
        gap: 6px;
        margin-bottom: 8px;
        margin-top: 40px;
    }

    .is-week-view .week-grid .day-card {
        grid-column: span 2;
    }

    .is-week-view .week-grid .day-card:nth-child(4) {
        grid-column: 2 / 4;
    }

    .is-week-view .week-grid .day-card:nth-child(5) {
        grid-column: 4 / 6;
    }

    .is-week-view .day-header {
        padding: 6px 10px;
        font-size: 13px;
    }

    .is-week-view .day-header .date {
        font-size: 10px;
    }

    .is-week-view .day-content {
        padding: 10px 12px;
        min-height: 80px;
    }

    .is-week-view .meal-name {
        font-size: 11px;
        line-height: 1.2;
        margin-bottom: 2px;
    }

    .is-week-view .meal-side {
        font-size: 10px;
        line-height: 1.2;
    }

    .is-week-view .meal {
        margin-bottom: 8px;
        padding-bottom: 8px;
    }

    .is-week-view .no-meals,
    .is-week-view .holiday-notice {
        font-size: 10px;
    }

    .day-card {
        box-shadow: none;
        border: 1px solid #999;
        break-inside: avoid;
        page-break-inside: avoid;
        border-radius: 3px;
    }

    .day-header {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
        padding: 4px 8px;
        font-size: 10px;
        line-height: 1.1;
        color: white !important;
        text-align: center;
        align-items: center;
        justify-content: center;
    }

    .day-header .date {
        font-size: 8px;
        display: inline;
        margin-left: 4px;
        color: white !important;
    }

    .day-header .day-name {
        color: white !important;
    }

    .day-content {
        padding: 4px 6px;
        min-height: 45px;
        background: white !important;
    }

    .meal {
        margin-bottom: 4px;
        padding-bottom: 4px;
        border-bottom-width: 1px;
    }

    .meal:last-child {
        margin-bottom: 0;
        padding-bottom: 0;
    }

    .meal-name {
        font-size: 9px;
        line-height: 1.1;
        margin-bottom: 1px;
        color: #000 !important;
    }

    .meal-side {
        font-size: 8px;
        line-height: 1.1;
        color: #333 !important;
    }

    .meal-zusatzstoffe-info {
        font-size: 7px;
        line-height: 1.1;
        color: #555 !important;
        font-style: italic;
        margin-top: 1px;
    }

    .no-meals,
    .holiday-notice {
        font-size: 8px;
        color: #666 !important;
    }

    .holiday-notice {
        min-height: 35px;
        padding: 4px 4px;
        gap: 2px;
    }

    .holiday-notice-text {
        font-size: 7px;
        line-height: 1.1;
    }

    .holiday-notice-name {
        font-size: 6px;
        line-height: 1.2;
        opacity: 1;
        word-break: break-word;
        overflow-wrap: anywhere;
        hyphens: auto;
    }

    .holiday-corner-icon,
    .holiday-notice-icon {
        min-width: 16px;
        height: 14px;
        min-height: 14px;
        padding: 0 3px;
        font-size: 7px;
        box-shadow: none;
    }

    .week-separator {
        margin: 2px 0;
        height: 1px;
    }

    /* Meal type colors in print */
    .meal.meal-type-veg {
        background: rgba(76, 175, 80, 0.15) !important;
        border-left: 2px solid rgb(76, 175, 80) !important;
        padding-left: 6px !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .meal.meal-type-meat {
        background: rgba(255, 152, 0, 0.15) !important;
        border-left: 2px solid rgb(255, 152, 0) !important;
        padding-left: 6px !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    /* Print-only footer - positioned at bottom */
    .print-only-footer {
        display: block !important;
        margin-top: auto;
        padding-top: 4px;
        border-top: 2px solid #333;
        font-size: 7px;
        line-height: 1.3;
    }

    .print-footer-section {
        margin-bottom: 2px;
    }

    .print-footer-bio {
        display: grid;
        grid-template-columns: 50px 1fr;
        gap: 6px;
        align-items: start;
    }

    .bio-logo {
        max-width: 100%;
        height: auto;
        max-height: 40px;
    }

    .bio-text {
        font-size: 7px;
        color: #000 !important;
    }

    .bio-text strong {
        font-size: 8px;
        font-weight: bold;
        color: #000 !important;
    }

    .bio-text p {
        margin: 2px 0;
        line-height: 1.3;
        color: #000 !important;
    }

    .bio-note {
        font-weight: bold;
        margin-top: 3px !important;
        color: #000 !important;
    }

    .zusatzstoffe-compact {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 6px;
        color: #000 !important;
    }

    .zusatz-column {
        font-size: 7px;
        line-height: 1.3;
        color: #000 !important;
    }

    .zusatz-column strong {
        display: block;
        margin-bottom: 2px;
        font-size: 8px;
        font-weight: bold;
        color: #000 !important;
    }

    .zusatz-column span {
        font-weight: normal;
        color: #000 !important;
    }

    .zusatz-column b {
        color: #000 !important;
        margin-bottom: 2px;
        font-size: 8px;
        font-weight: bold;
    }

    /* Make numbers and letters bold in zusatzstoffe */
    .zusatz-column span {
        font-weight: normal;
    }

    /* Hide main footer in print */
    footer {
        display: none !important;
    }
}
