/* ========================================
   MODERN MENU BOARD STYLES
   Unique classes prefixed with 'mb-' (menu board)
   ======================================== */

/* ── Force page background white ───────────────────────────
   x-layout-hf wraps the slot in .opml-root which has a dark
   background. These two rules override it so the menu board
   always shows on a light background regardless of layout.
   DO NOT REMOVE these lines — they fix the black page bug.
──────────────────────────────────────────────────────────── */
html,
body {
    background: #f1f5f9 !important;
}

.opml-root,
.rui-page {
    background: #f1f5f9 !important;
}

/* Main Container */
.mb-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    min-height: 100vh;
}

/* Header Section */
.mb-header {
    text-align: center;
    margin-bottom: 30px;
}

.mb-title {
    font-size: 42px;
    font-weight: 800;
    color: #1e293b;
    margin: 0 0 10px 0;
    letter-spacing: -0.5px;
    text-transform: uppercase;
}

.mb-back-link {
    display: inline-flex;
    align-items: center;
    color: #4f46e5;
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    padding: 8px 16px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.mb-back-link:hover {
    background: rgba(79, 70, 229, 0.1);
    color: #4338ca;
}

.mb-back-link::before {
    content: "← ";
    margin-right: 5px;
}

/* Card Container */
.mb-card {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05), 0 10px 15px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    margin-top: 20px;
}

/* Table Wrapper for horizontal scroll */
.mb-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Table */
.mb-table {
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
}

/* Table Header */
.mb-table thead {
    background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);
}

.mb-table thead tr {
    border: none;
}

.mb-table thead th {
    padding: 20px 24px;
    text-align: left;
    font-weight: 700;
    font-size: 14px;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: none;
}

/* Table Body */
.mb-table tbody tr {
    border-bottom: 1px solid #e5e7eb;
    transition: all 0.2s ease;
    background: #ffffff;
}

.mb-table tbody tr:hover {
    background: #f8fafc;
    transform: scale(1.001);
}

.mb-table tbody tr:last-child {
    border-bottom: none;
}

.mb-table tbody td {
    padding: 20px 24px;
    color: #1f2937;
    font-size: 16px;
    vertical-align: middle;
    background: transparent;
}

/* ── Image Cell (new) ───────────────────────────────────────
   Added to support the food photo column.
   If no image exists the emoji placeholder shows instead.
──────────────────────────────────────────────────────────── */
.mb-img-cell {
    width: 80px;
    padding: 12px 8px 12px 24px !important;
}

.mb-item-img {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    display: block;
}

.mb-no-img {
    width: 64px;
    height: 64px;
    background: #f1f5f9;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

/* Category Cell */
.mb-category {
    font-weight: 700;
    font-size: 16px;
    color: #ca8a04;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* Name Cell */
.mb-name {
    font-weight: 600;
    font-size: 18px;
    color: #1f2937;
}

/* Description Cell */
.mb-description {
    color: #6b7280;
    font-size: 15px;
    line-height: 1.5;
    max-width: 400px;
}

/* Price Cell */
.mb-price {
    font-weight: 700;
    font-size: 20px;
    color: #10b981;
    white-space: nowrap;
}

/* Empty State */
.mb-empty {
    text-align: center;
    padding: 60px 20px;
    color: #9ca3af;
}

.mb-empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.mb-empty-text {
    font-size: 18px;
    font-weight: 500;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .mb-title {
        font-size: 36px;
    }
    
    .mb-table thead th,
    .mb-table tbody td {
        padding: 16px 20px;
    }
    
    .mb-name {
        font-size: 17px;
    }
    
    .mb-description {
        font-size: 14px;
    }
}

@media (max-width: 768px) {
    .mb-container {
        padding: 16px;
    }
    
    .mb-title {
        font-size: 28px;
    }
    
    .mb-card {
        border-radius: 12px;
    }
    
    .mb-table thead th {
        padding: 14px 16px;
        font-size: 12px;
    }
    
    .mb-table tbody td {
        padding: 14px 16px;
        font-size: 15px;
    }
    
    .mb-category {
        font-size: 14px;
    }
    
    .mb-name {
        font-size: 16px;
    }
    
    .mb-description {
        font-size: 13px;
        max-width: 250px;
    }
    
    .mb-price {
        font-size: 18px;
    }

    /* Shrink image on tablet */
    .mb-item-img,
    .mb-no-img {
        width: 52px;
        height: 52px;
    }
}

@media (max-width: 480px) {
    .mb-container {
        padding: 12px;
        background: #ffffff;
    }
    
    .mb-title {
        font-size: 24px;
    }
    
    .mb-header {
        margin-bottom: 20px;
    }
    
    .mb-card {
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    }
    
    .mb-table thead th {
        padding: 12px;
        font-size: 11px;
    }
    
    .mb-table tbody td {
        padding: 12px;
        font-size: 14px;
    }
    
    .mb-category,
    .mb-name {
        font-size: 14px;
    }
    
    .mb-description {
        font-size: 12px;
        max-width: 180px;
    }
    
    .mb-price {
        font-size: 16px;
    }

    /* Hide description on very small phones — not enough room */
    .mb-table thead th:nth-child(4),
    .mb-table tbody td:nth-child(4) {
        display: none;
    }

    /* Smaller image on phone */
    .mb-item-img,
    .mb-no-img {
        width: 44px;
        height: 44px;
        border-radius: 8px;
    }

    .mb-img-cell {
        padding: 8px 6px 8px 12px !important;
    }
}

/* Print Styles */
@media print {
    .mb-back-link {
        display: none;
    }
    
    .mb-container {
        background: white;
    }
    
    .mb-card {
        box-shadow: none;
    }
    
    .mb-table tbody tr:hover {
        background: transparent;
    }
}

/* Animation for page load */
@keyframes mb-fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.mb-table tbody tr {
    animation: mb-fadeIn 0.3s ease-out;
}

/* Loading Animation */
.mb-loading {
    text-align: center;
    padding: 40px;
    color: #9ca3af;
}

.mb-loading::after {
    content: "";
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid #e5e7eb;
    border-radius: 50%;
    border-top-color: #4f46e5;
    animation: mb-spin 0.8s linear infinite;
}

@keyframes mb-spin {
    to { transform: rotate(360deg); }
}