/* Daily Lunch Menu Frontend Styles */

/* Main block container */
.lunch-menu-block {
    margin: 20px 0;
    padding: 20px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Full height variant */
.lunch-menu-block.full-height {
    margin: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 300px; /* Ensure minimum height */
    box-sizing: border-box; /* Include padding in height calculation */
    position: relative; /* Ensure proper positioning */
}

/* Kadence theme specific adjustments */
.kt-inside-inner-col .lunch-menu-block.full-height {
    height: auto !important; /* Override inline height for Kadence columns */
    min-height: 300px;
}

.lunch-menu-block.full-height .menu-controls {
    flex-shrink: 0;
    margin-bottom: 0; /* Remove margin to avoid spacing issues */
}

.lunch-menu-block.full-height .menu-display {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

/* Ensure menu content fills the available space in full height mode */
.lunch-menu-block.full-height .menu-display .daily-menu,
.lunch-menu-block.full-height .menu-display .weekly-menu,
.lunch-menu-block.full-height .menu-display .monthly-menu {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.lunch-menu-block.full-height .menu-display .daily-menu .menu-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

/* User controls */
.menu-controls {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: space-between;
}

.menu-controls select,
.menu-controls input[type="date"] {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
}

.menu-controls select {
    min-width: 120px;
}

.menu-controls input[type="date"] {
    min-width: 150px;
}

.menu-controls button {
    padding: 8px 16px;
    background: #0073aa;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.2s ease;
}

.menu-controls button:hover {
    background: #005a87;
}

.menu-controls button:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.3);
}

/* Navigation controls */
.date-navigation {
    display: flex;
    align-items: center;
    gap: 15px;
}

.date-navigation button {
    padding: 6px 12px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s ease;
}

.date-navigation button:hover {
    background: #5a6268;
}

.date-navigation button:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(108, 117, 125, 0.3);
}

.current-period {
    font-weight: 600;
    color: #2c3e50;
    min-width: 200px;
    text-align: center;
    font-size: 16px;
}

/* Menu display area */
.menu-display {
    min-height: 100px;
}

/* Daily menu display */
.daily-menu {
    text-align: center;
}

.daily-menu h3 {
    margin: 0 0 15px 0;
    color: #2c3e50;
    font-size: 24px;
    font-weight: 600;
    border-bottom: 2px solid var(--date-bar-color, #3498db);
    padding-bottom: 10px;
}

.daily-menu .menu-content {
    font-size: 16px;
    line-height: 1.6;
    color: #34495e;
    background: #f8f9fa;
    padding: 20px;
    border-radius: 6px;
    margin: 15px 0;
    white-space: pre-wrap;
}

.daily-menu .closed-notice {
    font-size: 18px;
    color: #e74c3c;
    font-weight: 600;
    font-style: italic;
    padding: 20px;
    background: #fdf2f2;
    border: 1px solid #fecaca;
    border-radius: 6px;
    margin: 15px 0;
}

.daily-menu .menu-notice {
    font-size: 16px;
    color: #f39c12;
    font-weight: 500;
    font-style: italic;
    padding: 15px;
    background: #fef9e7;
    border: 1px solid #fbeaa0;
    border-radius: 6px;
    margin: 15px 0;
    text-align: center;
}

/* Cafe status messages */
.cafe-status {
    font-size: 16px;
    font-weight: 600;
    padding: 15px;
    border-radius: 6px;
    margin: 0 0 20px 0;
    text-align: center;
}

.cafe-status-closed-before-open {
    color: #8b5cf6;
    background: #f3f4f6;
    border: 1px solid #d1d5db;
}

.cafe-status-closed-showing-next {
    color: #dc2626;
    background: #fef2f2;
    border: 1px solid #fecaca;
}

.cafe-status-open {
    color: #059669;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
}

/* Menu comment styling */
.menu-comment {
    margin-top: 20px;
    padding: 15px;
    text-align: center;
    font-style: italic;
    color: #666;
    font-size: 14px;
    border-top: 1px solid #e0e0e0;
    background: #f9f9f9;
    border-radius: 0 0 6px 6px;
}

/* Weekly menu display */
.weekly-menu {
    margin-bottom: 20px;
}

.weekly-menu h3 {
    margin: 0 0 20px 0;
    color: #2c3e50;
    font-size: 24px;
    font-weight: 600;
    text-align: center;
    border-bottom: 2px solid var(--date-bar-color, #3498db);
    padding-bottom: 10px;
}

.weekly-menu .daily-menu-item {
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 4px solid var(--date-bar-color, #3498db);
}

.weekly-menu .daily-menu-item h4 {
    margin: 0 0 10px 0;
    color: #2c3e50;
    font-size: 18px;
    font-weight: 600;
}

.weekly-menu .daily-menu-item .menu-content {
    font-size: 14px;
    line-height: 1.5;
    color: #34495e;
    margin: 0;
}

.weekly-menu .daily-menu-item .closed-notice {
    font-size: 14px;
    color: #e74c3c;
    font-weight: 600;
    font-style: italic;
    margin: 0;
    padding: 0;
}

/* Monthly menu display */
.monthly-menu {
    margin-bottom: 20px;
}

.monthly-menu h3 {
    margin: 0 0 20px 0;
    color: #2c3e50;
    font-size: 24px;
    font-weight: 600;
    text-align: center;
    border-bottom: 2px solid var(--date-bar-color, #3498db);
    padding-bottom: 10px;
}

.monthly-menu .week-group {
    margin-bottom: 25px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.monthly-menu .week-group h4 {
    margin: 0 0 15px 0;
    color: #2c3e50;
    font-size: 18px;
    font-weight: 600;
    text-align: center;
    padding-bottom: 8px;
    border-bottom: 1px solid #dee2e6;
}

.monthly-menu .daily-menu-item {
    margin-bottom: 15px;
    padding: 12px;
    background: #fff;
    border-radius: 6px;
    border-left: 3px solid var(--date-bar-color, #3498db);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.monthly-menu .daily-menu-item:last-child {
    margin-bottom: 0;
}

.monthly-menu .daily-menu-item h5 {
    margin: 0 0 8px 0;
    color: #2c3e50;
    font-size: 16px;
    font-weight: 600;
}

.monthly-menu .daily-menu-item .menu-content {
    font-size: 14px;
    line-height: 1.5;
    color: #34495e;
    margin: 0;
}

.monthly-menu .daily-menu-item .closed-notice {
    font-size: 14px;
    color: #e74c3c;
    font-weight: 600;
    font-style: italic;
    margin: 0;
    padding: 0;
}

/* Empty state */
.menu-display p {
    text-align: center;
    color: #6c757d;
    font-style: italic;
    padding: 40px 20px;
    background: #f8f9fa;
    border-radius: 6px;
    margin: 0;
}

/* Loading state */
.menu-display.loading {
    position: relative;
    opacity: 0.6;
    pointer-events: none;
}

.menu-display.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #ddd;
    border-top-color: var(--date-bar-color, #3498db);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive design */
@media (max-width: 768px) {
    .lunch-menu-block {
        margin: 15px 0;
        padding: 15px;
    }
    
    .menu-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }
    
    .menu-controls select {
        width: 100%;
        min-width: auto;
    }
    
    .date-navigation {
        justify-content: space-between;
    }
    
    .current-period {
        min-width: auto;
        flex: 1;
        margin: 0 10px;
    }
    
    .daily-menu h3 {
        font-size: 20px;
    }
    
    .weekly-menu h3,
    .monthly-menu h3 {
        font-size: 20px;
    }
    
    .weekly-menu .daily-menu-item,
    .monthly-menu .week-group {
        padding: 12px;
    }
    
    .monthly-menu .daily-menu-item {
        padding: 10px;
    }
}

@media (max-width: 480px) {
    .lunch-menu-block {
        padding: 10px;
    }
    
    .daily-menu h3 {
        font-size: 18px;
    }
    
    .daily-menu .menu-content {
        font-size: 14px;
        padding: 15px;
    }
    
    .weekly-menu h3,
    .monthly-menu h3 {
        font-size: 18px;
    }
    
    .weekly-menu .daily-menu-item h4 {
        font-size: 16px;
    }
    
    .monthly-menu .week-group h4 {
        font-size: 16px;
    }
    
    .monthly-menu .daily-menu-item h5 {
        font-size: 14px;
    }
}

/* Print styles */
@media print {
    .lunch-menu-block {
        box-shadow: none;
        border: 1px solid #000;
    }
    
    .menu-controls {
        display: none;
    }
    
    .daily-menu h3,
    .weekly-menu h3,
    .monthly-menu h3 {
        color: #000;
        border-bottom-color: #000;
    }
    
    .weekly-menu .daily-menu-item,
    .monthly-menu .daily-menu-item {
        break-inside: avoid;
    }
}