/* ================================
   1. MAIN LAYOUT
================================ */

.builder {
  display: flex;
  height: 100vh;
  font-family: "Inter", sans-serif;
  background: #f5f7fb;
}

/* ================================
   2. SIDEBAR
================================ */

.builder-sidebar {
  width: 300px;
  background: #ffffff;
  border-right: 1px solid #e4e7ec;
  padding: 25px;
  overflow-y: auto;
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.04);
}

/* Sidebar Scrollbar */

.builder-sidebar::-webkit-scrollbar {
  width: 6px;
}

.builder-sidebar::-webkit-scrollbar-thumb {
  background: #d0d5dd;
  border-radius: 10px;
}

/* ================================
   3. FORM ELEMENTS
================================ */

/* Labels */

.builder-sidebar label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #344054;
  margin-top: 18px;
  margin-bottom: 6px;
}

/* Inputs & Selects */

.builder-sidebar select,
.builder-sidebar input {
  width: 100%;
  height: 40px;
  border-radius: 8px;
  border: 1px solid #d0d5dd;
  padding: 0 10px;
  font-size: 14px;
  background: #fff;
  transition: all 0.2s ease;
}

/* Focus State */

.builder-sidebar select:focus,
.builder-sidebar input:focus {
  outline: none;
  border-color: #4f46e5;
  box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.1);
}

/* ================================
   4. BUTTONS
================================ */

.builder-sidebar button {
  width: 100%;
  padding: 10px;
  margin-top: 10px;
  border: none;
  background: #4f46e5;
  color: #fff;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: 0.3s;
}

.builder-sidebar button:hover {
  background: #4338ca;
}

/* Divider */

.builder-sidebar hr {
  margin: 20px 0;
  border: none;
  border-top: 1px solid #717275;
}

/* ================================
   5. PAGE SELECTION LIST
================================ */

.page-title {
  font-size: 16px;
  font-weight: 700;
  margin-top: 25px;
  margin-bottom: 10px;
  color: #111827;
}

.page-item {
  display: flex !important;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid #e4e7ec;
  border-radius: 8px;
  cursor: pointer;
  transition: 0.2s;
  background: #fff;
}

/* checkbox */
.page-item input[type="checkbox"] {
  margin: 0;
  width: 16px;
  height: 16px;
  accent-color: #4f46e5;
}

/* page name */
.page-item span {
  font-weight: 600;
  font-size: 14px;
  color: #1f2937;
}

/* file name right side */
.page-item small {
  margin-left: auto;
  font-size: 12px;
  color: #6b7280;
}
.page-item:has(input:checked) {
  border-color: #4f46e5;
  background: #eef2ff;
}

/* ================================
   6. PREVIEW AREA
================================ */

.builder-preview {
  flex: 1;
  background: #f5f7fb;
  overflow-y: auto;
  padding: 40px;
}

/* Template Preview Container */

#templatePreviewMode {
  max-width: 1400px;
  margin: auto;
  background: #ffffff;
  border-radius: 12px;
  padding: 30px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}
.builder-message {
  text-align: center;
  padding: 40px 20px;
  border: 2px dashed #d1d5db;
  border-radius: 10px;
  margin-bottom: 30px;
  background: #fafafa;
}

.builder-message h2 {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 10px;
  color: #111827;
}

.builder-message p {
  font-size: 14px;
  color: #6b7280;
}

/* Preview Sections */

#header-preview,
#hero-preview,
#about-preview,
#feature-preview,
#testimonial-preview,
#footer-preview {
  margin-bottom: 30px;
  border: 1px dashed #e4e7ec;
  border-radius: 8px;
  padding: 10px;
  background: #fafafa;
}

/* ================================
   7. GENERATE BUTTON
================================ */

#generatePage {
  background: #10b981;
  color: white;
  border: none;
  padding: 14px 22px;
  font-size: 15px;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: 0.3s;
}

#generatePage:hover {
  background: #059669;
}

/* ================================
   8. IFRAME PREVIEW
================================ */

.builder-preview iframe {
  width: 100%;
  height: 100%;
  border: none;
  border-radius: 8px;
}

/* ===============================
   DEVICE SWITCH
================================ */

.device-switch {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 20px;
}

.device-switch button {
  border: 1px solid #d0d5dd;
  background: #fff;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  transition: 0.2s;
}

.device-switch button:hover,
.device-switch button.active {
  background: #4f46e5;
  color: #fff;
  border-color: #4f46e5;
}

/* =================================
   PREVIEW DEVICE WIDTHS
================================ */

#previewWrapper {
  margin: 0 auto;
  transition: max-width 0.3s ease;
}

.preview-device-wrapper.preview-desktop {
  max-width: 100%;
}

.preview-device-wrapper.preview-tablet {
  max-width: 768px;
  margin-left: auto;
  margin-right: auto;
}

.preview-device-wrapper.preview-mobile {
  max-width: 390px;
  margin-left: auto;
  margin-right: auto;
}

#templatePreviewFrame {
  min-height: 80vh;
  border-radius: 8px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

#preview-divs {
  min-height: 200px;
}
[data-edit] {
  position: relative !important;
}

[data-edit]:hover {
  outline: 2px dashed #0d6efd !important;
  cursor: pointer !important;
}
/* =================================
   MOBILE (575px)
================================= */

/* @media (max-width: 575px) {
  .builder {
    flex-direction: column;
  }

  .builder-sidebar {
    width: 100%;
    padding: 15px;
  }

  .builder-preview {
    padding: 15px;
    background: red !important;
  }

  #templatePreviewMode {
    padding: 15px;
  }

  .page-item {
    padding: 8px 10px;
  }

  .builder-message h2 {
    font-size: 22px;
  }
} */

/* =================================
   EXTRA SMALL MOBILE (400px)
================================= */

/* @media (max-width: 400px) {
  .builder-sidebar label {
    font-size: 12px;
  }

  .builder-sidebar select,
  .builder-sidebar input {
    height: 36px;
    font-size: 13px;
  }

  .builder-sidebar button {
    font-size: 13px;
    padding: 9px;
  }
} */
