/* css.css */
/* Styles for the WEBSITE GENERATOR EDITOR (not the generated wedding site). */

:root{
  --bg:#f6f7fb;
  --panel:#ffffff;
  --panel2:#f2f4f8;
  --text:#111827;
  --muted:#6b7280;
  --border:rgba(0,0,0,.10);
  --border2:rgba(0,0,0,.06);
  --shadow2:0 6px 18px rgba(0,0,0,.06);
  --radius2:18px;
  --primary:#8a5a5a;
  --danger:#b91c1c;
  --ok:#166534;
  --success:#16a34a;
  --focus:rgba(59,130,246,.35);
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --sans: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family:var(--sans);
  color:var(--text);
  background:var(--bg);
}

a{ color:inherit; }
small{ color:var(--muted); }
hr{
  border:0;
  border-top:1px solid var(--border2);
  margin:14px 0;
}

/* App layout */
.app{
  height:100vh;
  display:flex;
  overflow:hidden;
}

.left{
  flex:0 0 auto;
  width:780px;
  max-width:980px;
  min-width:520px;
  resize:horizontal;
  overflow:auto;
  background:var(--panel2);
  border-right:1px solid var(--border);
  padding:16px;
}

.right{
  flex:1 1 auto;
  min-width:420px;
  background:#0b0f19;
  display:flex;
  flex-direction:column;
}

.preview-wrap{
  flex:1 1 auto;
  padding:10px;
}

#previewFrame{
  width:100%;
  height:100%;
  border:0;
  border-radius:12px;
  background:#fff;
  box-shadow:0 14px 40px rgba(0,0,0,.35);
}

/* Panels */
.panel{
  background:var(--panel);
  border:1px solid var(--border2);
  border-radius:var(--radius2);
  box-shadow:var(--shadow2);
  padding:14px;
  margin-bottom:14px;
}

.panel h2{
  margin:0 0 10px;
  font-size:16px;
  letter-spacing:.2px;
}

.panel h3{
  margin:0 0 8px;
  font-size:14px;
  color:var(--muted);
  font-weight:600;
}

.row{
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap:wrap;
}

.grid-2{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
}

.grid-3{
  display:grid;
  grid-template-columns:1fr 1fr 1fr;
  gap:10px;
}

/* Form controls */
.group{ margin:10px 0; }

label{
  display:block;
  font-size:12px;
  color:var(--muted);
  margin:0 0 6px;
}

input[type="text"],
input[type="url"],
input[type="email"],
input[type="tel"],
input[type="number"],
textarea,
select{
  width:100%;
  padding:10px 10px;
  border:1px solid var(--border);
  border-radius:12px;
  background:#fff;
  color:var(--text);
  outline:none;
}

textarea{
  min-height:90px;
  resize:vertical;
}

input:focus,
textarea:focus,
select:focus{
  box-shadow:0 0 0 3px var(--focus);
  border-color:rgba(59,130,246,.65);
}

input[type="file"]{
  width:100%;
}

.checkbox{
  display:flex;
  gap:10px;
  align-items:center;
  user-select:none;
}

.checkbox input{
  width:18px;
  height:18px;
}

.color-pair{
  display:flex;
  gap:8px;
  align-items:center;
}
.color-pair input[type="text"]{ flex:1 1 auto; }
.color-pair input[type="color"]{
  width:46px;
  height:40px;
  padding:0;
  border-radius:12px;
  border:1px solid var(--border);
  background:#fff;
  flex:0 0 auto;
}

/* Buttons */
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid var(--border);
  background:#fff;
  color:var(--text);
  cursor:pointer;
  transition:transform .06s ease, background .12s ease, border-color .12s ease;
  user-select:none;
}

.btn:hover{
  background:rgba(0,0,0,.03);
  border-color:rgba(0,0,0,.18);
}

.btn:active{ transform:translateY(1px); }

.btn-danger{
  background:var(--danger);
  color:#fff;
  border-color:rgba(0,0,0,.10);
}
.btn-danger:hover{ background:#991b1b; }

.btn-success{
  background:var(--success);
  color:#fff;
  border-color:rgba(0,0,0,.10);
}
.btn-success:hover{ background:#12843c; }

.btn-small{
  padding:7px 10px;
  border-radius:10px;
  font-size:13px;
}

/* Template buttons row */
.templates{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}
.templates .btn{
  padding:8px 10px;
  font-size:13px;
}

/* Status text */
.status{
  margin-top:6px;
  font-size:12px;
  color:var(--muted);
}
.status.ok{ color:var(--ok); }
.status.err{ color:var(--danger); }

.muted{ color:var(--muted); }

/* Module list UI */
.modules{
  display:flex;
  flex-direction:column;
  gap:10px;
}

.module-card{
  background:#fff;
  border:1px solid var(--border2);
  border-radius:var(--radius2);
  padding:12px;
  box-shadow:var(--shadow2);
}

.module-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom:10px;
}

.module-title{
  font-weight:700;
  font-size:14px;
  margin:0;
}

.module-type{
  font-size:12px;
  color:var(--muted);
}

.module-actions{
  display:flex;
  gap:8px;
  align-items:center;
}

.module-body{
  border-top:1px solid var(--border2);
  padding-top:10px;
}

/* Rich text editor (RTE) */
.rte-toolbar{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:8px;
  background:#fff;
  border:1px solid var(--border);
  border-radius:12px;
  padding:8px;
  margin-bottom:8px;
}

.rte-toolbar button{
  padding:7px 10px;
  border-radius:10px;
  border:1px solid var(--border);
  background:#fff;
  cursor:pointer;
}

.rte-toolbar button:hover{ background:rgba(0,0,0,.03); }

.rte-toolbar select,
.rte-toolbar input[type="color"]{
  height:34px;
  border-radius:10px;
  border:1px solid var(--border);
  padding:0 8px;
}

.rte-toolbar input[type="color"]{
  width:42px;
  padding:0;
  background:#fff;
}

.rte-editor{
  min-height:120px;
  border:1px solid var(--border);
  border-radius:12px;
  padding:10px;
  background:#fff;
  outline:none;
}

.rte-editor:focus{
  box-shadow:0 0 0 3px var(--focus);
  border-color:rgba(59,130,246,.65);
}

.rte-editor a{
  color:var(--primary);
  text-decoration:underline;
  text-underline-offset:3px;
}

/* Gallery / image picks inside editor */
.picks{
  display:grid;
  grid-template-columns:repeat(auto-fill, minmax(96px, 1fr));
  gap:8px;
}

.picks .thumb{
  position:relative;
  border-radius:12px;
  overflow:hidden;
  border:1px solid var(--border2);
  box-shadow:0 6px 16px rgba(0,0,0,.06);
  background:#f3f4f6;
  aspect-ratio:1/1;
}

.picks .thumb img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}

.picks .thumb .x{
  position:absolute;
  top:6px;
  right:6px;
  width:28px;
  height:28px;
  border-radius:10px;
  border:1px solid var(--border);
  background:rgba(255,255,255,.9);
  cursor:pointer;
}

/* Contacts list in editor */
.contacts{
  display:flex;
  flex-direction:column;
  gap:10px;
}

.contact-row{
  display:grid;
  grid-template-columns:1.2fr 1.2fr 160px 44px;
  gap:8px;
  align-items:center;
}
.contact-row .btn{ padding:10px 0; }

/* Collapsibles (details) */
details{
  border:1px solid var(--border2);
  border-radius:var(--radius2);
  background:#fff;
  padding:10px 12px;
  margin-bottom:14px;
}

details > summary{
  cursor:pointer;
  font-weight:700;
  font-size:14px;
  user-select:none;
  list-style:none;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}

details > summary::-webkit-details-marker{ display:none; }

details > summary::after{
  content:"▸";
  font-size:16px;
  color:var(--muted);
  transition:transform .12s ease;
  transform:rotate(0deg);
}

details[open] > summary::after{
  transform:rotate(90deg);
}

details[open]{
  box-shadow:var(--shadow2);
}

/* Responsive */
@media (max-width: 980px){
  .app{ flex-direction:column; }
  .left{
    width:100%;
    max-width:none;
    min-width:0;
    resize:none;
    border-right:0;
    border-bottom:1px solid var(--border);
    height:52vh;
  }
  .right{ height:48vh; }
  .contact-row{ grid-template-columns:1fr; }
}
