/* ═══════════════════════════════════════════════════════════════════════════
   Restaurant SaaS - Site-wide Styles
   ═══════════════════════════════════════════════════════════════════════════ */

/* ─── Base ──────────────────────────────────────────────────────────────── */
html {
    position: relative;
    min-height: 100%;
}

body {
    margin-bottom: 60px;
    font-family: var(--font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
}

.footer {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 60px;
    line-height: 60px;
}

/* ─── Flash Messages ────────────────────────────────────────────────────── */
.alert {
    border-radius: 0.5rem;
}

/* ─── Cards ─────────────────────────────────────────────────────────────── */
.card {
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.card-header {
    border-radius: 0.5rem 0.5rem 0 0 !important;
}

/* ─── Tables ────────────────────────────────────────────────────────────── */
.table > thead > tr > th {
    border-bottom-width: 2px;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
}

/* ─── Forms ─────────────────────────────────────────────────────────────── */
.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color, #0d6efd);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
}

/* ─── Buttons ───────────────────────────────────────────────────────────── */
.btn {
    border-radius: 0.375rem;
}

.btn-lg {
    border-radius: 0.5rem;
}

/* ─── Navbar — Beautiful, Organized & Responsive ───────────────────────── */

.app-navbar {
    background: linear-gradient(135deg, var(--primary-color, #0d6efd) 0%, #0a58ca 100%);
    box-shadow: 0 2px 16px rgba(0,0,0,0.12);
    padding: 0.5rem 0;
    min-height: 60px;
}

.app-navbar .container {
    padding-left: 1rem;
    padding-right: 1rem;
}

/* Brand */
.navbar-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 800;
    font-size: 1.2rem;
    color: #fff !important;
    text-decoration: none;
    padding: 0.25rem 0;
}

.navbar-brand:hover {
    opacity: 0.9;
}

.navbar-logo-img {
    height: 36px;
    width: auto;
    border-radius: 8px;
    object-fit: contain;
}

.navbar-logo-icon {
    font-size: 1.5rem;
    line-height: 1;
}

.navbar-brand-text {
    white-space: nowrap;
}

/* Toggler */
.navbar-toggler {
    border-color: rgba(255,255,255,0.3);
    padding: 0.4rem 0.6rem;
    border-radius: 8px;
    transition: background 0.2s ease;
}

.navbar-toggler:hover {
    background: rgba(255,255,255,0.1);
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3E%3Cpath stroke='rgba(255,255,255,0.9)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E");
}

/* Nav Links */
.app-nav-links {
    gap: 0.15rem;
}

.app-navbar .nav-link {
    color: rgba(255,255,255,0.85) !important;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0.45rem 0.75rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.app-navbar .nav-link:hover {
    color: #fff !important;
    background: rgba(255,255,255,0.15);
}

.app-navbar .nav-link.active {
    color: #fff !important;
    background: rgba(255,255,255,0.2);
    box-shadow: 0 0 0 1px rgba(255,255,255,0.25);
}

/* Nav Icons */
.nav-icon {
    font-size: 1rem;
    line-height: 1;
    flex-shrink: 0;
}

.nav-label {
    line-height: 1;
}

/* Dropdowns */
.app-navbar .dropdown-menu {
    border: none;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.12);
    padding: 0.5rem;
    margin-top: 0.5rem;
    min-width: 200px;
    overflow: hidden;
}

.dropdown-menu-animated {
    animation: dropdownFadeIn 0.2s ease;
    transform-origin: top center;
}

@keyframes dropdownFadeIn {
    from {
        opacity: 0;
        transform: translateY(-6px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.app-navbar .dropdown-item {
    border-radius: 8px;
    padding: 0.55rem 0.85rem;
    font-weight: 500;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.15s ease;
}

.app-navbar .dropdown-item:hover {
    background: rgba(var(--primary-rgb, 13, 110, 253), 0.08);
    color: var(--primary-color, #0d6efd);
}

.app-navbar .dropdown-item.active {
    background: rgba(var(--primary-rgb, 13, 110, 253), 0.1);
    color: var(--primary-color, #0d6efd);
    font-weight: 700;
}

.app-navbar .dropdown-header {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #888;
    padding: 0.4rem 0.85rem 0.2rem;
}

.app-navbar .dropdown-divider {
    margin: 0.35rem 0;
    opacity: 0.1;
}

/* Right Side: Language & User */
.app-nav-right .nav-link {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.nav-lang-toggle,
.nav-user-toggle {
    padding: 0.35rem 0.6rem !important;
}

/* User Avatar */
.nav-user-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    color: #fff;
    font-weight: 700;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

.nav-user-name {
    max-width: 130px;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.85rem;
}

/* Register Link Highlight */
.nav-link-register {
    background: rgba(255,255,255,0.15);
    border-radius: 8px !important;
    margin-left: 0.25rem;
}

.nav-link-register:hover {
    background: rgba(255,255,255,0.25) !important;
}

/* Mobile Divider */
.app-nav-divider {
    border-color: rgba(255,255,255,0.15);
    margin: 0.5rem 0;
}

/* ═══════════════════════════════════════════════════════════════════════
   Responsive: Navbar
   ═══════════════════════════════════════════════════════════════════════ */

@media (max-width: 991.98px) {
    .app-navbar {
        padding: 0.35rem 0;
    }

    .app-navbar .navbar-collapse {
        background: rgba(0,0,0,0.05);
        margin: 0.5rem -0.5rem -0.35rem;
        padding: 0.5rem 0.75rem;
        border-radius: 12px;
        max-height: calc(100vh - 80px);
        overflow-y: auto;
    }

    .app-nav-links {
        gap: 0;
    }

    .app-navbar .nav-link {
        padding: 0.6rem 0.85rem;
        font-size: 0.9rem;
        border-radius: 8px;
    }

    .app-navbar .dropdown-menu {
        background: rgba(255,255,255,0.95);
        backdrop-filter: blur(10px);
        border: none;
        box-shadow: none;
        margin: 0.25rem 0 0.25rem 1rem;
        padding: 0.35rem 0;
    }

    .app-navbar .dropdown-item {
        padding: 0.55rem 1rem;
    }

    .nav-lang-toggle .nav-label,
    .nav-user-name {
        display: inline !important;
    }

    .app-nav-right .nav-link {
        padding: 0.5rem 0.85rem;
    }
}

@media (max-width: 576px) {
    .navbar-brand-text {
        font-size: 1rem;
    }

    .navbar-logo-img {
        height: 28px;
    }

    .nav-user-name {
        max-width: 100px;
        font-size: 0.8rem;
    }
}

/* ─── Badges ────────────────────────────────────────────────────────────── */
.badge {
    font-weight: 500;
    padding: 0.4em 0.6em;
}

/* ─── Login / Register ──────────────────────────────────────────────────── */
.card-title {
    font-weight: 700;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Menu Grid — Beautiful, Organized & Responsive
   ═══════════════════════════════════════════════════════════════════════════ */

/* Menu Page Container */
.menu-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 0.5rem;
}

/* Hero Section */
.menu-hero {
    padding: 2rem 1rem 1.5rem;
}

.menu-logo {
    max-height: 90px;
    width: auto;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.menu-title {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 0.25rem;
    color: #1a1a2e;
}

.menu-subtitle {
    font-size: 0.95rem;
    color: #888;
    margin-bottom: 0;
}

/* Category Filter Pills — Sticky Navigation */
.menu-categories-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 0.75rem 0;
    margin: 0 -0.5rem;
    border-bottom: 1px solid rgba(0,0,0,0.06);
}

.menu-categories-nav.is-sticky {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    padding-left: max(0.5rem, env(safe-area-inset-left));
    padding-right: max(0.5rem, env(safe-area-inset-right));
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    animation: menuNavSlideDown 0.25s ease;
}

@keyframes menuNavSlideDown {
    from { transform: translateY(-100%); }
    to   { transform: translateY(0); }
}

.menu-categories-scroll {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    scroll-behavior: smooth;
    padding: 0 0.5rem;
    -ms-overflow-style: none;
    scrollbar-width: none;
    justify-content: flex-start;
    flex-wrap: nowrap;
}

.menu-categories-scroll::-webkit-scrollbar {
    display: none;
}

.menu-cat-pill {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1.15rem;
    border-radius: 100px;
    border: 1.5px solid #e0e0e0;
    background: #fff;
    color: #555;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    user-select: none;
}

.menu-cat-pill:hover {
    border-color: var(--primary-color, #0d6efd);
    color: var(--primary-color, #0d6efd);
    background: rgba(13, 110, 253, 0.04);
}

.menu-cat-pill.active {
    background: var(--primary-color, #0d6efd);
    border-color: var(--primary-color, #0d6efd);
    color: #fff;
    box-shadow: 0 2px 8px rgba(13, 110, 253, 0.3);
}

/* Section Headers */
.menu-section {
    margin-bottom: 2.5rem;
}

.menu-section-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.35rem;
    font-weight: 700;
    color: #1a1a2e;
    padding-bottom: 0.75rem;
    margin-bottom: 1.25rem;
    border-bottom: 2px solid #f0f0f0;
    scroll-margin-top: 80px;
}

.menu-section-icon {
    font-size: 1.5rem;
    line-height: 1;
}

.menu-section-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #f0f0f0;
    color: #777;
    font-size: 0.8rem;
    font-weight: 600;
    min-width: 24px;
    height: 24px;
    border-radius: 100px;
    padding: 0 8px;
    margin-left: auto;
}

/* Menu Item Card */
.menu-item-card {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    border: 1.5px solid #f0f0f0;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
    cursor: pointer;
    height: 100%;
}

.menu-item-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
    border-color: var(--primary-color, #0d6efd);
}

/* Menu Item Image — 3:2 Aspect Ratio */
.menu-item-img-wrap {
    position: relative;
    width: 100%;
    padding-top: 66.67%;
    overflow: hidden;
    background: #f8f8f8;
}

.menu-item-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.menu-item-card:hover .menu-item-img {
    transform: scale(1.06);
}

/* Menu Item Placeholder — for items without images */
.menu-item-img-placeholder {
    position: relative;
    width: 100%;
    padding-top: 66.67%;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    overflow: hidden;
}

.menu-item-placeholder-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2.5rem;
    opacity: 0.45;
}

/* Menu Item Body */
.menu-item-body {
    padding: 0.9rem 1rem 1rem;
}

.menu-item-category-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--primary-color, #0d6efd);
    background: rgba(13, 110, 253, 0.08);
    padding: 2px 8px;
    border-radius: 4px;
    margin-bottom: 0.4rem;
}

.menu-item-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0 0 0.6rem;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.menu-item-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.menu-item-price {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--primary-color, #0d6efd);
}

.menu-item-unavailable {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #dc3545;
    background: rgba(220,53,69,0.08);
    padding: 2px 8px;
    border-radius: 4px;
}

/* Empty State */
.menu-empty-icon {
    font-size: 4rem;
    opacity: 0.4;
}

/* CTA Button */
.menu-cta {
    padding: 1rem 0 2rem;
}

.menu-order-btn {
    padding: 0.8rem 2.5rem;
    font-size: 1.1rem;
    font-weight: 700;
    border-radius: 100px;
    box-shadow: 0 4px 16px rgba(13, 110, 253, 0.3);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.menu-order-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(13, 110, 253, 0.4);
}

/* ═══════════════════════════════════════════════════════════════════════════
   Responsive: Menu
   ═══════════════════════════════════════════════════════════════════════════ */

@media (max-width: 992px) {
    .menu-item-img-wrap,
    .menu-item-img-placeholder {
        padding-top: 60%;
    }
}

@media (max-width: 768px) {
    .container {
        padding-left: 12px;
        padding-right: 12px;
    }

    h1 {
        font-size: 1.5rem;
    }

    h2 {
        font-size: 1.25rem;
    }

    .menu-title {
        font-size: 1.5rem;
    }

    .menu-logo {
        max-height: 65px;
    }

    .menu-categories-nav {
        top: 0;
        padding: 0.5rem 0;
    }

    .menu-cat-pill {
        padding: 0.4rem 0.9rem;
        font-size: 0.8rem;
    }

    .menu-section-title {
        font-size: 1.15rem;
        scroll-margin-top: 70px;
    }

    .menu-item-name {
        font-size: 0.875rem;
    }

    .menu-item-price {
        font-size: 1rem;
    }

    .menu-order-btn {
        padding: 0.7rem 2rem;
        font-size: 1rem;
    }
}

@media (max-width: 576px) {
    .menu-grid .row {
        --bs-gutter-y: 0.75rem;
        --bs-gutter-x: 0.5rem;
    }

    .menu-item-body {
        padding: 0.7rem 0.75rem 0.8rem;
    }

    .menu-item-card {
        border-radius: 12px;
    }
}

/* ─── Order Confirm ─────────────────────────────────────────────────────── */
#pin {
    font-size: 1.75rem;
    letter-spacing: 8px;
    font-weight: 700;
}

/* ─── Thank You ─────────────────────────────────────────────────────────── */
.display-1 {
    font-weight: 800;
}

/* ─── Print Styles ──────────────────────────────────────────────────────── */
@media print {
    .navbar,
    .footer,
    .btn {
        display: none !important;
    }

    body {
        margin: 0;
        padding: 0;
    }

    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}
