:root{
  --bg:#0e0f14;
  --card:#151824;
  --panel:#1a1f31;
  --accent:#d8b76a;        /* gala gold */
  --accent-2:#9b7d2e;
  --text:#f5f6fb;
  --muted:#a9afc3;

  --free:#2ecc71;
  --held:#f1c40f;
  --paid:#e74c3c;

  --border:rgba(255,255,255,.10);
  --shadow: 0 10px 30px rgba(0,0,0,.35);
}

*{ box-sizing:border-box; }

html,body{
  margin:0;
  background:
    radial-gradient(1200px 600px at 10% -10%, #1b2036 0%, transparent 60%),
    radial-gradient(800px 400px at 90% 0%, #221b36 0%, transparent 55%),
    var(--bg);
  color:var(--text);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

a{ color:var(--accent); text-decoration:none; }
a:hover{ text-decoration:underline; }

.topbar{
  position:sticky; top:0; z-index:20;
  display:flex; align-items:center; justify-content:space-between;
  padding:14px 18px;
  background:linear-gradient(180deg, rgba(21,24,36,.92), rgba(21,24,36,.75));
  border-bottom:1px solid var(--border);
  backdrop-filter: blur(6px);
}

.brand__title{ font-size:20px; font-weight:800; letter-spacing:.3px; }
.brand__subtitle{ font-size:12px; color:var(--muted); margin-top:2px; }

.lang .pill{
  display:inline-block; margin-left:6px;
  padding:6px 10px; border-radius:999px;
  background:transparent; border:1px solid var(--border);
  color:var(--muted);
}
.lang .pill.active{
  background:linear-gradient(135deg, var(--accent), var(--accent-2));
  color:#111; border-color:transparent;
}

.container{ max-width:1200px; margin:0 auto; padding:16px; }

.footer{ text-align:center; color:var(--muted); padding:24px 0 40px; }

/* ---------- cards / panels ---------- */
.card{
  background:linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,.01)), var(--card);
  border:1px solid var(--border);
  border-radius:18px;
  padding:18px;
  margin-bottom:16px;
  box-shadow: var(--shadow);
}

.card h1, .card h2, .card h3{ margin:0 0 10px 0; }
.small{ font-size:13px; color:var(--muted); }

.ticket-delivery-panel{display:grid;gap:12px;scroll-margin-top:16px}
.ticket-delivery-panel__heading{display:flex;align-items:flex-start;justify-content:space-between;gap:16px}
.ticket-delivery-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:10px}
.ticket-delivery-grid article{display:grid;gap:6px;padding:13px;border:1px solid var(--border);border-radius:12px;background:rgba(255,255,255,.035)}
.ticket-delivery-grid small{color:var(--muted);font-size:10px;font-weight:800;text-transform:uppercase}
.ticket-delivery-grid strong{overflow-wrap:anywhere}
.ticket-delivery-actions{display:flex;flex-wrap:wrap;gap:8px}
.ticket-delivery-actions .btn{justify-content:center}
.ticket-delivery-actions form{margin:0}
.ticket-delivery-warning{min-height:0;margin-top:0;padding:10px 12px;border:1px solid rgba(255,157,164,.28);border-radius:10px;background:rgba(255,157,164,.08);font-size:13px;line-height:1.4}
.ticket-delivery-url{font-size:12px}

hr{
  border:none;
  height:1px;
  background:var(--border);
  margin:14px 0;
}

/* ---------- form controls ---------- */
input, select, button{
  font: inherit;
}

.input, input{
  width:100%;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid var(--border);
  background:rgba(0,0,0,.25);
  color:var(--text);
  outline:none;
}
input::placeholder{ color:rgba(169,175,195,.75); }

label{
  display:block;
  font-size:13px;
  color:var(--muted);
  margin:10px 0 6px;
}

.btn, button{
  cursor:pointer;
  border:none;
  border-radius:12px;
  padding:10px 12px;
  background:rgba(255,255,255,.08);
  color:var(--text);
  border:1px solid var(--border);
}
.btn.primary, button.primary{
  background:linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color:transparent;
  color:#111;
  font-weight:700;
}
.btn:disabled{ opacity:.55; cursor:not-allowed; }

/* ---------- ADMIN BUILDER LAYOUT ---------- */
.builder-shell{
  display:grid;
  grid-template-columns: 340px 1fr;
  gap:16px;
  align-items:start;
}

@media (max-width: 980px){
  .builder-shell{ grid-template-columns: 1fr; }
}

/* left panel */
.builder-panel{
  background:linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,.01)), var(--panel);
  border:1px solid var(--border);
  border-radius:18px;
  padding:16px;
  box-shadow: var(--shadow);
}

/* right map */
.builder-map-wrap{
  background:linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,.01)), var(--panel);
  border:1px solid var(--border);
  border-radius:18px;
  padding:12px;
  box-shadow: var(--shadow);
}

/* Landscape map: 16:9 on desktop */
#builderMap{
  position:relative;
  width:100%;
  aspect-ratio: 16 / 9;
  min-height: 520px;
  border-radius:16px;
  background:
    radial-gradient(900px 500px at 20% 0%, rgba(216,183,106,.10), transparent 55%),
    radial-gradient(900px 500px at 90% 10%, rgba(155,125,46,.10), transparent 55%),
    rgba(0,0,0,.35);
  border:2px dashed rgba(255,255,255,.16);
  overflow:hidden; /* bitno: da elementi ostaju u mapi */
}

/* On small phones allow vertical scroll if needed */
@media (max-width: 520px){
  #builderMap{
    aspect-ratio: 4 / 3;
    min-height: 480px;
  }
}

/* ---------- ZONES (stage + dancefloor) ---------- */
.zone-box{
  position:absolute;
  border-radius:12px;
  border:2px solid rgba(255,255,255,.38);
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight:800;
  letter-spacing:.3px;
  user-select:none;
  box-shadow: 0 10px 22px rgba(0,0,0,.25);
}

.zone-box .resize-handle{
  position:absolute;
  right:-6px;
  bottom:-6px;
  width:14px;
  height:14px;
  border-radius:50%;
  background:#fff;
  border:2px solid rgba(0,0,0,.35);
}

.zone-stage{
  background: rgba(231,76,60,.68);
  border-color: rgba(231,76,60,.95);
}
.zone-dance{
  background: rgba(52,152,219,.60);
  border-color: rgba(52,152,219,.95);
}

/* ---------- TABLES + SEATS ---------- */
.table-wrap{
  position:absolute;
  transform: translate(-50%, -50%);
  user-select:none;
}

/* Central table circle */
.table-core{
  width:110px;
  height:110px;
  border-radius:999px;
  background: rgba(20,22,30,.92);
  border:2px solid rgba(255,255,255,.22);
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  box-shadow: 0 12px 22px rgba(0,0,0,.35);
}

.table-no{
  font-weight:900;
  font-size:16px;
  line-height:1;
}
.table-zone{
  margin-top:4px;
  font-size:12px;
  color:rgba(245,246,251,.85);
}

/* Small controls (delete + scale) */
.table-tools{
  position:absolute;
  top:-16px;
  right:-16px;
  display:flex;
  gap:6px;
}

.tool{
  width:22px;
  height:22px;
  border-radius:9px;
  background: rgba(0,0,0,.45);
  border:1px solid rgba(255,255,255,.22);
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:12px;
  line-height:1;
  color:#fff;
}
.tool:hover{ background: rgba(0,0,0,.65); }

.tool.minus{ opacity:.95; }
.tool.plus{ opacity:.95; }
.tool.del{ background: rgba(231,76,60,.55); border-color: rgba(231,76,60,.9); }

/* Seats */
.seat{
  position:absolute;
  width:26px;
  height:26px;
  transform: translate(-50%, -50%);
  border-radius:999px;
  border:1px solid rgba(255,255,255,.22);
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:12px;
  font-weight:700;
  color:#fff;
  box-shadow: 0 6px 14px rgba(0,0,0,.25);
}

.seat.free{ background: rgba(46,204,113,.85); }
.seat.held{ background: rgba(241,196,15,.85); }
.seat.paid{ background: rgba(231,76,60,.85); }

/* When table is scaled down: keep number readable */
.table-wrap[data-small="1"] .table-zone{ display:none; }
.table-wrap[data-small="1"] .table-no{ font-size:14px; }

/* ---------- Event (user) page helpers ---------- */
.map{
  width:100%;
  border-radius:16px;
  border:2px dashed rgba(255,255,255,.16);
  background: rgba(0,0,0,.35);
  overflow:hidden;
}
/* ===== Builder zones (stage & dancefloor) ===== */
#builderMap { position: relative; }

#zonesLayer, #tablesLayer{
  position:absolute; inset:0;
}

.stage, .dancefloor{
  position:absolute;
  border-radius: 12px;
  border: 2px solid rgba(255,255,255,.35);
  box-shadow: 0 10px 30px rgba(0,0,0,.45);
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
}

.dancefloor{
  background: rgba(70, 140, 255, .55); /* plavo */
}

.stage{
  background: rgba(255, 70, 70, .55);  /* crveno */
}

.zone-label{
  font-weight: 800;
  letter-spacing: .4px;
  padding: 6px 10px;
  border-radius: 10px;
  background: rgba(0,0,0,.35);
  border: 1px solid rgba(255,255,255,.18);
}

.resize-handle{
  position:absolute;
  width: 14px;
  height: 14px;
  right: -7px;
  bottom: -7px;
  border-radius: 999px;
  background: #fff;
  border: 2px solid rgba(0,0,0,.4);
  cursor: nwse-resize;
}
