/* kitchen.css */

/* Kitchen-specific compact styling for better space utilization */
.main-container-kitchen .recipe-card {
  padding: 12px;
  margin-bottom: 12px;
  box-shadow: 0 1px 4px var(--shadow);
}

.main-container-kitchen .order-header {
  margin-bottom: 8px;
}

.main-container-kitchen .order-header h3 {
  margin: 0;
  font-size: 1.1em;
  font-weight: 600;
}

.main-container-kitchen .order-meta {
  font-size: 0.85em;
  gap: 10px;
}

.main-container-kitchen .order-meta span {
  color: var(--text-secondary, #666);
}

.main-container-kitchen .order-total {
  font-weight: 600;
  color: var(--text-color) !important;
}

/* More compact order items grid */
.main-container-kitchen .order-items-grid {
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 6px;
  margin-top: 10px;
}

/* Smaller, more compact menu items */
.main-container-kitchen .order-items-grid .menu-item {
  padding: 8px;
  min-height: 50px;
  font-size: 0.9em;
  border-radius: 6px;
}

.main-container-kitchen .order-items-grid .menu-item .item-name {
  font-weight: 500;
  line-height: 1.2;
}

/* Reduce container padding and spacing */
.main-container-kitchen {
  max-width: 1400px;
  margin: 0 auto;
  padding: 15px;
}

.order-column-full {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 15px;
  width: 100%;
  height: calc(100vh - 70px);
  display: flex;
  flex-direction: column;
}

.order-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.order-meta {
  display: flex;
  gap: 10px;
  align-items: center;
}

.order-items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 6px;
  margin-top: 10px;
}

.menu-header {
  margin-bottom: 15px;
}

.menu-header h2 {
  margin: 0;
  font-size: 1.3em;
}

.previous-header {
  flex-shrink: 0;
  margin: 10px 0 5px;
  font-size: 0.95em;
  padding-top: 8px;
  border-top: 1px solid var(--card-border);
}

/* Layout optimization: prioritize active orders over finished orders */
#active-orders {
  flex: 3;
  min-height: 0;
  overflow-y: auto;
  margin-bottom: 15px;
}

#previous-orders {
  flex: 0 0 200px;
  max-height: 200px;
  min-height: 120px;
  overflow-y: auto;
  background: rgba(0, 0, 0, 0.02);
  border-radius: 6px;
  padding: 8px;
  margin-top: 5px;
}

/* Make scroll areas more efficient */
.main-container-kitchen .menu-scroll {
  padding-right: 5px;
  /* Override common.css flex behavior for kitchen-specific layout */
  flex: none;
  margin-bottom: 0;
  max-height: none;
}

/* Custom scrollbar styling to match theme */
/* Webkit browsers (Chrome, Safari, Edge) */
.menu-scroll::-webkit-scrollbar,
#active-orders::-webkit-scrollbar,
#previous-orders::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.menu-scroll::-webkit-scrollbar-track,
#active-orders::-webkit-scrollbar-track,
#previous-orders::-webkit-scrollbar-track {
  background: var(--bg-color);
  border-radius: 4px;
}

.menu-scroll::-webkit-scrollbar-thumb,
#active-orders::-webkit-scrollbar-thumb,
#previous-orders::-webkit-scrollbar-thumb {
  background: var(--card-border);
  border-radius: 4px;
  border: 1px solid var(--bg-color);
}

.menu-scroll::-webkit-scrollbar-thumb:hover,
#active-orders::-webkit-scrollbar-thumb:hover,
#previous-orders::-webkit-scrollbar-thumb:hover {
  background: var(--text-color);
  opacity: 0.7;
}

/* Firefox scrollbar styling */
.menu-scroll,
#active-orders,
#previous-orders {
  scrollbar-width: thin;
  scrollbar-color: var(--card-border) var(--bg-color);
}

/* Dark theme adjustments for finished orders background */
.dark-theme #previous-orders {
  background: rgba(255, 255, 255, 0.05);
}

/* Dark theme scrollbar adjustments */
.dark-theme .menu-scroll::-webkit-scrollbar-thumb,
.dark-theme #active-orders::-webkit-scrollbar-thumb,
.dark-theme #previous-orders::-webkit-scrollbar-thumb {
  background: #57606f;
  border: 1px solid var(--bg-color);
}

.dark-theme .menu-scroll::-webkit-scrollbar-thumb:hover,
.dark-theme #active-orders::-webkit-scrollbar-thumb:hover,
.dark-theme #previous-orders::-webkit-scrollbar-thumb:hover {
  background: #6c7686;
}

.dark-theme .menu-scroll,
.dark-theme #active-orders,
.dark-theme #previous-orders {
  scrollbar-color: #57606f var(--bg-color);
}

/* Further optimize completed orders */
#previous-orders .recipe-card {
  padding: 10px;
  margin-bottom: 8px;
}

#previous-orders .order-items-grid {
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 4px;
}

#previous-orders .order-items-grid .menu-item {
  padding: 6px;
  min-height: 40px;
  font-size: 0.85em;
}

/* Responsive adjustments for smaller screens */
@media (max-width: 768px) {
  .main-container-kitchen {
    padding: 10px;
  }
  
  .order-column-full {
    padding: 10px;
  }
  
  .main-container-kitchen .order-items-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  }
  
  #previous-orders {
    flex: 0 0 150px;
    max-height: 150px;
  }
  
  #previous-orders .order-items-grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  }
}

/* Optimize for larger screens - more columns */
@media (min-width: 1200px) {
  .main-container-kitchen .order-items-grid {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  }
}

/* --------- DONE state styling --------- */
/* fully opaque, with just the green SVG checkmark overlayed */
.order-items-grid .menu-item.done {
  opacity: 1 !important;
  position: relative;
  background: #00b89433;
}
/* hide the inner text and the black “✓” */
.order-items-grid .menu-item.done .item-name,
.order-items-grid .menu-item.done .status-indicator {
  display: none !important;
}
/* overlay the green checkmark SVG on top */
.order-items-grid .menu-item.done::after {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: url('data:image/svg+xml;utf8,<svg viewBox="0 0 24 24" fill="%2300b894" xmlns="http://www.w3.org/2000/svg"><path d="M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"/></svg>');
  background-repeat: no-repeat;
  background-position: center;
  z-index: 2;
}

/* Allow header + theme button on one line */
.menu-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Style the theme-toggle button */
.btn-theme {
  background: var(--card-bg);
  color: var(--text-color);
  border: 1px solid var(--card-border);
  border-radius: 4px;
  padding: 6px 12px;
  font-size: 14px;
  cursor: pointer;
}

/* Override the global button styling for the kitchen theme-toggle */
.menu-header .btn-theme {
  /* stop it growing to fill the flex row */
  flex: none !important;
  min-width: auto !important;

  /* push to the right */
  margin-left: auto;
  /* keep the inherited line-height/height */
}

/* completed orders section */
#previous-orders .recipe-card {
  opacity: 0.6;
  pointer-events: none;
  filter: grayscale(50%);
  margin-bottom: 10px;
}
#previous-orders .recipe-card .order-items-grid {
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}

/* Completed orders: show names, hide overlay */
#previous-orders .order-items-grid .menu-item.done .item-name {
  display: block !important;
}
#previous-orders .order-items-grid .menu-item.done {
  /* optional: keep the greyed-out look, or change as desired */
  background: var(--card-bg) !important;
  filter: none !important;
}
#previous-orders .order-items-grid .menu-item.done::after {
  display: none !important;
}

/* Also ensure no hidden children */
#previous-orders .order-items-grid .menu-item.done .status-indicator {
  display: none !important;
}

/* --- Hide blinking text cursor (caret) on everything except inputs --- */
*:not(input):not(textarea) {
  caret-color: transparent !important;
}


button,
.menu-item,
.order-item,
.order-item * {
  -webkit-user-select: none !important;
     -moz-user-select: none !important;
      -ms-user-select: none !important;
          user-select: none !important;
  -webkit-tap-highlight-color: transparent !important;
}
.stats-tab,
.color-preview,
.modal-content *:not(input):not(textarea) {
  outline: none !important;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.stats-tab,
.denomination-btn,
.btn-save,
.btn-edit,
.btn-reset,
.btn-stats,
.btn-add-detail,
.btn-delete,
.btn-delete-small {
  -webkit-tap-highlight-color: transparent; /* no blue flash on tap */
  outline: none;                            /* remove focus outline */
  user-select: none;                        /* prevent selecting the label text */
}

/* But keep outlines on form fields: */
input[type="text"],
input[type="number"],
input[type="color"],
input,
textarea {
  user-select: text !important;
  caret-color: auto !important;
}

/* Disable text selection & tap highlight on POS static labels */

/* Menu header (“Položky menu”) */
.menu-header,
.menu-header * {
  -webkit-user-select: none !important;
     -moz-user-select: none !important;
      -ms-user-select: none !important;
          user-select: none !important;
  -webkit-tap-highlight-color: transparent !important;
}

/* Order summary (“Zhrnutie objednávky”, totals, given, change, order items) */
#right-content,
#right-content * {
  -webkit-user-select: none !important;
     -moz-user-select: none !important;
      -ms-user-select: none !important;
          user-select: none !important;
  -webkit-tap-highlight-color: transparent !important;
}