/* ==================================================
   GENERAL
   ================================================== */

body {
  font-family: Arial, sans-serif;
  background: #f5f5f5;
  padding-bottom: 120px;
  margin: 0;
}

.container {
  width: 90%;
  max-width: 600px;
  margin: 30px auto;
}


/* ==================================================
   FORM
   ================================================== */

label {
  display: block;
  margin-top: 15px;
  font-weight: bold;
}

.explain {
  font-size: 12px;
  font-style: italic;
  color: #666;
}

input,
select {
  width: 100%;
  padding: 10px;
  margin-top: 5px;
  border-radius: 6px;
  border: 1px solid #ccc;
  font-size: 15px;
  box-sizing: border-box;
}

.mandatory {
  border-color: #cc5500;
  background: #fff7f0;
}

.error {
  color: #cc0000;
  font-size: 12px;
  margin-top: 3px;
  display: none;
}

.error-border {
  border-color: #cc0000 !important;
  background: #ffecec !important;
}

.hidden {
  display: none;
}


/* ==================================================
   DESKTOP BOTTOM BAR
   ================================================== */

.bottom-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: #222;
  padding: 15px;
  display: flex;
  justify-content: space-around;
  box-shadow: 0 -2px 6px rgba(0, 0, 0, 0.3);
  box-sizing: border-box;
  z-index: 9998;
}

.bottom-bar button {
  padding: 10px 20px;
  font-size: 16px;
  background: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

.bottom-bar button:hover {
  opacity: 0.9;
}


/* ==================================================
   TOOLTIP
   ================================================== */

.tooltip {
  position: relative;
  display: inline-block;
}

.tooltiptext {
  visibility: hidden;
  width: 220px;
  background-color: #333;
  color: #fff;
  text-align: left;
  padding: 8px;
  border-radius: 6px;
  position: absolute;
  z-index: 1;
  top: 22px;
  left: 0;
  font-size: 12px;
}

.tooltip:hover .tooltiptext {
  visibility: visible;
}


/* ==================================================
   GENERAL POPUP
   ================================================== */

.popup {
  display: none;
  position: fixed;
  z-index: 999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow-y: auto;
  padding: 24px 16px;
  box-sizing: border-box;
  background: rgba(0, 0, 0, 0.6);
}

.popup-content {
  background: #fff;
  margin: 0 auto;
  padding: 20px 24px;
  width: 100%;
  max-width: 900px;
  max-height: calc(100vh - 48px);
  overflow: hidden;
  border-radius: 10px;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
}


/* ==================================================
   POPUP PRODUCT
   ================================================== */

.popup-product {
  margin-bottom: 28px;
}

.popup-product-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 80px;
  width: 100%;
}

.popup-product-name {
  flex: 1;
  min-width: 0;
}

.popup-product-price {
  flex: 0 0 auto;
  min-width: 70px;
  text-align: right;
  white-space: nowrap;
}

.popup-group {
  margin-bottom: 30px;
}

.popup-group h2 {
  margin-bottom: 24px;
}

.popup-category {
  margin-bottom: 12px;
}

.popup-category h3 {
  display: inline;
  margin: 0;
}

.popup-explanation {
  margin-left: 8px;
}


/* ==================================================
   POPUP CLOSE
   ================================================== */

.close {
  display: block;
  text-align: right;
  font-size: 24px;
  cursor: pointer;
}

#popupPreview {
  max-height: calc(100vh - 140px);
  overflow-y: auto;
  padding-right: 8px;
}


/* ==================================================
   MOBILE NAVIGATION
   ================================================== */

.mobile-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: rgba(30, 30, 47, 0.95);
  padding: 10px;
  display: flex;
  justify-content: center;
  z-index: 9999;
  box-sizing: border-box;
}


/* ==================================================
   HAMBURGER
   ================================================== */

.hamburger {
  width: 40px;
  height: 32px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
}

.hamburger span {
  height: 5px;
  background: #ffd700;
  border-radius: 4px;
  transition: 0.3s ease;
}


/* HAMBURGER → X */

.hamburger.active span:nth-child(1) {
  transform: translateY(12px) rotate(45deg);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
}

.hamburger.active span:nth-child(3) {
  transform: translateY(-12px) rotate(-45deg);
}


/* ==================================================
   MOBILE MENU PANEL
   ================================================== */

.mobile-menu {
  position: fixed;
  bottom: 60px;
  left: 0;
  width: 100%;
  background: rgba(44, 44, 62, 0.98);
  padding: 20px;
  display: none;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.4);
  box-sizing: border-box;
}

.mobile-menu.show {
  display: flex;
}


/* ==================================================
   MOBILE MENU BUTTONS
   ================================================== */

/*
   Common properties.
   This guarantees that Upute has exactly
   the same size as the other buttons.
*/

.mobile-menu button {
  width: 100%;
  min-height: 50px;
  padding: 14px;
  border-radius: 8px;
  border: none;
  font-size: 1.2em;
  font-family: inherit;
  cursor: pointer;
  box-sizing: border-box;
}


/* ENTER */

.btn-enter {
  background: #2ecc71;
  color: #fff;
}


/* GENERATE */

.btn-generate {
  background: #e74c3c;
  color: #fff;
}


/* VIEW */

.btn-view {
  background: #3498db;
  color: #fff;
}


/* UPUTE */

.btn-upute {
  background: #9b59b6;
  color: #fff;
}


/* UNDO */

.btn-undo {
  background: #f1c40f;
  color: #000;
}


/* Button hover */

.mobile-menu button:hover {
  opacity: 0.9;
}


/* Button active */

.mobile-menu button:active {
  transform: translateY(1px);
}


/* ==================================================
   UPUTE MODAL
   ================================================== */

.upute-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;

  display: none;

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

  padding: 20px;
  box-sizing: border-box;
}

.upute-modal.active {
  display: flex;
}


/* Dark background behind popup */

.upute-overlay {
  position: absolute;
  inset: 0;

  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(5px);
}


/* ==================================================
   UPUTE WINDOW
   ================================================== */

.upute-window {
  position: relative;
  z-index: 1;

  width: min(700px, 100%);
  max-height: 85vh;

  overflow: hidden;

  /* SOLID WHITE BACKGROUND */
  background: #ffffff;

  color: #333333;

  border: 1px solid #dddddd;
  border-radius: 16px;

  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);

  display: flex;
  flex-direction: column;
}


/* ==================================================
   UPUTE HEADER
   ================================================== */

.upute-header {
  display: flex;
  align-items: center;
  justify-content: space-between;

  padding: 18px 22px;

  background: #ffffff;

  border-bottom: 1px solid #dddddd;
}

.upute-header h2 {
  margin: 0;

  color: #222222;

  font-size: 20px;
  line-height: 1.3;
}


/* ==================================================
   UPUTE CLOSE BUTTON
   ================================================== */

.upute-close {
  border: none;

  background: transparent;

  color: #777777;

  font-size: 30px;
  line-height: 1;

  cursor: pointer;

  padding: 2px 6px;
}

.upute-close:hover {
  color: #111111;
}


/* ==================================================
   UPUTE CONTENT
   ================================================== */

.upute-content {
  overflow-y: auto;

  padding: 22px;

  background: #ffffff;

  color: #333333;

  line-height: 1.6;
}

.upute-content h3 {
  margin: 0 0 10px;

  color: #222222;

  font-size: 17px;
  line-height: 1.4;
}

.upute-content p {
  margin: 0 0 16px;
}

.upute-content ol {
  margin: 0 0 18px;

  padding-left: 24px;
}

.upute-content li {
  margin-bottom: 9px;
}


/* ==================================================
   UPUTE TIP BOX
   ================================================== */

.upute-tip {
  margin-top: 22px;

  padding: 16px 18px;

  background: #f5f5f5;

  border: 1px solid #dddddd;

  border-radius: 12px;
}

.upute-tip strong:first-child {
  display: block;

  margin-bottom: 8px;

  color: #222222;
}

.upute-tip p:last-child {
  margin-bottom: 0;
}


/* ==================================================
   MOBILE UPUTE MODAL
   ================================================== */

@media (max-width: 600px) {

  .upute-modal {
    padding: 10px;
  }

  .upute-window {
    width: 100%;
    max-height: 90vh;

    border-radius: 12px;
  }

  .upute-header {
    padding: 15px 17px;
  }

  .upute-header h2 {
    font-size: 18px;
  }

  .upute-content {
    padding: 18px;

    font-size: 14px;
  }
}


/* ==================================================
   DESKTOP — HIDE MOBILE NAVIGATION
   ================================================== */

@media (min-width: 768px) {

  .mobile-nav {
    display: none;
  }

  .hamburger {
    display: none;
  }

  .mobile-menu {
    display: none !important;
  }
}


/* ==================================================
   HONEYPOT
   Invisible to normal users
   ================================================== */

.honeypot {
  position: absolute !important;
  left: -9999px !important;

  width: 1px !important;
  height: 1px !important;

  opacity: 0 !important;

  pointer-events: none !important;
}
