/* =========================================================
   common.css  (shared design system)
   - tokens, fonts, typography, forms, buttons, cards, toasts
   - gsearch (shared)
   - utilities (shared)
   ========================================================= */

/* ===== Tokens (shared defaults; front/admin can override) ===== */
:root{
  --bg: #fff;
  --text: #212529;
  --muted: #6c757d;

  --primary: #0d6efd;
  --danger:  #dc3545;
  --error:   #ef4444;
  --important: #dc3545; /*боја важних линкова*/
  --important-hc: #0d6efd; /*боја важних линкова - hover*/
  --success: #10b981;
  --warning: #ffc107;
  --info:    #3b82f6;

  --brand: var(--primary);   /* default link/brand, front може да override-ује */
  --line:  #e5e7eb;
  --border:#dee2e6;

  --shadow: 0 1px 2px rgba(0,0,0,.06), 0 4px 12px rgba(0,0,0,.04);
  --radius: 8px;
  --pad: 16px;

  --aside: 250px;

  /* Typography */
  --font-body: "Inter 18pt","Roboto",system-ui,-apple-system,"Segoe UI",Arial,sans-serif;
  --font-head: "Playfair Display","Arsenal",system-ui,-apple-system,"Segoe UI",Arial,sans-serif;

  --fs-base: 14px;      /* base на обе стране */
  --lh-body: 1.35;
  --lh-head: 1.15;

  --focus-ring: rgba(13,110,253,.22);
  --link:  #143A78; /*223e99  369*/
}

/* ===== Base reset ===== */
*{ box-sizing:border-box; }

html{ font-size: var(--fs-base); }

body{
  margin:0;
  padding:0;
  font-family: var(--font-body);
  line-height: var(--lh-body);
  color: var(--text);
  background: var(--bg);
}

h1, h2, h3, h4, h5, h6{
  font-family: var(--font-head);
  line-height: var(--lh-head);
  margin: 0 0 .5rem 0;
}

/* links (front може да мења --brand/hover у свом фајлу) */
a{
  color: var(--link);
  text-decoration:none;
  transition: color .2s ease, text-decoration .2s ease;
}
a:hover{ text-decoration:none; }

a.important{ color: var(--important);}
a.important:hover {color: var(--important-hc);}

/*label за обавезна поља*/
.lb-required::after {
  content: " *";
  color: red;
}

/* ===== Fonts (shared) ===== */
@font-face{
  font-family:"Roboto";
  src:url("/static/fonts/roboto/Roboto-Regular.woff2") format("woff2");
  font-weight:400;
  font-style:normal;
  font-display:swap;
}
@font-face{
  font-family:"Roboto";
  src:url("/static/fonts/roboto/Roboto-Medium.woff2") format("woff2");
  font-weight:500;
  font-style:normal;
  font-display:swap;
}
@font-face{
  font-family:"Roboto";
  src:url("/static/fonts/roboto/Roboto-Bold.woff2") format("woff2");
  font-weight:700;
  font-style:normal;
  font-display:swap;
}

@font-face{
  font-family:"Arsenal";
  src:url("/static/fonts/arsenal/Arsenal-Regular.woff2") format("woff2");
  font-weight:400;
  font-style:normal;
  font-display:swap;
}
@font-face{
  font-family:"Arsenal";
  src:url("/static/fonts/arsenal/Arsenal-Bold.woff2") format("woff2");
  font-weight:700;
  font-style:normal;
  font-display:swap;
}

@font-face{
  font-family:"Playfair Display";
  src:url("/static/fonts/playfair/PlayfairDisplay-Regular.woff2") format("woff2");
  font-weight:400;
  font-style:normal;
  font-display:swap;
}
@font-face{
  font-family:"Playfair Display";
  src:url("/static/fonts/playfair/PlayfairDisplay-Medium.woff2") format("woff2");
  font-weight:500;
  font-style:normal;
  font-display:swap;
}
@font-face{
  font-family:"Playfair Display";
  src:url("/static/fonts/playfair/PlayfairDisplay-Bold.woff2") format("woff2");
  font-weight:700;
  font-style:normal;
  font-display:swap;
}

@font-face{
  font-family:"Inter 18pt";
  src:url("/static/fonts/inter/Inter18pt-Regular.woff2") format("woff2");
  font-weight:400;
  font-style:normal;
  font-display:swap;
}
@font-face{
  font-family:"Inter 18pt";
  src:url("/static/fonts/inter/Inter18pt-Medium.woff2") format("woff2");
  font-weight:500;
  font-style:normal;
  font-display:swap;
}
@font-face{
  font-family:"Inter 18pt";
  src:url("/static/fonts/inter/Inter18pt-Bold.woff2") format("woff2");
  font-weight:700;
  font-style:normal;
  font-display:swap;
}

/* ===== Toast ===== */
#toast-stack{
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2147483647;

  width: min(92vw, 520px);
  display: flex;
  flex-direction: column;
  gap: 8px;

  pointer-events: none;
}

.toast{
  pointer-events: auto;
  width: 100%;
  box-sizing: border-box;

  color: #fff;
  padding: 10px 12px;
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(0,0,0,.25);

  display: flex;
  align-items: center;
  gap: 8px;

  opacity: 1;
  transition: opacity .25s;
}
.toast.show{ opacity:1; transform:none; }
.toast.hiding{ opacity:0; }

.toast.success{ background: var(--success); }
.toast.error{ background: var(--error); }
.toast.warning{ background: var(--warning); }
.toast.info{ background: var(--info); }

.toast .msg{ line-height:1.25; flex:1; }
.toast .close{
  margin-left:auto;
  background:transparent;
  border:0;
  color:inherit;
  font-size:18px;
  line-height:1;
  cursor:pointer;
  opacity:.85;
}
.toast .close:hover{ opacity:1; }

@media (prefers-reduced-motion:reduce){
  .toast{ transition:none; }
}

/* ===== Flash (server-side) ===== */
.flash{
  border-radius: 8px;
  padding: 10px 12px;
  color:#fff;
  margin: 8px 0;
  box-shadow: 0 6px 18px rgba(0,0,0,.18);
}
.flash.success { background: var(--success); }
.flash.error   { background: var(--error); }
.flash.warning { background: var(--warning); }
.flash.info    { background: var(--info); }

/* ===== Media overlay (shared) ===== */
.media-overlay{ position:fixed; inset:0; z-index:2147483600; }
.media-backdrop{ position:fixed; inset:0; background:rgba(0,0,0,.45); }

.media-modal{
  position:fixed;
  top:8%;
  left:50%;
  transform:translateX(-50%);
  width:min(1000px,92vw);
  max-height:84vh;
  display:flex;
  flex-direction:column;
  background:#fff;
  border-radius:10px;
  box-shadow:0 20px 60px rgba(0,0,0,.35);
}
.media-head{
  padding:10px 12px;
  border-bottom:1px solid #e5e7eb;
  display:flex;
  align-items:center;
  gap:8px;
}
.media-title{ font-size:15px; font-weight:700; }
.media-body{ padding:10px; overflow:auto; min-height:240px; }
.media-foot{
  padding:10px;
  border-top:1px solid #e5e7eb;
  display:flex;
  gap:8px;
  justify-content:flex-end;
}

/* ===== Buttons (shared) ===== */
.btn{
  display:inline-flex;
  align-items:center;
  gap:6px;
  border:1px solid transparent;
  padding: 6px 8px;
  border-radius: 6px;
  background:#cccccc;
  color:#111; 
  cursor:pointer;
  font: inherit;
  text-decoration:none;
}
.btn:disabled,
.btn[disabled],
.btn.is-disabled{
  opacity:.6;
  cursor:not-allowed;
  pointer-events:none;
}

.btn-primary{ background:var(--primary); color:#fff; border-color:var(--primary); }
.btn-danger{  background:var(--danger);  color:#fff; border-color:var(--danger);  }
.btn-success{ background:var(--success); color:#fff; border-color:var(--success); }
.btn-light{   background:#cccccc; color:#111; }
.btn-secondary{ background:#cccccc; color:#111;}
.btn-pager{ background:#f8f9fa; color:#111; border-color: var(--text); }

.btn-sm{ padding:4px 8px; font-size:13px; }
.btn-success:hover{ opacity:.9; }

/* ===== Cards (shared) ===== */
.card{
  background:#fff;
  border:1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card-body{ padding: var(--pad); }

/* ===== Forms (shared) ===== */
.form-row{ margin-bottom:12px; }

.form-label{
  display:block;
  margin-bottom:6px;
  font-weight:500;
}

.form-control,
.form-control[type="datetime-local"],
select,
textarea{
  width:100%;
  padding:8px 10px;
  border:1px solid var(--border);
  border-radius:8px;
  background:#fff;
  font: inherit;
  color: inherit;
}

.form-control:focus,
select:focus,
textarea:focus{
  outline:none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.input-group{
  display:flex;
  gap:8px;
  align-items:stretch;
}
.input-group > .form-control{ flex: 1 1 auto; }
.input-group .btn{ white-space:nowrap; }

.help{
  font-size:12px;
  color: var(--muted);
}
.help.error{ color:#b91c1c; }
.help.ok{ color:#059669; }

/* password helper */
.input-password{ position:relative; display:flex; align-items:center; }
.input-password .form-control{ padding-right:42px; }
.pw-toggle{
  position:absolute;
  right:8px;
  top:50%;
  transform:translateY(-50%);
  border:0;
  background:transparent;
  cursor:pointer;
  opacity:.7;
  font-size:16px;
}
.pw-toggle:hover{ opacity:1; }

/* Link-like button helper */
.linklike{
  background:none;
  border:none;
  padding:0;
  cursor:pointer;
  text-decoration:none;
  font: inherit;
}
.linklike:hover{ color: var(--brand); }

/* ===== Pager (shared minimal) ===== */
.pager{ display:flex; justify-content:center; margin:1rem 0; }
.pager-list{ list-style:none; display:flex; gap:.25rem; padding:0; margin:0; align-items:center; }
.pager-item .pager-link{
  display:inline-block;
  padding:.4rem .6rem;
  text-decoration:none;
  color:#222;
  border-radius:.5rem;
}
.pager-item .pager-link:hover{ background-color:#e4e7e7; }
.pager-item.active .pager-link{ background:var(--primary); color:#fff; border-color:var(--primary); }
.pager-item.disabled .pager-link{ opacity:.5; pointer-events:none; }
.pager-ellipsis{ padding:0 .4rem; color:#888; }

/* ===== Layout utility ===== */
.row{
  display:flex;
  gap:16px;
  flex-direction: row;
  flex-wrap: wrap;
}

/* Shared margins */
.mt-2{ margin-top:8px; }
.mt-3{ margin-top:12px; }
.mt-4{ margin-top:16px; }
.mb-2{ margin-bottom:8px; }
.mb-3{ margin-bottom:20px; }
.mb-4{ margin-bottom:16px; }
.me-2{ margin-right:8px; }
.w-100{ width:100%; }

/* Akcija kolona: uvek u jednom redu */
td.actions{
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;     /* ✅ bez prelamanja */
  white-space: nowrap;   /* ✅ tekst ne prelazi u novi red */
}

/* dugmad u akciji da budu “kompaktna” i da ne pucaju */
td.actions .btn{
  white-space: nowrap;
}

/* (opciono) fiksirana sirina kolone akcija */
th.action, td.actions{
  width: 170px;
}

/* ===== Shared G search ===== */
.gsearch{
  --h: 40px;
  --padX: 14px;

  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;

  height: var(--h);
  padding: 0 var(--padX);

  border: 1px solid #dadce0;
  border-radius: 26px;
  background: #fff;
  box-shadow: 0px 3px 10px 0px rgba(31,31,31,0.08);
  transition: box-shadow .15s ease, border-color .15s ease;

  width: 80%;
  max-width: 820px;
  margin: 0 auto 20px;
}
.gsearch:focus-within{
  border-color:#dadce0;
  box-shadow: 0 1px 3px rgba(0,0,0,.08), 0 0 0 3px rgba(66,133,244,.15);
}
.gsearch input{
  flex: 1 1 auto;
  min-width: 0;
  height: calc(var(--h) - 2px);
  border: 0;
  outline: none;
  font: inherit;
  color: #202124;
  background: transparent;
  padding: 0 4px 0 0;
}
.gsearch .gbtn{
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 0;
  background: transparent;
  cursor: pointer;
  border-radius: 50%;
  color: #5f6368;
}
.gsearch .gbtn:hover{ background:#f1f3f4; }

.post-img{  
  width: 100% !important; 
  height: auto !important;
  max-height: 650px;
  object-fit: cover;  
 
}

/* Ако понекад неке слике имају фиксну width из inline style/HTML атрибута 
.post-img img[width] {
  width: auto !important;
}
*/

@media (max-width: 900px){
  .post-img{ max-height: 450px; }
}

/* ===== Dropdown ===== */

.dropbtn {  
  cursor: pointer;
}

/* важи само за dropdown дугме које НИЈЕ bootstrap btn */
.dropbtn:not(.btn){
  background-color:#ffffff;
  color:#000000;
  padding:0;
  border:none;
  cursor:pointer;
}

.dropbtn:not(.btn):hover{
  background-color:#ffffff; /*f2f2f2*/
  /*border-radius:6px;*/
  /*box-shadow:0 0 0 2px rgba(0,0,0,0.08);*/
}

.dropbtn:not(.btn):active{
  transform: translateY(1px);
}


.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown a:hover {background-color: #ddd;}

.dropdown-content{
  display:none;
  position:absolute;
  right: 0;     /* ✅ поравнај десну ивицу са dropbtn */
  left: auto;
  top: 100%;    /* испод дугмета */
  margin-top: 6px;

  background-color:#f1f1f1;
  min-width:160px;
  overflow:auto;
  box-shadow:0px 8px 16px 0px rgba(0,0,0,0.2);
  z-index:1;

  max-height: 60vh;   /* или 50vh за компактније */
  overflow-y: auto;
}

.dropdown.dropup .dropdown-content{
  top: auto;
  bottom: 100%;
  margin-top: 0;
  margin-bottom: 6px;
}

.dropdown-content.show { display: block; }

.dropdown-content a {
  color: black;
  padding: 8px 12px;
  text-decoration: none;
  display: block;
}

.dropdown-content button{
  width:100%;
  text-align:left;
  background:transparent;
  border:0;
  padding:8px 12px;
  cursor:pointer;
  display:block;
}

.dropdown-content button:hover{ background:#ddd; }

.dropdown-content form { margin:0; }

.show {display: block;}

/*Hamburger*/

.hamburger{
  display:none;
  width:44px; height:44px;
  padding:10px;
  border:0;
  background:transparent;
  cursor:pointer;
  border-radius:10px;

  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:5px;
}
.hamburger:focus-visible{ outline:2px solid var(--brand, #111); outline-offset:2px; }
.hamburger span{
  display:block;
  width:24px;
  height:2px;
  background:var(--brand, #111);
  border-radius:2px;
  transform-origin:center;
  transition: transform .2s ease, opacity .15s ease, width .2s ease;
}
.hamburger.is-open span:nth-child(1){ transform: translateY(7px) rotate(45deg); }
.hamburger.is-open span:nth-child(2){ opacity:0; transform: scaleX(.6); }
.hamburger.is-open span:nth-child(3){ transform: translateY(-7px) rotate(-45deg); }


/*nice-table*/

.nice-table-wrap{
  width:100%;
  overflow-x: auto;
  overflow-y: visible;
  /*
  border:1px solid var(--border);
  border-radius: var(--radius);
  background:#fff;
  */
}

.nice-table {
  border-collapse: collapse;
  border-spacing: 0;
  width: 100%;

  /*dn Add*/
  max-width: none;
  min-width: max-content;
  overflow: visible;
}
  .nice-table tr:first-child th {
  border-top: 0;
  }
  .nice-table th:first-child {
  border-left: 0;
  }
  .nice-table tr:first-child th:last-child {
  border-right-color: #5c6785;
  }
  .nice-table th {
  border: 1px solid #ebebeb;
  background-color: #5c6785;
  color: white;
  font-weight: normal;
  padding: 6px 4px;
  }
  .nice-table td {
  border: 1px solid #ebebeb;
  padding: 3px 4px;
  }
  .nice-table td {
  background-color: #e6e6e6;
  border-color: #e5e5e5;
  border-right-color: #ccc;
  color: #444;
  }
  .nice-table td:last-child {
  border-right-color: #e5e5e5;
  }
  .nice-table tr:nth-of-type(even) td {
  background-color: #fff;
  border-right-color: #e5e5e5;
  }
  /* DC table style. */
  .nice-table.spaced-table td,
  .nice-table.spaced-table th {
  padding: 10px;
  }
  .nice-table.wide {
  width: 95%;
  }
  .nice-table.narrow {
  width: 75%;
  }
  .nice-table.narrower {
  width: 50%;
  }
  .nice-table.narrowest {
  width: 35%;
  }
  
  .fw-eq td {
    font-family: "Lucida Console", Consolas, Courier;
    font-weight: 500;
    text-align: center;
    padding: 5px 5px;
  }
  
  /* --------------------------------- */
  .nicehr
  {
    border-color:#ccc; border-style: dotted; border-width: 1px;
  }
  
  /* =========================================================
   Shared media/menu link layout
   - social links
   - admin nav links
   ========================================================= */
.mn-link{
  display:flex;
  align-items:center;
  gap:0;
}

.mn-link .mn-icon{
  width:2.5em;
  min-width:2.5em;
  display:inline-flex;
  justify-content:flex-start;
  align-items:center;
}

.mn-link .mn-label{
  display:inline-block;
  min-width:0;
}

/* optional: tighter variant if needed later */
.mn-link.is-tight .mn-icon{
  width:1.6em;
  min-width:1.6em;
}  