/* ============================
   GOOGLE FONTS
============================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Poppins:wght@500;700;800&display=swap');

/* ============================
   BASE + GLOBALS
============================ */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Inter", sans-serif;
  overflow-x: hidden;
  background: #ffffff;
  color: #1a1a1a;
  line-height: 1.6;
}

/* spacing only for demo preview */
.db-preview-section,
.db-preview-layout {
  padding-left: 20px;
  padding-right: 20px;
}

h1, h2, h3 {
  font-family: "Poppins", sans-serif;
  font-weight: 700;
}

.db-header,
.db-preview-section {
  background: #ffffff;
}

/* ============================
   HEADER
============================ */

.db-header {
  padding: 20px 0 10px;
  border-bottom: 1px solid rgba(0,0,0,0.06);
}

.db-header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding-left: 20px;
  padding-right: 20px;
}

.db-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 999px;
  background: #f1faf7;
  color: #009879;
  text-decoration: none;
  font-weight: 600;
  border: 1px solid rgba(0,152,121,0.2);
  font-size: 0.9rem;
}

.db-demo-switcher {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  flex-wrap: wrap;
}

#demo-switcher {
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,0.12);
  font-size: 0.9rem;
}

.db-all-demos {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 999px;
  background: #eaf4ff;
  color: #0064c8;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  border: 1px solid rgba(0,100,200,0.2);
}

.db-header-bottom {
  margin-top: 16px;
  padding-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  border-top: 1px dashed rgba(0,0,0,0.06);
  padding-top: 14px;
  flex-wrap: wrap;
  padding-left: 20px;
  padding-right: 20px;
}

.db-view-tabs {
  display: inline-flex;
  gap: 8px;
  background: #f4f8fb;
  padding: 6px;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,0.05);
  flex-wrap: wrap;
}

.view-tab {
  border: none;
  padding: 8px 14px;
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: 0.3s;
}

.view-tab.active {
  background: linear-gradient(90deg, #009879, #00aaff);
  color: #fff;
}

/* ============================
   PREVIEW LAYOUT
============================ */

.db-preview-section {
  padding: 30px 0 80px;
}

.db-preview-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 24px;
  width: 100%;
}

.db-preview-meta{
  font-weight: 700;
  padding-bottom: 10px;
}

/* Page list */
.db-page-list h2 {
  font-size: 1.5rem;
  margin-bottom: 10px;
  font-weight: 700;
}

.db-page-list-inner {
  background: #f7f9fb;
  border-radius: 14px;
  padding: 12px;
  border: 1px solid rgba(0, 156, 73, 0.84);
  max-height: 520px;
  overflow-y: auto;
  scrollbar-width: thin;
  font-weight: 900;
}

.db-page-card {
  width: 100%;
  border: none;
  background: #ffffff;
  border-radius: 10px;
  margin-bottom: 10px;
  font-size: medium;
  padding: 8px;
  display: flex;
  gap: 10px;
  text-align: left;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
  border: 1px solid transparent;
  transition: 0.2s ease;
}

.db-page-card.active {
  border-color: #00aaff;
  box-shadow: 0 8px 18px rgba(0,0,0,0.1);
}

.db-page-card img {
  width: 70px;
  height: 50px;
  object-fit: cover;
  border-radius: 6px;
}

/* ============================
   PREVIEW FRAME
============================ */

.db-preview-frame-wrap {
  background: #f7fafc;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.08);
  border: 1px solid rgba(0,0,0,0.03);
}

.db-preview-frame {
  border-radius: 18px;
  background: #111827;
  padding: 16px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.db-preview-inner img {
  width: 100%;
  display: block;
}

.db-view-desktop .db-preview-inner {
  max-width: 1100px;
  border-radius: 12px;
}

.db-view-tablet .db-preview-inner {
  max-width: 768px;
  border-radius: 18px;
}

.db-view-mobile .db-preview-inner {
  max-width: 420px;
  border-radius: 26px;
}

/* ============================
   RESPONSIVE FIXES
============================ */

@media (max-width: 1020px) {
  .db-preview-layout {
    grid-template-columns: 240px 1fr;
  }
}

@media (max-width: 880px) {
  .db-preview-layout {
    grid-template-columns: 1fr;
  }
  .db-page-list-inner {
    max-height: 260px;
    margin-bottom: 10px;
  }
}

@media (max-width: 600px) {
  .db-view-tabs {
    width: 100%;
    justify-content: space-between;
  }

  .db-header-top {
    flex-direction: column;
    align-items: flex-start;
  }

  .db-preview-frame-wrap {
    padding: 12px;
  }
}

@media (max-width: 420px) {
  .view-tab {
    padding: 6px 10px;
    font-size: 0.75rem;
  }

  .db-page-card img {
    width: 60px;
    height: 45px;
  }
}

/* Desktop */
@media (min-width: 1100px) {
  .db-preview-section,
  .db-preview-layout {
    padding-left: 50px;
    padding-right: 50px;
  }
}

/* Tablets */
@media (max-width: 900px) {
  .db-preview-section,
  .db-preview-layout {
    padding-left: 25px;
    padding-right: 25px;
  }
}

/* Mobiles */
@media (max-width: 600px) {
  .db-preview-section,
  .db-preview-layout {
    padding-left: 15px;
    padding-right: 15px;
  }
}

/* Prevent demo spacing affecting site header */
.db-header,
header,
.site-header,
nav {
  padding-left: 0 !important;
  padding-right: 0 !important;
}

.db-preview-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.db-expand-btn {
  background: #1a73e8;
  color: #fff;
  border: none;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 17px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
}

.db-expand-btn i {
  font-size: 14px;
}

.db-expand-btn:hover {
  background: #1257b0;
}

/* ============================
   FULLSCREEN MODAL (STABLE)
============================ */

.expand-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 999999;
  background: rgba(0,0,0,0.88);
  align-items: center;      /* center vertically */
  justify-content: center;  /* center horizontally */
  overflow: hidden;
}

/* Wrapper that holds the zoomable image */
.expand-img-container {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  touch-action: none; /* allow pinch */
}

/* Zoomable image */
.expand-modal-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(1);
  transform-origin: center center;
  max-width: none !important;
  max-height: none !important;
  width: auto;
  height: auto;
  user-select: none;
  cursor: grab;
}

/* Close Button */
.close-expand {
  position: absolute;
  top: 22px;
  right: 32px;
  font-size: 42px;
  color: #ffffff;
  cursor: pointer;
  z-index: 2000000;
}

/* Arrows */
.expand-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: white;
  font-size: 32px;
  cursor: pointer;
  padding: 14px;
  background: rgba(0,0,0,0.35);
  border-radius: 50%;
  z-index: 2000000;
}

.left-arrow { left: 30px; }
.right-arrow { right: 30px; }

/* Zoom Buttons */
.zoom-controls {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 12px;
  z-index: 2000000;
}

.zoom-controls button {
  background: white;
  border: none;
  padding: 12px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
}

.download-btn {
    position: absolute;
    bottom: 30px;
    right: 30px;
    background: white;
    border: none;
    padding: 12px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 18px;
}
