/**
 * Public-facing styles for Weekly Dining Menu plugin
 */

:root {
    --primary-color: #002753;
    --secondary-color: #e2e8f0;
    --accent-color: #ff5da8;
    --dark-color: #4c1920;
    --light-color: #f8fafc;
    --gluten-free-color: #ff5da8;
}

/* Container */
.wdmjh-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* Header */
.wdmjh-container .wdmjh-header {
    background-color: var(--primary-color) !important;
    color: white !important;
    padding: 30px;
    text-align: center;
    border-radius: 10px 10px 0 0;
    margin-bottom: 20px;
}

.wdmjh-container .wdmjh-header h2 {
    margin: 0;
    font-size: 2rem;
    font-weight: 600;
    color: white !important;
}

.wdmjh-container .wdmjh-header p {
    margin: 5px 0 0;
    font-size: 1.1rem;
    color: white !important;
}

/* Controls */
.wdmjh-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.wdmjh-week-selector {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.wdmjh-week-btn {
    padding: 8px 16px;
    background-color: var(--secondary-color);
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
}

.wdmjh-week-btn.active {
    background-color: var(--primary-color);
    color: white !important;
}

.wdmjh-toggle-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.wdmjh-toggle-switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

.wdmjh-toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.wdmjh-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
}

.wdmjh-slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .wdmjh-slider {
    background-color: var(--gluten-free-color);
}

input:checked + .wdmjh-slider:before {
    transform: translateX(26px);
}

/* Legend */
.wdmjh-legend {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.wdmjh-legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.wdmjh-legend-color {
    width: 20px;
    height: 20px;
    border-radius: 5px;
}

.wdmjh-gluten-free-color {
    background-color: var(--gluten-free-color);
}

/* Menu grid */
.wdmjh-menu-grid {
    display: grid;
    grid-template-columns: 120px repeat(5, 1fr);
    gap: 1px;
    background-color: #ddd;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 20px;
}

.wdmjh-container .wdmjh-menu-header {
    background-color: var(--primary-color) !important;
    color: white !important;
    font-weight: bold;
    text-align: center;
    padding: 15px 10px;
}

.wdmjh-container .wdmjh-day-header {
    background-color: var(--dark-color) !important;
    color: white !important;
    writing-mode: vertical-lr;
    transform: rotate(180deg);
    text-align: center;
    padding: 15px 10px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wdmjh-menu-cell {
    background-color: white;
    padding: 15px;
    min-height: 120px;
}

.wdmjh-menu-item {
    margin-bottom: 5px;
}

.wdmjh-gluten-free {
    color: var(--gluten-free-color) !important;
    font-weight: bold;
}

.wdmjh-hidden {
    display: none;
}

.wdmjh-no-meal {
    color: #888;
    font-style: italic;
}

/* Mobile view is server-rendered alongside the desktop grid and toggled
   purely by the media query below (not by JS), so it's hidden by default. */
.wdmjh-mobile-view {
    display: none;
}

/* Extras */
.wdmjh-extras {
    background-color: white;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
}

.wdmjh-extras h3 {
    margin-bottom: 10px;
    color: var(--primary-color) !important;
}

.wdmjh-disclaimer {
    font-style: italic;
    text-align: center;
    margin-top: 20px;
}

/* Mobile view */
@media (max-width: 1000px) {
    .wdmjh-menu-grid {
        grid-template-columns: 100px repeat(5, 1fr);
        font-size: 0.9rem;
    }
}

@media (max-width: 768px) {
    .wdmjh-desktop-menu {
        display: none;
    }

    .wdmjh-mobile-view {
        display: block;
    }

    .wdmjh-mobile-view .wdmjh-day-container {
        background-color: white;
        border-radius: 10px;
        overflow: hidden;
        margin-bottom: 20px;
    }

    .wdmjh-mobile-view .wdmjh-day-header {
        background-color: var(--dark-color) !important;
        color: white !important;
        padding: 12px 15px;
        font-weight: bold;
    }

    .wdmjh-mobile-view .wdmjh-meal-header {
        background-color: var(--primary-color) !important;
        color: white !important;
        padding: 10px 15px;
        font-weight: bold;
    }

    .wdmjh-mobile-view .wdmjh-meal-content {
        padding: 15px;
    }
}
