body.index-home body {
  font-family: Arial, sans-serif;
  background: #f4f4f4;
  margin: 0;
  padding: 0;
}
body.index-home .container {
    width: 100dvw;
    height: 100dvh;
    max-width: none;
    margin: 0;
    padding: 0;
    border-radius: 0;
    background-image: url('templates/background/Layer 1.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    background-color: black; /* fills remaining space if aspect ratio doesn't match */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
  }
  html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}
.font-image-wrapper {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10;
  pointer-events: none;
}

.font-image {
  position: absolute;
  width: min(6vw, 60px);
  height: auto;
  display: block;
  pointer-events: auto;
  
  /* Calculate position based on background-size: contain behavior */
  /* This positions the logo at the top-left of the visible background image */
  top: calc(50% - min(50vh, 50vw) + 2%);
  left: calc(58.5% - min(50vh, 50vw) + 2%);
}
/* Main heading (h1) */
body.index-home .container h1 {
  font-family: 'UoqMunThenKung', 'Lucida Handwriting Std', sans-serif;
  font-size: 2.3rem;
  color: #ffffff; /*margin bottom is missing*/
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
  position: relative;
  top: -30px;
  display: inline-block;
  padding-bottom: 15px;
  align-items: center;
}
.font-photobooth {
  font-family: 'UoqMunThenKhung', serif;
  display: block;
  font-size: 1.9rem;
}
.font-lucida{
  font-family: 'Lucida Handwriting Std', cursive;
  font-size: 1.7rem;
  font-weight: 100;
  display: block;
  color: red;
  text-transform: none;
  position: absolute;
  top: 115%; /* ✅ push slightly further below Photobooth */
  left: 50%;
  transform: translate(-50%, -30px) rotate(-10deg); /* ✅ more vertical space */
  transform-origin: center;
  line-height: 1;
  white-space: nowrap;
}
.font-lucida .first-letter {
  font-size: 2.4rem;
  font-weight: 100;
  display: inline;
  letter-spacing: -2px;  
  transform: translateY(10px);
}
body.index-home ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
body.index-home li {
  margin: 0;
}
body.index-home a {
  text-decoration: none;
  color: #007BFF;
  font-weight: 600;
  font-size: 1.1rem;
}

body.index-home a:hover {
  text-decoration: underline;
  color: #0056b3;
}

body.index-home .layout-thumb {
  width: 100%;
  max-width: 120px;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  transition: all 0.3s ease;
  display: block;
  margin: 10px auto 0;
}

body.index-home .layout-thumb:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.25);
}
/* ==== Enhanced Layout Options Section ==== */
.all-options {
  margin: 2rem 0;
}
/* Desktop: 2-column grid layout */
.all-options ul {
  display: flex;
  flex-wrap: wrap;
  flex-direction: column;  /* ✅ vertical stacking */
  align-items: center;
  gap: 2rem;
  padding: 0 1rem;
  width: 100%;
  margin: 0 auto;
  max-width: 100%;
}
.all-options li {
  width: 40%;
  max-width: 250px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: url('templates/background/container.png') center/contain no-repeat;
  filter: grayscale(50%);
  border: none;
  border-radius: 15px;
  padding: 1.5rem;
  text-align: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}
.all-options li::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
  transition: left 0.5s;
}

.all-options li:hover::before {
  left: 100%;
}

.all-options li:hover {
  transform: translateY(-8px);
  border-color: #000000;
  box-shadow: 0 12px 30px rgba(0,123,255,0.2);
  background: url('templates/background/container.png') center/cover no-repeat;
}

.all-options li:active {
  transform: translateY(-4px);
}
.layout-link {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  text-align: center;
  text-decoration: none;
  color: inherit;
}
.layout-link span {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: white;
}
.layout-link:hover span {
  background-color: rgba(255, 0, 0, 0.9); /* Semi-transparent background */
  color: white;
}
.under-construction {
  position: absolute;
  top: 50%; /* Adjust as needed */
  left: 50%; /* Adjust as needed */
  transform: translate(-50%, -50%); /* Centers the text */
  background-color: rgb(220, 220, 220, 0.1);
  color: white;
  padding: 5px 10px;
  border-radius: 5px;
  font-weight: bold;
  z-index: 10; /* Ensures the text is on top of the image */
  font-size: 0.8rem;
}
/* Mobile: Stack vertically */
@media (max-width: 768px) {
  body.index-home .container {
    max-width: 95%;
    margin: 20px auto;
    padding: 20px;
    border-radius: 10px;
  }
  body.index-home .container h1 {
    position: relative;
    top: -30px;
    font-size: 2rem;
  }
  .font-photobooth {
    font-size: 2.2rem;
    line-height: 1.1;
    text-align: center;
  }
  .font-lucida {
    font-size: 2.2rem;
    position: static;                  /* ✅ remove absolute */
    transform: rotate(-8deg);          /* ✅ rotate slightly */
    transform-origin: center;
    display: inline-block;
    margin: -10px auto 0;              /* ✅ center & bring closer to "Photo booth" */
    text-align: center;
  }
  .font-lucida .first-letter {
    font-size: 2.6rem;
    transform: translateY(4px) scaleX(0.9);
  }
  .custom-heading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  position: relative;
  text-align: center;
}
  /* Switch to single column */
  .all-options ul {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    max-width: 100%;
    
  }
  .all-options li {
    width: 50%;
    max-width: 180px;
    padding: 1rem;
    height: auto; /* Or set a fixed height */
    min-height: auto;
    background-size: contain;
  }
  
  .all-options li a {
    font-size: 1.2rem;
    margin-bottom: 0.8rem;
  }
  body.index-home .layout-thumb {
    max-width: 100px;
    height: auto;
  }
  .font-image {
    /* Same dynamic sizing as desktop */
    width: min(30vw, 60px);
    
    /* Adjust positioning for mobile container changes */
    top: calc(41% - min(45vh, 45vw) + 4%);
    left: calc(60% - min(45vh, 45vw) + 4%);
  }
  .layout-link span {
    font-size: 1rem;
  }
}
/* Extra small screens */
@media (max-width: 480px) {
  body.index-home .container {
    width: 100vw;
    height: 100vh;
    max-width: none;
    margin: 0;
    padding: 0;
    border-radius: 0;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
  }
   body.index-home .container h1 {
    font-size: 2.2rem; /* Reduced from 2.2rem */
    line-height: 1.3; /* Tighter line spacing */
    padding-bottom: 8px; /* Smaller underline spacing */
    margin-bottom: 0.8rem;
    position: relative;
    top: -50px;
    letter-spacing: 1px; /* Reduced spacing */
  }
  /* Adjust the underline to match */
  body.index-home .container h1::after {
    width: 60px; /* Shorter underline */
    height: 3px; /* Thinner */
  }
  body.index-home .container h1 {
    font-size: 1.5rem;
    margin-bottom: 0.1rem;
  }
  .font-photobooth {
    font-size: 2rem;
    margin-top: -30px;
    line-height: 1.2;
    margin-bottom: -0.26rem;
  }
  .font-lucida {
    font-size: 1.7rem;
    transform: rotate(-8deg);
  }
  .font-lucida .first-letter {
    font-size: 2.4rem;
    transform: translateY(4px) scaleX(0.85);
  }
  .all-options {
  margin-top: 50px;   /* ✅ Push entire section down from heading */
}
  .all-options ul {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    gap: 1rem;
  }
  .all-options li {
    width: 70%;
    max-width: 150px;
    padding: 0.8rem;
    min-height: auto;
  }
  .all-options li a {
    font-size: 1.1rem;
  }
  .layout-link {
    width: 100%;
    height: 100%;
    padding: 0;
    margin: 0;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-decoration: none;
    color: inherit;
    touch-action: manipulation; /* mobile tap optimization */
  }
  .layout-link span {
    font-size: 0.9rem;
  }
  .layout-link:active {
    background-color: rgba(0, 123, 255, 0.05); /* subtle mobile tap feedback */
    border-radius: 10px;
  }
  body.index-home .layout-thumb {
    max-width: 75px;
    height: auto;
  }
  .font-image {
    /* Consistent dynamic sizing */
    width: min(30vw, 60px);
    
    /* Positioning for fullscreen mobile */
    top: calc(22% - min(40vh, 40vw) + 5%);
    left: calc(43% - min(40vh, 40vw) + 3%);
  }
}
/* Background enhancement */
body.index-home {
  background: linear-gradient(135deg, #3d3f45 0%, #2b282e 100%);
  background-repeat: repeat;
  background-blend-mode: overlay;
  min-height: 100vh;
  padding: 20px 0;
}

/* Simple styles for photobooth flow sections */
#photobooth-flow {
    display: none;
    margin-top: 20px;
    text-align: center;
}

#photobooth-flow video, #photobooth-flow img {
    max-width: 100%;
    border: 1px solid #ccc;
    border-radius: 8px;
}
#photobooth-flow button {
    margin: 10px 5px;
    padding: 10px 20px;
    font-size: 16px;
    cursor: pointer;
}

.template-thumb:hover {
  transform: scale(1.05);
  border-color: #333;
  transition: all 0.2s ease-in-out;
}

button:hover {
  background: #eee;
}

#frameWrapper div[contenteditable="true"] {
  min-width: 60px;
  min-height: 30px;
  border: 1px dashed transparent;
}

#frameWrapper div[contenteditable="true"]:focus {
  border: 1px dashed #fff;
}

#frameWrapper {
  position: relative;
  touch-action: none;
  overflow: visible;
}

#frameWrapper > div[data-editing] {
  position: absolute;
  cursor: move;
  max-width: 90%;
  word-break: break-word;
  z-index: 10;
}

.resize-handle {
  position: absolute;
  right: -10px;
  bottom: -10px;
  width: 18px;
  height: 18px;
  background: rgba(255,255,255,0.5);
  border-radius: 4px;
  border: 1px solid #999;
  cursor: nwse-resize;
  z-index: 15;
}

@media (max-width: 768px) {
  body, html {
    touch-action: none;
    overscroll-behavior: none;
  }
}

#trashZone {
  z-index: 1000;
}

.frame-wrapper {
  position: relative;
}

#finalImagePreview {
  display: block;
  margin: 0 auto;
  max-width: 100%;
  height: auto;
  border: 4px solid #fff;
  box-shadow: 0 0 10px rgba(0,0,0,0.2);
}
