/* Background image */
body {
    font-family: 'Inter', 'Roboto', Arial, sans-serif;
}

body {
    background: url('/static/images/tile.png') repeat;
    background-size: auto;
    position: relative;
}

/* Background overlay */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.7); /* 70% light overlay */
    backdrop-filter: blur(0px);
    z-index: -1;
    pointer-events: none;
}

.titlebar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #e0e7ff;
  padding: 5px 10px;
  border-bottom: 2px solid #cbd5e1;
  font-family: Arial, sans-serif;
}

.titlebar-left {
  display: flex;
  align-items: center;
}

.title-icon {
  width: 16px;
  height: 16px;
  margin-right: 8px;
}

.title-text {
  font-size: 14px;
  font-weight: bold;
  color: #1f2937;
}

.titlebar-right {
  display: flex;
  gap: 5px;
}

.title-btn {
  background-color: #f1f5f9;
  border: none;
  padding: 2px 8px;
  font-size: 14px;
  cursor: pointer;
  color: #1f2937;
  border-radius: 4px;
}

.title-btn:hover {
  background-color: #cbd5e1;
  color: #ef4444;
}

.page-container {
  padding-bottom: 120px;
}

.sidebar-button img {
    width: 20px;
    height: 20px;
    margin-right: 10px; /* spacing for expanded mode */
}

/* Hide labels when collapsed */
.sidebar.collapsed .sidebar-label {
    display: none;
}

/* Align icons with hamburger (left-aligned) */
.sidebar.collapsed .sidebar-button {
    justify-content: flex-start;
}

/* Remove icon spacing when collapsed */
.sidebar.collapsed .sidebar-button img {
    margin-right: 0;
}

.content {
    flex-grow: 1;
    padding: 20px;
}

/* Container spacing */
.home-container {
    width: 100%;
    max-width: none;   /* remove 1200px cap */
    margin: 0;         /* no auto-centering */
    padding: 0 32px;   /* nice side padding */
    box-sizing: border-box;
}

.home-header-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 20px 28px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);

    width: 100%;
    max-width: none;      /* remove 1200px cap */
    margin: 0 0 25px 0;   /* align with container edges */
    box-sizing: border-box;
}

.home-title {
    font-size: 32px;
    margin-bottom: 10px;
}

.home-subtitle {
    font-size: 18px;
    color: #555;
    margin-bottom: 30px;
}

.home-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.home-card {
    background: #ffffff;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    text-decoration: none;
    color: #333;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between; /* pushes count to bottom */
    align-items: center;            /* keeps icon centered */
}

.home-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.home-card img {
    width: 40px;
    height: 40px;
    margin-bottom: 10px;
}

/* Spotlight matches header card width */
.spotlight-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 20px 28px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    margin: 0 0 25px 0; /* remove auto-centering */
    width: 100%;
    max-width: none;   /* remove width cap */
    box-sizing: border-box;
}

.spotlight-title {
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 15px;
}

.spotlight-term {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 8px;
}

.spotlight-definition {
    font-size: 15px;
    color: #444;
    line-height: 1.4;
}

.spotlight-wrapper {
    margin-bottom: 25px;
}

@media (max-width: 600px) {

    /* Make sidebar narrower on mobile */
    .sidebar {
        width: 200px;
    }

    /* Collapsed width stays the same */
    .sidebar.collapsed {
        width: 50px;
    }

    /* Reduce padding so items don’t feel oversized */
    .sidebar-button {
        padding: 6px;
        font-size: 13px;
    }

    /* Hamburger stays left-aligned but with tighter spacing */
    .hamburger {
        padding: 8px;
        font-size: 18px;
        justify-content: flex-start;
    }

    /* Icons scale slightly for mobile */
    .sidebar-button img {
        width: 18px;
        height: 18px;
    }
}

/* Title */
.nav-title {
    font-size: 20px;
    font-weight: bold;
    color: #333;
    text-align: center;
    flex-grow: 1;
}

/* Right-side buttons */
.nav-right {
    display: flex;
    gap: 10px;
}

.nav-btn {
    background: #f1f5f9;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
}

.nav-btn:hover {
    background: #e2e8f0;
}

/* MOBILE BEHAVIOUR */
@media (max-width: 600px) {

    .navbar {
        padding: 10px 14px;
    }

    .nav-title {
        font-size: 18px;
    }

    .nav-right {
        display: none; /* hide right buttons on mobile */
    }

    .nav-hamburger {
        font-size: 22px;
        padding: 4px 8px;
    }
}

.navbar-outer {
    position: sticky;
    top: 0;
    z-index: 10000; /* lift above overlays */

    background: #ffffff;
    border-bottom: 2px solid #e5e7eb;

    padding: 6px 16px;

    margin: 12px 16px;        /* floating space */
    border-radius: 12px;      /* rounded corners */
    box-shadow: 0 2px 6px rgba(0,0,0,0.1); /* subtle float */
}

.navbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.admin-navbar-outer {
    position: sticky;
    top: 0;
    z-index: 1000;

    background: transparent;
    border: none;

    padding: 6px 16px;

    margin: 12px 16px 0 16px;   /* ⭐ bottom margin = 0 */
    border-radius: 12px;
    box-shadow: none;
}

.admin-navbar {
    padding: 6px 16px;   /* ← moved here */
}

.nav-hamburger {
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
}

.nav-logo img {
    height: 40px;
    width: auto;
}

/* Right-side buttons */
.nav-right {
    display: flex;
    gap: 10px;
}

/* Mobile */
@media (max-width: 600px) {
    .nav-right {
        display: none;
    }

    .nav-logo img {
        height: 36px;
    }
}

/* Dropdown menu positioned under hamburger */
.hamburger-wrapper {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    pointer-events: none;
    width: max-content;
    top: 100%;
    left: 0;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    display: none;
    padding: 6px 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.dropdown-menu.show {
    display: block;
    pointer-events: auto;
}


.dropdown-item {
    display: flex;
    align-items: center;
    padding: 10px;
    text-decoration: none;
    color: #333;
    border-radius: 8px;
}

.dropdown-item img {
    width: 22px;
    height: 22px;
    margin-right: 10px;
}

.dropdown-item:hover {
    background: rgba(0,0,0,0.05);
}

.two-column-row {
    display: flex;
    gap: 20px;
    margin: 25px 0;
}

.half-card {
    flex: 1;
}

.home-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 20px 28px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    width: 100%;
    box-sizing: border-box;
}

.view-button {
    display: inline-block;
    margin-top: 12px;
    padding: 10px 16px;
    background: rgba(255,255,255,0.6);
    backdrop-filter: blur(6px);
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.8);
    color: #1f2937;
    font-weight: bold;
    text-decoration: none;
    transition: background 0.2s ease, transform 0.15s ease;
}

.view-button:hover {
    background: rgba(255,255,255,0.8);
    transform: translateY(-2px);
}

.record-count {
    font-size: 18px;
    font-weight: bold;
    color: #555;
    text-align: center;
    margin-top: auto; /* ensures it sits at the bottom */
}

.admin-navbar {
    width: 100%;
    height: 70px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 18px;
    border-radius: 12px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

/* Hamburger */
.nav-hamburger {
    font-size: 26px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px 10px;
}

/* Center logo */
.nav-logo img {
    height: 100px;
    display: block;
    margin: 0 auto;
}

/* Ribbon buttons */
.nav-ribbon {
    display: flex;
    gap: 10px;
}

.nav-btn {
    background: #ffffff;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 14px;
    text-decoration: none;
    color: #333;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
    transition: background 0.15s ease, transform 0.1s ease;
}

.nav-btn:hover {
    background: #f3f3f3;
    transform: translateY(-1px);
}

.nav-btn.delete {
    background: #ffdddd;
    color: #a40000;
}

.nav-btn.delete:hover {
    background: #ffcccc;
}

/* Make the table scrollable but keep header fixed */
.table-wrapper {
    max-height: calc(100vh - 380px); /* scrollable table */
    overflow-y: auto;
    overflow-x: hidden;
    padding-bottom: 1rem; /* space above footer bar */
}

/* Freeze the header row */
.table-wrapper thead th {
    position: sticky;
    top: 0;
    background: #f8f9fa; /* Bootstrap table-light */
    z-index: 5;
}

#alphabet-ribbon {
    position: sticky;
    bottom: 20px;
    background: white;
    padding: 6px 0;
    padding-bottom: 16;
    z-index: 10;

    width: 100%;
    white-space: nowrap;
    overflow-x: auto;
    overflow-y: hidden;

    display: flex;
    justify-content: center;
    gap: 6px;

    scroll-behavior: smooth;

    /* NEW: floating card look */
    margin-bottom: 12px;
    border-radius: 12px;            /* match navbar */
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

#footer-card {
    margin-top: 1rem;
    margin-bottom: 12px;
    position: static;
    bottom: 0;
    z-index: 20;

    background: white;
    padding: 10px 16px;

    display: flex;
    justify-content: space-between;
    align-items: center;

    /* Floating card look */
    border-radius: 12px;      /* match navbar + ribbon */
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.admin-navbar {
    background: white;
    border-bottom: 1px solid #ddd;
}

.admin-navbar .btn {
    width: 90px;   /* adjust if your Delete button is wider */
    text-align: center;
}

.admin-title {
    font-size: 2rem;      /* Bigger title */
    font-weight: 600;     /* Stronger presence */
    margin: 0;
}

/* ⭐ Column Filter Panel */
.filter-panel {
    position: absolute;
    background: white;
    padding: 12px;
    border-radius: 6px;
    display: none;              /* stays hidden until JS opens it */
    z-index: 9999;
    width: 220px;
    border: 1px solid #ddd;
}

/* ⭐ Column Header Filter Button */
/* Override Bootstrap padding so our arrow spacing works */
.filter-header {
    padding-left: 20px !important;   /* ensures arrow has room */
    padding-right: 8px !important;   /* keeps right side tidy */
    position: relative;
    white-space: nowrap;
}

.filter-header .filter-btn {
    position: absolute;
    left: 4px;              /* arrow sits on the left */
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    font-size: 12px;
    opacity: 0.6;
    user-select: none;
}

.filter-header .filter-btn:hover {
    opacity: 1;
}

/* Softer Success (New) */
.btn-success {
    background-color: #b8e6c2;
    border-color: #a3d9b0;
    color: #1f5c2e;
}

/* Softer Primary (Edit) */
.btn-primary {
    background-color: #c9d9f7;
    border-color: #b4c8ef;
    color: #1f3f73;
}

/* Softer Warning (Copy) */
.btn-warning {
    background-color: #ffe8b8;
    border-color: #ffdfa3;
    color: #7a5a00;
}

/* Softer Danger (Delete) */
.btn-danger {
    background-color: #f7c9c9;
    border-color: #efb4b4;
    color: #7a1f1f;
}

.nav-btn.print {
    background: #d7eaff;   /* soft blue */
    color: #003366;        /* deep navy */
}
.nav-btn.print:hover {
    background: #c8dfff;
}

/* Page background */
.page-background {
    background: var(--dashboard-bg, #f5f5f5);
    min-height: 100vh;
}

/* Floating navbar */
.floating-navbar {
    background: white;
    border-radius: 10px;
    padding: 12px 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

/* Center logo */
.navbar-logo img {
    max-height: 40px;
    opacity: 0.9;
}

/* Floating card */
.edit-card {
    border-radius: 12px;
}

.image-box {
    min-height: 350px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 8px;
    overflow: hidden;
}

#image-preview {
    max-height: 330px;
    width: auto;
}

/* ⭐ Allergen icon sizing */
#icon-preview {
    max-height: 330px;   /* consistent icon size */
    width: auto;
    object-fit: contain;
}

.allergen-image-box {
    min-height: 350px;   /* smaller than culinary */
    max-height: 350px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 8px;
    overflow: hidden;
}

.page-background {
    background: transparent !important;
    min-height: 100vh;
}

.floating-navbar {
    padding-top: 10px;
    padding-bottom: 10px;
    min-height: 80px; /* allows bigger logo */
}

.navbar-logo-img {
    height: 100px; /* or whatever size you want */
    object-fit: contain;
}

#btn-clear-filters {
    background-color: white !important;
    border-color: #dc3545 !important;
    color: #dc3545 !important;
}

#btn-clear-filters:hover {
    background-color: #ffecec !important;
    color: #b02a37 !important; /* darker red */
    border-color: #b02a37 !important;
}

/* ⭐ Allergen image box override */
.allergen-image-box {
    min-height: 320px;
    max-height: 320px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 8px;
    overflow: hidden;
}

/* ⭐ Allergen image sizing */
#icon-preview {
    max-height: 300px !important;
    width: auto !important;
    object-fit: contain;
}

/* GLOBAL FLOATING FOOTER BAR */
#global-footer-bar {
    position: fixed;
    bottom: 16px;                 /* lift it off the bottom */
    left: 50%;
    transform: translateX(-50%);  /* center it */
    
    background: white;
    padding: 10px 16px;

    display: flex;
    justify-content: space-between;
    align-items: center;

    width: calc(100% - 32px);     /* same breathing room as navbar */
    max-width: 1400px;            /* optional: match your layout width */

    border-radius: 12px;          /* match navbar + footer card */
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);

    z-index: 9000;
}

/* Footer tool icons */
.footer-tool-icon {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    background: #ffffffaa;
    transition: background 0.2s;
}

.footer-tool-icon:hover {
    background: #ffffffdd;
}

.footer-tool-icon img {
    width: 18px;
    height: 18px;
}

/* Floating window base */
.floating-window {
    position: fixed;
    width: 480px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.25);
    z-index: 9999;
    top: 120px;
    left: 120px;
    display: flex;
    flex-direction: column;
    user-select: none;
}

/* Hidden state */
.hidden {
    display: none !important;
}

/* Header */
.floating-header {
    background: #f5f5f5;
    padding: 10px 15px;
    cursor: move;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 12px 12px 0 0;
    font-weight: bold;
}

.floating-controls button {
    background: none;
    border: none;
    font-size: 16px;
    margin-left: 8px;
    cursor: pointer;
}

/* Body */
.floating-body {
    padding: 15px;
}

.uom-row {
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
}

.uom-row label {
    font-weight: 600;
    margin-bottom: 4px;
}

.uom-row input,
.uom-row select {
    padding: 8px;
    border-radius: 6px;
    border: 1px solid #ccc;
}

.swap-row {
    align-items: center;
    text-align: center;
}

#uom-swap {
    padding: 6px 12px;
    font-size: 18px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
}

.uom-result {
    margin-top: 15px;
    font-size: 18px;
    font-weight: bold;
    text-align: center;
}

/* Wrapper that centers and scales the A5 card */
.screen-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    height: calc(100vh - 140px); /* space for navbar */
    box-sizing: border-box;
    overflow: visible; /* allow dropdowns and clicks */

}

/* Print mode: exact A5 */
@media print {
    .screen-wrapper {
        padding: 0;
        height: auto;
    }

    .page {
        transform: none !important;
        width: 560px;
        height: 794px;
    }
}

/* Screen scaling for the A5 card */
@media screen {
    .page {
        transform-origin: top center;
        transform: scale(var(--scale-factor));
    }
}

/* ------------------------------------------------------------
   ALLERGEN LIST — SCROLLABLE CONTAINER
   ------------------------------------------------------------ */
.allergen-list {
    max-height: 480px;          /* fits inside your floating card */
    overflow-y: auto;
    padding-right: 6px;         /* avoids scrollbar overlap */
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* ------------------------------------------------------------
   ALLERGEN CARD — CLEAN, STACKED ROW
   ------------------------------------------------------------ */
.allergen-card {
    display: grid;
    grid-template-columns: 60px 1fr auto;
    align-items: center;
    gap: 16px;

    background: #ffffff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;

    padding: 12px 16px;
    transition: background 0.2s ease, opacity 0.2s ease;
}

.allergen-card:hover {
    background: #fafafa;
}

/* Optional fade when "Remove" is clicked */
.allergen-card.faded {
    opacity: 0.4;
}

/* ------------------------------------------------------------
   ICON — CONSISTENT SIZING (matches allergens module)
   ------------------------------------------------------------ */
.allergen-icon img {
    width: 48px;
    height: 48px;
    object-fit: contain;
    display: block;
}

/* ------------------------------------------------------------
   NAME — CLEAN, CHEF-FRIENDLY TEXT
   ------------------------------------------------------------ */
.allergen-name {
    font-size: 1rem;
    font-weight: 500;
    color: #333;
}

/* ------------------------------------------------------------
   ACTIONS — CHECKBOX + REMOVE BUTTON
   ------------------------------------------------------------ */
.allergen-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
}

.allergen-actions input[type="checkbox"] {
    transform: scale(1.2);
    cursor: pointer;
}

.remove-allergen-btn {
    padding: 4px 10px;
    font-size: 0.85rem;
}

/* ------------------------------------------------------------
   HEADER — ADD ALLERGEN BUTTON
   ------------------------------------------------------------ */
.allergen-header {
    margin-bottom: 16px;
    display: flex;
    justify-content: flex-start;
}

/* --- TAB STRIP --- */
.tabs {
    display: flex;
    border-bottom: 1px solid #dee2e6;
    margin-bottom: 0;
}

/* --- INACTIVE TABS --- */
.tab-button {
    background: #f1f3f5;
    border: 1px solid #dee2e6;
    border-bottom: none; /* sits behind the strip border */
    padding: 10px 20px;
    cursor: pointer;
    border-radius: 8px 8px 0 0;
    margin-right: 6px;
    font-weight: 500;
    color: #495057;
    transition: background 0.2s;
    position: relative;
    top: 1px; /* makes inactive tabs sit slightly lower */
}

.tab-button:hover {
    background: #e9ecef;
}

/* --- ACTIVE TAB (open folder) --- */
.tab-button.active {
    background: white;
    border: 1px solid #dee2e6;
    border-bottom: none; /* removes bottom edge completely */
    color: #212529;
    font-weight: 600;
    position: relative;
    top: 1px;      /* aligns perfectly with panel */
    z-index: 2;    /* sits above panel */
}

/* --- TAB PANEL (left, right, bottom borders only) --- */
.tab-content {
    display: none;
    border: 1px solid #dee2e6;
    border-top: none;          /* ⭐ active tab replaces this */
    padding: 20px;
    border-radius: 0 0 8px 8px;
    background: #fff;
    position: relative;
    z-index: 1;
}

.tab-content.active {
    display: block;
}

.two-column-grid {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 30px;
}

.right-column .image-box {
    width: 100%;
    height: 260px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.right-column .image-box img {
    width: 100%;
    height: auto;
    object-fit: contain;
}

.placeholder-image {
    color: #6c757d;
    font-size: 14px;
}

.large-textarea {
    width: 100%;
    min-height: 500px;
    resize: vertical;
    padding: 16px;
    border-radius: 8px;
    border: 1px solid #ced4da;
    background: #fff;
    font-size: 15px;
    line-height: 1.5;
}

#allergens .allergen-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}

#allergens .allergen-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    background: #fafafa;
}

#allergens .allergen-icon img {
    width: 96px;
    height: 96px;
    object-fit: contain;
}

#allergens .placeholder-image {
    width: 96px;
    height: 96px;
}

#allergens .allergen-name {
    font-size: 1.1rem;
    font-weight: 500;
}

#allergen-editor-page .allergen-box {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    max-height: calc(100vh - 260px);
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}

#allergen-editor-page .allergen-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    background: #fafafa;
}

#allergen-editor-page .allergen-icon {
    width: 64px;
    height: 64px;
    object-fit: contain;
}

#allergen-editor-page .form-check-input {
    transform: scale(1.3);
}

#btnClearFilters {
    background-color: white !important;
    border-color: #dc3545 !important;
    color: #dc3545 !important;
}

#btnClearFilters:hover {
    background-color: #ffecec !important;
    color: #b02a37 !important;
    border-color: #b02a37 !important;
}

.related-card {
    position: relative;
    padding: 8px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: #ffffff; /* clean white */
    font-size: 0.9rem;
    line-height: 1.2;
    min-height: 48px;
    display: flex;
    align-items: center;
    transition: all 0.15s ease-in-out; /* smooth hover */
}

/* Hover effect */
.related-card:hover {
    box-shadow: 0 2px 6px rgba(0,0,0,0.12);
    transform: translateY(-2px);
    border-color: #d0d0d0;
}

.related-card a {
    flex: 1;
    text-decoration: none;
    color: #333;
    font-weight: 500;
}

.related-card a:hover {
    text-decoration: underline;
}

.related-card .remove-btn {
    position: absolute;
    top: 4px;
    right: 6px;
    border: none;
    background: transparent;
    color: #c00;
    font-size: 0.9rem;
    cursor: pointer;
    padding: 0;
}

.related-card .remove-btn:hover {
    color: #900;
}

/* Group wrapper */
.related-group {
    margin-bottom: 1rem;
}

/* Header */
.related-group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    padding: 6px 4px;
    margin-bottom: 4px;
    border-bottom: 1px solid #e0e0e0;
}

.related-group-header span {
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    color: #666;
}

/* Toggle button */
.toggle-btn {
    border: none;
    background: transparent;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    padding: 0 4px;
    color: #444;
}

/* Collapsible content */
.related-group-content {
    overflow: hidden;
    transition: max-height 0.25s ease;
    max-height: 2000px; /* large enough for open state */
}

.related-group-content:not(.open) {
    max-height: 0;
    padding: 0 !important;
}

/* Compact card styling */
.related-card {
    position: relative;
    padding: 8px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: #ffffff;
    font-size: 0.9rem;
    line-height: 1.2;
    min-height: 48px;
    display: flex;
    align-items: center;
    transition: all 0.15s ease-in-out;
}

.related-card:hover {
    box-shadow: 0 2px 6px rgba(0,0,0,0.12);
    transform: translateY(-2px);
    border-color: #d0d0d0;
}

.related-card a {
    flex: 1;
    text-decoration: none;
    color: #333;
    font-weight: 500;
}

.related-card a:hover {
    text-decoration: underline;
}

.remove-btn {
    position: absolute;
    top: 4px;
    right: 6px;
    border: none;
    background: transparent;
    color: #c00;
    font-size: 0.9rem;
    cursor: pointer;
    padding: 0;
}

.remove-btn:hover {
    color: #900;
}

#source-list .border {
    background: #fafafa;
}

.floating-navbar {
    margin-bottom: 2rem !important;
}

/* Consistent spacing for all edit pages */
.edit-card {
    margin-top: 1rem !important;
}

.floating-navbar {
    display: flex;
    align-items: center;      /* FIXES the vertical alignment */
    justify-content: space-between;
}

.floating-navbar > div:last-child {
    display: flex;
    align-items: center;
    gap: 10px;
}

.floating-navbar button {
    height: 38px;
    display: flex;
    align-items: center;
}

/* ---------------------------------------------
   COLUMN FILTER HEADER + ARROW
   --------------------------------------------- */
.filter-header {
    position: relative;
    padding-right: 18px;      /* space for arrow */
    white-space: nowrap;
    cursor: pointer;
}

.filter-header .filter-arrow {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 11px;
    opacity: 0.55;
    cursor: pointer;
    user-select: none;
    transition: opacity 0.15s ease;
}

.filter-header .filter-arrow:hover {
    opacity: 1;
}

/* Optional: highlight header on hover */
.filter-header:hover {
    background-color: #f5f5f5;
}

#select-all {
    vertical-align: middle;
}

#catalogs-table th:first-child,
#catalogs-table td:first-child {
    width: 40px !important;
    text-align: center;
    vertical-align: middle;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

/* Prevent Bootstrap from hiding custom tab content */
.tab-content {
    display: block !important;
}

.tab-content:not(.active) {
    display: none !important;
}

.recipe-tab {
    display: none;
}

.recipe-tab.active {
    display: block;
}

.allergen-icon-img {
    width: 60px;
    height: 60px;
    object-fit: contain;
    display: block;
    margin: 0 auto 6px auto;
}

.allergen-tab-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); /* narrower min width */
    gap: 16px;
    padding: 10px 0;
}

.allergen-tab-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    background: #fff;
    text-align: center;
}

.allergen-tab-icon {
    width: 60px;
    height: 60px;
    object-fit: contain;
    margin-bottom: 8px;
}

.allergen-tab-icon.placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1f3f5;
    color: #6c757d;
    border-radius: 6px;
}

.allergen-tab-name {
    font-size: 0.95rem;
    font-weight: 500;
}

.supplier-allergen-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 20px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    background: #fafafa;
    min-height: 120px;
    width: 100%; /* allows full width in grid */
}

.supplier-allergen-icon {
    flex-shrink: 0;
    width: 120px;
    height: 100%;
    background: transparent; /* removes grey frame */
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.supplier-allergen-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.supplier-allergen-name {
    font-size: 1.1rem;
    font-weight: 500;
    color: #212529;
    white-space: nowrap;      /* prevents wrapping */
    overflow: hidden;
    text-overflow: ellipsis;  /* optional: adds “…” if too long */
}

.scrollable-definition {
    max-height: 140px;
    overflow-y: auto;
    padding-right: 4px;
}

/* Optional: nicer scrollbar */
.scrollable-definition::-webkit-scrollbar {
    width: 6px;
}

.scrollable-definition::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.scrollable-definition::-webkit-scrollbar-track {
    background: #f1f5f9;
}

/* Recipe of the Day description scroll area */
.recipe-description {
    max-height: 120px;      /* adjust to taste */
    overflow-y: auto;
    padding-right: 6px;     /* space for scrollbar */
    white-space: pre-line;  /* preserves formatting */
    margin-bottom: 14px;  /* more space before button */
}

.scrollable-description {
    max-height: 120px;
    overflow-y: auto;
    padding-right: 6px;
    white-space: pre-line;
}

/* Match spotlight scrollbar */
.scrollable-description::-webkit-scrollbar {
    width: 6px;
}
.scrollable-description::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

/* ------------------------------------------------------------
   HOME PAGE ONLY — SCOPED TO .homepage
   ------------------------------------------------------------ */

.homepage .two-column-row {
    display: flex;
    gap: 20px;
}

.homepage .two-column-row .half-card {
    flex: 1;
    display: flex;
}

.homepage .two-column-row .home-card {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    text-align: center;
}

/* Title */
.homepage .two-column-row .home-card h3 {
    margin-top: 0 !important;
    margin-bottom: 6px !important;
}

/* Image of the Day card */
.homepage .image-of-day-card {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
}

/* Image fits card width but stays square */
.homepage .image-of-day-img {
    width: 100%;
    max-width: 350px;
    height: 350px;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
    margin-bottom: 12px;
}

/* Title under image */
.homepage .image-of-day-title {
    font-weight: bold;
    margin-bottom: 14px;
}

/* Placeholder matches image size */
.homepage .image-of-day-placeholder {
    width: 100%;
    max-width: 350px;
    aspect-ratio: 1 / 1;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    margin-bottom: 14px;
}

/* Recipe button */
.homepage .recipe-view-btn {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 14px;
    text-decoration: none;
    border: 1px solid #aac8ff;
    background: #d7eaff;
    color: #003366;
}

.homepage .recipe-view-btn:hover {
    background: #cfe2ff;
}

/* Stack recipe + beverage vertically */
.homepage .left-stack {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Recipe card: half height */
.homepage .recipe-card {
    min-height: unset;   /* adjust as needed */
}

/* Beverage card: same height as recipe */
.homepage .beverage-card {
    min-height: 300px;   /* matches recipe card */
}

/* Image of the Day card: double height */
.homepage .image-of-day-card {
    min-height: 620px;   /* double the height of recipe/beverage */
}


.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 18px;
}

.gallery-card {
    background: white;
    border-radius: 10px;
    padding: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.gallery-img {
    width: 100%;
    height: 350px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 10px;
}

/* Floating info card under navbar */
.gallery-info-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px 16px;
    font-size: 0.95rem;
    font-weight: 600;
    color: #333;
    width: fit-content;
    margin: 70px auto 20px auto; /* space under navbar */
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

/* Expanded floating card */
.gallery-info-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 14px 20px;
    font-size: 0.95rem;
    font-weight: 600;
    color: #333;
    width: fit-content;
    margin: 70px auto 20px auto;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);

    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
}

/* Count */
.gallery-count {
    font-size: 1rem;
    font-weight: 600;
}

/* Filters container */
.gallery-filters {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
}

/* Alphabet filter */
.alphabet-filter {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: center;
}

.alpha {
    cursor: pointer;
    padding: 3px 6px;
    border-radius: 4px;
    font-weight: 500;
    color: #555;
}

.alpha:hover {
    background: #edf2f7;
}

.alpha.active {
    background: #cbd5e1;
    color: #000;
}

/* Search box */
#gallery-search {
    padding: 6px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    width: 200px;
}

.gallery-counts {
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    gap: 8px;
    align-items: center;
}

.gallery-counts .divider {
    color: #999;
}

.left-stack, .right-stack {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.profile-card, .modules-card {
    width: 100%;
    background: #ffffff;
    border-radius: 12px;
    padding: 20px 28px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.two-column-row {
    display: flex;
    gap: 20px;
    margin-bottom: 25px;
}

.half-card {
    flex: 1;
}

/* Make the footer bar taller */
.footer-bar {
    height: 70px;              /* increase from ~42px */
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Icon container row */
.footer-icons {
    display: flex;
    align-items: center;
    gap: 28px;                 /* more spacing for larger icons */
}

/* Each icon button */
.footer-icon {
    width: 56px;               /* bigger hit area */
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 10px;
    transition: background 0.2s ease, transform 0.15s ease;
}

/* Icon images */
.footer-icon img {
    width: 40px;               /* bigger icons */
    height: 40px;
    pointer-events: none;
}

/* Hover effect */
.footer-icon:hover {
    background: rgba(255, 255, 255, 0.18);
    transform: translateY(-3px);
}

.recipe-card {
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;                 /* consistent spacing between elements */
    align-self: flex-start;   /* prevents stretching */
}

.recipe-card h3 {
    margin: 0;
    padding: 0;
    line-height: 1.2;
}

.recipe-title {
    margin: 0;
    padding: 0;
    font-weight: 600;
    line-height: 1.2;
}

.recipe-description {
    margin: 0;
    padding: 0;
    line-height: 1.3;
    max-height: 120px;        /* optional: prevents huge descriptions */
    overflow-y: auto;         /* scroll only if needed */
}

.profile-bio {
    max-height: 120px;
    overflow-y: auto;
    padding-right: 6px;
    white-space: pre-line;
    margin-bottom: 12px;
    font-size: 0.9rem;
    color: #444;
}

.footer-role {
    font-weight: 600;
    opacity: 0.7;
    margin-left: 10px;
    font-size: 0.9rem;
}

/* ---------------------------------------------------------
   CARD CONTAINER
--------------------------------------------------------- */
.identity-container,
.register-card {
    background: #ffffff;
    border-radius: 14px;
    padding: 32px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 8px 28px rgba(0,0,0,0.15);
    text-align: center;
    animation: fadeIn 0.25s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ---------------------------------------------------------
   LOGO — full modal width
--------------------------------------------------------- */
.identity-logo {
    width: 100%;
    text-align: center;     /* keeps it visually centered */
}

.identity-logo img,
.register-logo {
    width: 100%;            /* fills the modal width */
    height: auto;           /* keeps proportions */
    display: block;         /* removes inline spacing */
    margin: 0 auto 20px;    /* centers + spacing below */
    max-width: 100%;        /* prevents shrinking */
}

/* ---------------------------------------------------------
   TITLE
--------------------------------------------------------- */
.identity-title {
    font-size: 1.6rem;
    font-weight: 600;
    margin-bottom: 24px;
    color: #333;
}

/* ---------------------------------------------------------
   PROFILE PHOTO AREA
--------------------------------------------------------- */
.profile-photo-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 24px;
}

.profile-photo,
.profile-photo-placeholder {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    object-fit: cover;
    background: #e5e5e5;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 12px;
    user-select: none;
}

/* Placeholder initials */
.profile-photo-placeholder {
    background: #6c7ae0; /* You can randomize this in JS */
}

/* Upload/Delete buttons */
.photo-buttons {
    display: flex;
    gap: 10px;
}

/* ---------------------------------------------------------
   FORM FIELDS
--------------------------------------------------------- */
.form-group {
    text-align: left;
    margin-bottom: 18px;
}

.form-group label {
    font-weight: 500;
    margin-bottom: 6px;
    display: block;
    color: #444;
}

.form-control {
    width: 100%;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid #ccc;
    font-size: 1rem;
}

.form-control:focus {
    border-color: #6c7ae0;
    outline: none;
    box-shadow: 0 0 0 2px rgba(108,122,224,0.25);
}

/* ---------------------------------------------------------
   SUBMIT BUTTON
--------------------------------------------------------- */
.identity-submit {
    width: 100%;
    padding: 12px;
    font-size: 1.1rem;
    border-radius: 8px;
    margin-top: 10px;
}

/* ---------------------------------------------------------
   FULL PAGE VERSION
--------------------------------------------------------- */
.profile-page {
    max-width: 520px;
    margin: 40px auto;
    padding: 20px;
}

.profile-logo {
    width: 90px;
    display: block;
    margin: 0 auto 20px;
}

/* ---------------------------------------------------------
   RESPONSIVE
--------------------------------------------------------- */
@media (max-width: 480px) {
    .identity-container,
    .register-card {
        padding: 24px;
    }

    .profile-photo,
    .profile-photo-placeholder {
        width: 90px;
        height: 90px;
        font-size: 28px;
    }
}

.navbar-user {
    position: relative;
    margin-left: 16px;
}

.avatar-wrapper {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    overflow: hidden;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-placeholder {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: #6c7ae0;
    color: #fff;
    font-weight: 600;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.avatar-dropdown {
    position: absolute;
    top: 48px;
    right: 0;

    /* ⭐ Make it bigger */
    width: 260px;              /* was 180px */
    padding: 14px 0;           /* was 10px 0 */

    background: #fff;
    border-radius: 12px;       /* slightly smoother */
    box-shadow: 0 8px 24px rgba(0,0,0,0.18); /* stronger presence */

    display: none;
    z-index: 999;
}

.avatar-dropdown.show {
    display: block;
}

/* Make header bigger */
.dropdown-header {
    padding: 14px 20px;        /* was 10px 16px */
    border-bottom: 1px solid #eee;
}

.dropdown-role {
    font-size: 0.85rem;
    color: #777;
}

.dropdown-item {
    display: block;
    padding: 12px 20px;        /* was 10px 16px */
    color: #333;
    text-decoration: none;
}

.dropdown-item:hover {
    background: #f5f5f5;
}

.dropdown-item.logout {
    color: #c0392b;
}
.register-card {
    background: #ffffff;
    border-radius: 14px;
    padding: 32px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 8px 28px rgba(0,0,0,0.15);
    position: relative;
    animation: fadeIn 0.25s ease-out;
}

.register-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: transparent;
    border: none;
    font-size: 20px;
    cursor: pointer;
    opacity: 0.6;
}

.register-close:hover {
    opacity: 1;
}

.navbar-user {
    position: relative;
}

.navbar-user {
    position: relative;
    z-index: 10000; /* ensures avatar sits above all other layers */
}

.navbar-inner {
    position: relative;        /* create a proper stacking context */
    z-index: 1;
}

.hamburger-wrapper {
    position: relative;        /* prevents its dropdown from floating over the avatar */
    z-index: 2;
}

.navbar-user {
    position: relative;
    z-index: 10000;            /* forces avatar + dropdown above everything */
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.navbar-user {
    display: flex;
    align-items: center;
}

/* ---------------------------------------------------------
   REGISTER OVERLAY (FULLSCREEN MODAL BACKDROP)
--------------------------------------------------------- */
#register-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.45);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999; /* must sit above dashboard + navbar */
}

#register-overlay.hidden {
    display: none !important;
}

.profile-card {
    background: #ffffff;
    border-radius: 14px;
    padding: 32px;
    max-width: 520px;
    margin: 40px auto;
    box-shadow: 0 8px 28px rgba(0,0,0,0.15);
}

#profile-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255,255,255,0.55);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    padding: 40px 20px;
}

.profile-expanded {
    max-width: 640px;
    width: 100%;
    padding: 40px;
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 8px 28px rgba(0,0,0,0.15);
}

.form-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 2px solid #e5e7eb;
}

.form-header-icon {
    width: 22px;
    height: 22px;
    opacity: 0.8;
}

.form-header-title {
    font-size: 1.4rem;
    font-weight: 600;
    color: #333;
}

.profile-photo,
.profile-photo-placeholder {
    width: 120px;
    height: 120px;
    font-size: 36px;
}

/* Force profile modal card to override identity-container defaults */
#profile-overlay .identity-container.profile-expanded {
    background: #ffffff !important;
    border-radius: 14px !important;
    box-shadow: 0 8px 28px rgba(0,0,0,0.15) !important;
    padding: 40px !important;
    max-width: 640px !important;
}

.profile-close-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    background: transparent;
    border: none;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    opacity: 0.6;
    z-index: 100000;
}

.profile-close-btn:hover {
    opacity: 1;
}

.profile-expanded {
    position: relative;
}

#profile-photo-preview {
    display: block !important;
}

.avatar-img {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
}

#profile-photo-preview:not([src]),
#profile-photo-preview[src=""],
#profile-photo-preview[src="/user/avatar/"],
.profile-photo-placeholder {
    display: none;
}

#profile-photo-preview[src^="/user/avatar/"] {
    display: block;
}

#subscribe-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
}

#subscribe-overlay.hidden {
    display: none !important;
}

.subscribe-card {
    background: #ffffff;
    border-radius: 14px;
    padding: 32px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 8px 28px rgba(0,0,0,0.15);
    position: relative;
}

.subscribe-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: transparent;
    border: none;
    font-size: 24px;
    cursor: pointer;
    opacity: 0.6;
}

.subscribe-close:hover {
    opacity: 1;
}

.subscribe-title {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 16px;
}

.subscribe-text {
    font-size: 1rem;
    color: #555;
    margin-bottom: 24px;
}

.subscribe-button {
    width: 100%;
    padding: 12px;
    background: #6c7ae0;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
}

.subscribe-button:hover {
    background: #5a6ad0;
}

.seo-content.collapsed {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
}

.seo-content.expanded {
    max-height: 1000px; /* enough to show full text */
}
