*{
  box-sizing:border-box;
}

body{
  margin:0;
  font-family:Inter,sans-serif;
  background:#f5f5f5;
  overflow:hidden;
}

/* =========================
   APP
========================= */

.builder{
  display:flex;
  flex-direction:column;
  height:100vh;
}

/* =========================
   HEADER
========================= */

.header{
  height:64px;

  background: linear-gradient(90deg, #0A2A66 0%, #1D5FD1 100%);
  color: white;

  display:flex;
  align-items:center;
  justify-content:space-between;

  padding:0 20px;

  flex-shrink:0;
}

.logo{
  font-size:20px;
  font-weight:700;
}

.tabs{
  display:flex;
  gap:12px;
}

.tab{
  border:none;
  background:none;
  color:#999;
  cursor:pointer;

  font-size:15px;
}

.tab.active{
  color:#fff;
}

.actions{
  display:flex;
  gap:10px;
}

.actions button{
  border:none;
  background: rgba(255,255,255,0.12);
  color:#fff;
  padding:10px 14px;
  border-radius:10px;
  cursor:pointer;
  backdrop-filter: blur(6px);
  transition: all .2s ease;
}

.actions button:hover{
  background: rgba(255,255,255,0.22);
  transform: translateY(-1px);
}
/* =========================
   MAIN
========================= */

.main{
  flex:1;

  display:flex;

  min-height:0;
}

/* =========================
   SIDEBAR
========================= */

.sidebar{
  width:280px;

  background:#fff;

  border-right:1px solid #e5e5e5;

  padding:20px;

  overflow:auto;

  flex-shrink:0;
}

.panel{
  display:none;
}

.panel.active{
  display:block;
}

/* =========================
   CANVAS
========================= */

.canvas-wrapper{
  flex:1;

  display:flex;
  justify-content:center;
  align-items:center;

  overflow:auto;

  background:#ececec;

  position:relative;
}

#editor{
  position:relative;
}

/* =========================
   MOBILE TAB
========================= */

.mobile-tabs{
  display:none;
}

/* =========================
   MOBILE PANEL
========================= */

#mobilePanelOverlay{
  position:fixed;
  inset:0;

  background:rgba(0,0,0,.45);

  opacity:0;
  pointer-events:none;

  transition:.25s;

  z-index:1000;
}

#mobilePanelOverlay.active{
  opacity:1;
  pointer-events:auto;
}
.mobile-panel{
  position:fixed;

  left:50%;
  top:50%;

  width:88%;
  max-width:420px;

  background:#fff;

  border-radius:24px;

  z-index:999999;

  padding:20px;

  min-height:180px;
  max-height:70vh;

  overflow:auto;

  box-shadow:
    0 20px 60px rgba(0,0,0,.25);

  opacity:0;
  pointer-events:none;

  transform:
    translate(-50%, -40%) scale(.9);

  transition:.25s ease;
}

.mobile-panel.active{
  opacity:1;
  pointer-events:auto;

  transform:
    translate(-50%, -50%) scale(1);
}

.mobile-panel-header{
  display:flex;
  justify-content:space-between;
  align-items:center;

  margin-bottom:20px;
}

.mobile-panel-header button{
  border:none;
  width:36px;
  height:36px;

  border-radius:50%;

  background:#eee;
}

/* =========================
   MOBILE
========================= */

@media (max-width:768px){

  body{
    overflow:hidden;
  }

  .header{
    display:none;
  }

  .main{
    flex-direction:column;
  }

  .sidebar{
    display:none;
  }

  .canvas-wrapper{
    padding-bottom:80px;
  }

  .mobile-tabs{
    position:fixed;
    left:0;
    right:0;
    bottom:0;
    height:70px;

    background: linear-gradient(90deg, #0A2A66 0%, #1D5FD1 100%);

    display:flex;
    z-index:9999;

    border-top: 1px solid rgba(255,255,255,0.12);
    box-shadow: 0 -8px 24px rgba(10,42,102,0.25);
  }

  .mobile-tabs button{
    flex:1;

    border:none;
    background:none;

    color:#fff;

    font-size:22px;

    cursor:pointer;
    opacity: 0.6;
  }
  .mobile-tabs button:hover,
.mobile-tabs button.active{
  opacity: 1;
}
}
.text-panel-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 8px;
}
.form-group {
  display: flex;
  flex-direction: column;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 600;
  color: #333;
  letter-spacing: 0.2px;
}

.form-group textarea,
.form-group select {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid #dcdcdc;
  border-radius: 14px;
  font-size: 15px;
  font-family: Inter, sans-serif;
  background: #ffffff;
  outline: none;
  transition: all 0.2s ease;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.03);
}

.form-group textarea {
  resize: vertical;
  min-height: 110px;
  line-height: 1.5;
}

.form-group textarea:focus,
.form-group select:focus {
  border-color: #111;
  box-shadow:
    0 0 0 4px rgba(0,0,0,0.05),
    inset 0 1px 2px rgba(0,0,0,0.03);
}

.primary-btn {
  width: 100%;
  padding: 15px 20px;
  border: none;
  border-radius: 14px;
  background: #111;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.3px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 6px 16px rgba(0,0,0,0.15);
}

.primary-btn:hover {
  background: #222;
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.18);
}

.primary-btn:active {
  transform: scale(0.98);
}
/* =========================================
   PROFESSIONAL UPLOAD BUTTON
   Desktop + Mobile
========================================= */

.upload-box{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:10px;

  width:100%;
  min-height:180px;
  padding:28px 20px;

  border:2px dashed #d7d7d7;
  border-radius:18px;

  background:#fafafa;
  cursor:pointer;

  transition:all .25s ease;
  text-align:center;
}

.upload-box:hover{
  border-color:#111;
  background:#f5f5f5;
  transform:translateY(-2px);
}

.upload-icon{
  width:64px;
  height:64px;

  display:flex;
  align-items:center;
  justify-content:center;

  border-radius:50%;
  background:#111;
  color:#fff;
  font-size:28px;
  font-weight:700;
}

.upload-title{
  font-size:18px;
  font-weight:700;
  color:#111;
}

.upload-subtitle{
  font-size:13px;
  color:#888;
  line-height:1.5;
}

/* Mobile adjustment */
@media (max-width:768px){
  .upload-box{
    min-height:160px;
    padding:24px 18px;
    border-radius:16px;
  }

  .upload-icon{
    width:56px;
    height:56px;
    font-size:24px;
  }

  .upload-title{
    font-size:17px;
  }

  .upload-subtitle{
    font-size:12px;
  }
}
/* =========================================
   PRODUCT SELECT STYLING
========================================= */

.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #555;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.form-group select {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid #d9d9d9;
  border-radius: 14px;
  background: #fff;
  font-size: 16px;
  font-weight: 500;
  color: #111;
  outline: none;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}

.form-group select:hover {
  border-color: #999;
}

.form-group select:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 4px rgba(59,130,246,0.12);
}
/* ========================================
   MOBILE TOP ACTIONS
   ======================================== */
.mobile-top-actions{
  display:none;
}

@media (max-width:768px){

  .mobile-top-actions{
    display:flex;
    align-items:center;
    justify-content:space-between;

    padding:12px 16px;

    /* sama persis seperti header desktop */
    background: linear-gradient(90deg, #143B8F 0%, #1E5ACB 100%);
    border-bottom:1px solid rgba(255,255,255,0.08);
  }

  /* Logo kiri */
  .mobile-top-logo{
    font-size:24px;
    font-weight:800;
    letter-spacing:-0.5px;
    color:#ffffff;
    line-height:1;
  }

  /* Wrapper tombol kanan */
  .mobile-top-buttons{
    display:flex;
    gap:10px;
  }

  /* Tombol mobile dibuat sama seperti desktop */
  .mobile-top-actions button{
    border:none;
    border-radius:12px;

    padding:12px 18px;

    background: rgba(255,255,255,0.12);
    color:#ffffff;

    font-size:14px;
    font-weight:600;
    line-height:1;

    cursor:pointer;

    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);

    transition: all 0.2s ease;
  }

  .mobile-top-actions button:hover{
    background: rgba(255,255,255,0.18);
  }

  .mobile-top-actions button:active{
    transform: scale(0.97);
  }
}
