* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    margin: 0;
    height: 100vh;

    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text",
               "SF Pro Display", "Helvetica Neue", Helvetica, Arial, sans-serif;
    background: url("background/1.png");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color: black;
    
    color: black;
    -webkit-font-smoothing: antialiased;
}

/* overlay */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: -1;
}

html, body {
    height: 100%;
}

/* footer */
.footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 16px 20px;

    font-size: 12px;
    font-weight: 300;
    color: white;

    opacity: 0.8;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);

    background: rgba(0, 0, 0, 0.2);
}

.footer-center {
    text-align: center;
}

.footer-right {
    position: absolute;
    right: 20px;
}

/* panel left */
.left-panel {
  position: fixed;
  top: 0;
  left: 0;

  width: 300px;
  height: 100vh;

  padding: 20px;

  display: flex;
  flex-direction: column;
  gap: 20px;

  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);

  border-right: 1px solid rgba(255,255,255,0.05);

  transition: width 0.3s ease, padding 0.3s ease;
}

/* collapse */
.left-panel.collapsed {
  width: 70px;
  padding: 20px 10px;
}

.left-panel.collapsed .label,
.left-panel.collapsed .label-text {
  display: none;
}

.left-panel.collapsed .menu-item {
  justify-content: center;
  gap: 0;
}

.left-panel.collapsed .expand-btn {
    justify-content: center;
}

.left-panel.collapsed .dropdown {
  display: none;
}

.left-panel.collapsed .arrow {
  display: none;
}

.left-panel.collapsed .icon {
  margin: 0 auto;
}

.expand-btn {
  display: none;
  cursor: pointer;
  color: #aaa;
  font-size: 14px;
}

.left-panel.left-panel.collapsed .top-bar {
    display: none;
}

.left-panel.collapsed .close-btn {
  display: none;
}


.left-panel {
    z-index: 25;
}

/* top bar */
.top-bar {
  display: flex;
  justify-content: flex-end;
}

.close-btn {
  cursor: pointer;
  font-size: 14px;
  color: #aaa;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 12px;

  font-size: 14px;
  font-weight: 300;
  color: #eaeaea;

  cursor: pointer;
}

.menu-item:hover {
  opacity: 0.7;
}

.icon {
  width: 18px;
  height: 18px;
}

.complete-order .label-text {
  flex: 1;
}

.dropdown {
  display: flex;
  flex-direction: column;
  gap: 10px;

  max-height: 0;
  overflow: hidden;

  transition: 0.3s ease;
}

.dropdown.open {
  max-height: 100px;
}

.dropdown input,
.dropdown button {
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  color: #fff;

  padding: 8px;
  border-radius: 6px;
  font-size: 12px;
}

.dropdown input {
  outline: none;
}

.dropdown button {
  cursor: pointer;
}

.dropdown button:hover {
  background: rgba(255, 255, 255, 0.1);
}

.icon {
  width: 18px;
  height: 18px;
  color: white;
}

.left-panel.collapsed .expand-btn {
  display: flex;
  justify-content: center;
}

.expand-btn {
  display: none;
  cursor: pointer;
  font-size: 14px;
  color: #aaa;
}

/* profile expand */
.profile-dropdown {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;

  max-height: 0;
  overflow: hidden;

  transition: 0.3s ease;
}

.profile-dropdown.open {
  max-height: 300px;
}

.profile-large-icon {
  width: 100%;
  height: 80px;

  padding: 10px;

  border-radius: 10px;

  background: rgba(255, 255, 255, 0.05);
  border: 1px solid #2a2a2a;

  color: white;
}

.profile-input, .profile-save {
  width: 100%;

  padding: 10px;
  border-radius: 8px;

  border: 1px solid #2a2a2a;
  background: #1a1a1a;
  color: white;

  font-size: 12px;
}

.profile-save {
  cursor: pointer;
  height: 40px;
}

.profile-save:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* arrow rotation */
.profile-arrow {
  margin-left: auto;
  transition: transform 0.3s ease;
}

.profile-input {
  outline: none;
}

.profile-name {
  font-size: 12px;
  color: white;
  opacity: 0.85;
  margin-right: 6px;
}

/* settings arrow */
.settings-arrow {
  margin-left: auto;
  transition: transform 0.3s ease;
}

.left-panel.collapsed .settings-arrow {
  display: none;
}

.settings-dropdown {
  display: flex;
  flex-direction: column;
  gap: 14px;

  max-height: 0;
  overflow: hidden;

  transition: 0.3s ease;
}

.settings-dropdown.open {
  max-height: 400px;
}

.settings-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.settings-row {
  display: flex;
  align-items: center;
  gap: 8px;

  color: #eaeaea;
  font-size: 13px;
}

.settings-input, .settings-save {
  width: 100%;

  padding: 10px;
  border-radius: 8px;

  border: 1px solid #2a2a2a;
  background: #1a1a1a;
  color: white;

  font-size: 12px;
}

.settings-input {
  outline: none;
}

.settings-save {
  cursor: pointer;
  height: 40px;
}

.settings-save:hover {
  background: rgba(255, 255, 255, 0.1);
}

.settings-divider {
  width: 100%;
  height: 1px;

  background: rgba(255, 255, 255, 0.08);
  margin-top: 6px;
}

.settings-clear {
  cursor: pointer;
}

.settings-clear:hover {
  opacity: 0.7;
}

/* Hide X when collapsed */
.left-panel.collapsed .close-btn, 
.left-panel.collapsed .profile-arrow, 
.left-panel.collapsed .profile-dropdown {
  display: none;
}

/* main viewport centered */
.main-center {
    display: flex;
    inset: 0;

    display: flex;
    justify-content: center;
    align-items: center;

    transform: translateY(100px); /* push down */
}

.left-stack {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
}

.main-image {
    width: 500px;
    max-width: 80vw;

    height: auto;

    object-fit: contain;
}

.ingredient-input {
    width: 100%;

    padding: 12px;
    border-radius: 10px;

    border: 1px solid #2a2a2a;
    background: rgba(0, 0, 0, 0.5);
    color: white;

    text-align: center;

    outline: none;
}

.generate-btn {
    width: 100%;

    padding: 12px;
    border-radius: 10px;

    border: 1px solid #2a2a2a;
    background: rgba(255, 255, 255, 0.05);
    color: white;

    cursor: pointer;
}

.generate-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* top banner */
.top-banner {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;

    display: flex;
    align-items: center;

    padding: 16px 20px;
    justify-content: center;
    align-items: center;

    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);

    background: rgba(0, 0, 0, 0.2);

    z-index: 20;
}

/* title */
.title {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);

  display: flex;
  align-items: center;
  gap: 8px;
}

.title svg {
  width: 17px;
  height: 17px;
  stroke: white;
  opacity: 0.9;
}

.title-text {
  font-size: 15px;
  font-weight: 700;
  color: white;
  letter-spacing: 3px;
  opacity: 0.9;
}

/* basket */
.basket-wrapper {
    width: auto;
    height: auto;
    color: white;

    cursor: pointer;
    opacity: 0.85;

    display: flex;
    align-items: center;
    gap: 6px;
}

.basket-wrapper svg {
  width: 15px;
  height: 15px;
}

.basket-wrapper:hover {
    opacity: 1;
}

.cart-count {
  font-size: 11px;
  background: rgba(255, 255, 255, 0.1);
  padding: 2px 6px;
  opacity: 10px;
}

.top-right {
  position: absolute;
  right: 20px;
}

/* panel */
.right-panel {
    position: fixed;
    top: 0;
    right: -400px; /* hidden */

    width: 400px;
    height: 100vh;

    padding: 20px;

    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);

    border-left: 1px solid rgba(255, 255, 255, 0.05);

    transition: right 0.3s ease;

    z-index: 15;
}

.right-panel.open {
    right: 0;
}

.right-content {
    height: 100%;

    display: flex;
    justify-content: center;
    align-items: center;

    text-align: center;
}

.orders-list {
  width: 100%;
}

.empty-message {
    color: #aaa;
    font-size: 12px;
    font-weight: 300;
    line-height: 1.6;
}

/* start of coding generate */
.order-item {
  display: flex;
  flex-direction: column;
  gap: 4px;

  padding: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.order-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.order-name {
  font-size: 12px;
  color: #fff;
}

.order-number {
  font-size: 12px;
  color: #aaa;
  text-align: left;
}

.order-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.order-icon {
  width: 16px;
  height: 16px;
  color: #aaa;
}

/* message on submit */
.bottom-message {
  position: fixed;
  bottom: 20px;
  left: 20px;

  width: 400px;
  max-width: 100vw;

  display: flex;
  align-items: center;
  justify-content: space-between;

  padding: 12px 16px;

  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);

  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;

  color: white;
  font-size: 14px;

  z-index: 50;

  animation: messagePop 0.25s ease, messagePop 0.6s ease;
}

.bottom-message.hidden {
  display: none;
}

.bottom-message .actions {
  display: flex;
  gap: 14px;
}

.bottom-message span {
  flex: 1;
}

.bottom-message svg {
  width: 18px;
  height: 18px;
  cursor: pointer;
  opacity: 0.85;
}

.bottom-message svg:hover {
  opacity: 1;
}

/* animation to notification */
@keyframes messagePop {
  0% {
    transform: translateY(10px);
    opacity: 0;
  }
  100% {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes messagePulse {
  0% {
    box-shadow: 0 0 0 rgba(255,255,255,0);
  }
  50% {
    box-shadow: 0 0 12px rgba(255,255,255,0.15);
  }
  100% {
    box-shadow: 0 0 0 rgba(255,255,255,0);
  }
}

/* responsive design*/
@media (max-width: 768px) {

  /* main image */
  .main-image {
    width: 300px;
    max-width: 90vw;
  }

  /* input + button */
  .ingredient-input,
  .generate-btn {
    font-size: 14px;
    padding: 10px;
  }

  /* left panel smaller */
  .left-panel {
    width: 240px;
  }

  .left-panel.collapsed {
    width: 60px;
  }

  /* right panel smaller */
  .right-panel {
    width: 300px;
  }

  /* bottom message fits screen */
  .bottom-message {
    width: calc(100% - 40px);
    left: 20px;
    right: 20px;
  }

  /* title smaller */
  .title-text {
    font-size: 13px;
    letter-spacing: 1.5px;
  }

  .title svg {
    width: 18px;
    height: 18px;
  }
}

/* UI POLISH */
/* briefly highlight newly added order */
@keyframes highlightNew {
  0% {
    background: rgba(255,255,255,0.15);
  }
  100% {
    background: transparent;
  }
}

.new-order {
  animation: highlightNew 4s ease;
}

/* disable viewport if user doesn't acknowledge message popup*/
.overlay {
  position: fixed;
  inset: 0;

  background: transparent; 
  z-index: 40; 
}

.overlay.hidden {
  display: none;
}

.settings-about {
  opacity: 0.2;
  font-size: 8px;
}

/* disable clear cart if no items */
.settings-clear.disabled {
  opacity: 0.3;
  pointer-events: none;
  cursor: default;
}
