﻿/* ===============================
   BASE
================================ */
body {
  margin: 0;
  font-family: lato;
  color: #222;
}

h1 {
 font-family: "Lato", sans-serif;
 font-weight: 700;
 font-style: normal;
 font-size: 22px; 
}

h2 {
	font-family: lato; 
	font-size: 18px; 
	font-weight: 400;
}



/* ===============================
   LAYOUT
================================ */
#canvasWrapper {
  margin-left: 220px; /* prostor za sidebar */
  padding: 10px;
}

/* ===============================
   CANVAS
================================ */
#planner {
  border: 1px solid #333;
  display: block;
  background: #fafafa;
  cursor: default;
}

/* ===============================
   SIDEBAR
================================ */
#sidebar {
  position: fixed;
  left: 0;
  top: 0;
  width: 220px;
  height: 100vh;
  background: #ffffff;
  border-right: 1px solid #ddd;
  padding: 10px;
  z-index: 100;
  overflow-y: auto;
}

#sidebar h3 {
  margin: 0 0 10px;
  font-size: 16px;
}

/* Sidebar items */
.sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px;
  border: 1px solid #eee;
  margin-bottom: 6px;
  cursor: grab;
  background: #fafafa;
  border-radius: 4px;
}

.sidebar-item img {
  width: 40px;
  height: auto;
}

.sidebar-item:active {
  cursor: grabbing;
  opacity: 0.6;
}

.sidebar-item.active {
  border-color: #2e7d32;
  background: #e8f5e9;
}

/* ===============================
   ACCORDION
================================ */
.accordion-section {
  border-bottom: 1px solid #ddd;
  margin-bottom: 6px;
}

.accordion-header {
  font-weight: bold;
  font-size: 14px;
  padding: 8px;
  cursor: pointer;
  background: #f5f5f5;
  user-select: none;
}

.accordion-header:hover {
  background: #eee;
}

.accordion-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease;
  padding: 0 6px;
}

.accordion-section.open .accordion-body {
  max-height: 600px;
  padding-top: 6px;
}

/* ===============================
   CONTROLS
================================ */
#controls {
  padding: 12px;
  background: #1f1f1f;
  color: #fff;
  font-size: 14px;
}

#controls strong {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  opacity: 0.85;
}

#controls input[type="number"],
#controls textarea {
  width: 100%;
  padding: 6px;
  margin: 4px 0 8px;
  border-radius: 4px;
  border: none;
  font-size: 14px;
}

#controls textarea {
  resize: vertical;
  min-height: 100px;
}

#controls button {
  background: #2e7d32;
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 8px 10px;
  font-size: 14px;
  cursor: pointer;
  margin: 4px 0;
  transition: background 0.15s ease, transform 0.1s ease;
}

#controls button:hover {
  background: #388e3c;
}

#controls button:active {
  transform: scale(0.97);
}

#controls hr {
  border: none;
  border-top: 1px solid rgba(255,255,255,0.15);
  margin: 10px 0;
}

/* ===============================
   MODE BADGE
================================ */
.mode-badge {
  position: fixed;
  top: 10px;
  right: 10px;
  padding: 6px 12px;
  font-weight: bold;
  font-size: 12px;
  border-radius: 4px;
  z-index: 1000;
  text-transform: uppercase;
}

.mode-edit {
  background: #2e7d32;
  color: #fff;
}

.mode-view {
  background: #555;
  color: #fff;
}

/* ===============================
   HISTORY PANEL
================================ */
#historyPanel {
  position: fixed;
  left: 230px;
  top: 60px;
  width: 180px;
  background: #fff;
  border: 1px solid #ccc;
  padding: 8px;
  font-size: 12px;
  z-index: 200;
  max-height: 60vh;
  overflow-y: auto;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

#historyPanel strong {
  display: block;
  margin-bottom: 6px;
}

#historyPanel ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

#historyPanel li {
  padding: 6px 4px;
  cursor: pointer;
  border-bottom: 1px solid #eee;
}

#historyPanel li:hover {
  background: #f0f0f0;
}

/* ===============================
   POPUP (VARIANTS)
================================ */
.popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.popup {
  background: #fff;
  width: 90%;
  max-width: 720px;
  max-height: 80vh;
  border-radius: 8px;
  padding: 16px;
  display: flex;
  flex-direction: column;
}

.popup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.popup-header h3 {
  margin: 0;
  font-size: 18px;
}

.popup-header button {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
}

.variant-grid {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  overflow-y: auto;
}

.variant-card {
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 8px;
  text-align: center;
  cursor: pointer;
  transition: 0.2s;
}

.variant-card:hover {
  border-color: #333;
  background: #f7f7f7;
}

.variant-card img {
  width: 100%;
  height: 90px;
  object-fit: contain;
}

.variant-card strong {
  display: block;
  margin-top: 6px;
  font-size: 14px;
}

.variant-card small {
  color: #666;
  font-size: 12px;
}

/* ===============================
   MOBILE
================================ */
@media (max-width: 768px) {

  #sidebar {
    position: relative;
    width: 100%;
    height: auto;
  }

  #canvasWrapper {
    margin-left: 0;
    padding-bottom: 45vh;
  }

  #controls {
    width: 100%;
    position: fixed;
    bottom: 0;
    left: 0;
    max-height: 45vh;
    overflow-y: auto;
    background: #ffffff;
    color: #222;
    z-index: 1500;
    border-top: 1px solid #ccc;
  }

  #controls button {
    width: 100%;
    font-size: 16px;
    padding: 12px;
  }

  #controls input,
  #controls textarea {
    font-size: 16px;
  }
}
.sidebar-item.dragging {
  opacity: 0.5;
  border-style: dashed;
}
/* Pomeri glavni sadržaj desno od sidebar-a */
#canvasWrapper,
#controls {
  margin-left: 280px;
}
@media (max-width: 768px) {
  #canvasWrapper,
  #controls {
    margin-left: 0;
  }
}
/* ===============================
   srdjan
================================ */

#header {
 display: flex; 
 justify-content: center; 
 background-color: #f2f2f2;
}

.header_uzi {
 width: 90%;
height: auto;
 display: flex;
justify-content: flex-start;
flex-direction: row;
}

.header_logo {
	width: 80px;
	height: auto;
}

.header_naslov {
	margin-left: 25px;
	width: 200px;
	height: auto;
}

.container {
  display: flex; 
  justify-content: center;	
  margin-top: 50px; 
  flex-direction: row;
 padding: 0;
}

.linija {
  border-top-style: solid;
	border-top-color: #ccc;	
	border-top-width: thin;
	height: 1px;
	width: 80%;
}

.konfig {
	width: 40%;
	height: auto;
	display: flex;
	flex-direction: row;
}

.oblik {
	width: 50%;
	height: auto;
	text-align: left;
	margin-top: 0px;
	
}

.oblik_dugme {
	width: 50%;
	height: auto;
	text-align: left;
	margin-top: 0px;
	padding-bottom: 0px;
	
}

.cekiranje {
	width:100%;
	height: auto;
	margin-top: 18px;
}

.konfig button {
  display: inline-block;
  background: #0d7bbf;
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 8px 10px;
  font-size: 14px;
  cursor: pointer;
  margin: 25px 0;
  transition: background 0.15s ease, transform 0.1s ease; 
}

.konfig button:hover {
  background: #41beec;
}

.konfig button:active {
  transform: scale(0.97);
}

.konfig input[type="number"],
.konfig textarea {
  width: 100%;
  padding: 6px;
  margin: 4px 0 8px;
  border-radius: 4px;
  border: none;
  font-size: 16px;
  font-family: lato; 
  border-color: #f2f2f2	;
  border-style: solid;
}


/* ===============================
   MOBILE
================================ */
@media (max-width: 768px) {


	
/* ===============================
   srdjan
================================ */
.container {
  flex-direction: column;
  padding-left: 5%;
  padding-right: 5%;
  margin-top: 0px;
}
	
.konfig {  
  flex-direction: column;
  width: 100%;
}

.oblik {
	width: 100%;
	margin-top: 50px;	
}

.linija {
	  display: none;	
}
	
.oblik_dugme {
	
	padding-bottom: 50px;
	
}
/* ===============================
   GHOST PREVIEW
================================ */
#ghostPreview {
  position: fixed;
  pointer-events: none;
  opacity: 0.6;
  z-index: 5000;
  transform: translate(-50%, -50%);
  display: none;
}

	
}
