*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #f5f4f0;
  --surface: #ffffff;
  --border: #e2e0d8;
  --text: #1a1916;
  --text-muted: #8a8880;
  --accent: #d81b60;
  --mono: 'DM Mono', monospace;
  --sans: 'Syne', sans-serif;
  --shadow: 0 2px 16px rgba(0,0,0,0.08);
  --radius: 12px;
}

html, body { height: 100%; background: var(--bg); color: var(--text); font-family: var(--sans); }

/* ── HEADER ── */
header { display: flex; align-items: center; justify-content: space-between; padding: 18px 32px; background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 100; }
.logo { font-size: 17px; font-weight: 800; letter-spacing: -0.5px; display: flex; align-items: center; gap: 8px; }
.logo-dot { width: 10px; height: 10px; background: var(--accent); border-radius: 50%; display: inline-block; animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 0%,100% { transform: scale(1); opacity:1; } 50% { transform: scale(1.3); opacity:0.7; } }
.logo-sub { font-size: 11px; font-family: var(--mono); color: var(--text-muted); font-weight: 400; }
.header-tag { font-family: var(--mono); font-size: 11px; background: #f0ede4; padding: 4px 10px; border-radius: 20px; color: var(--text-muted); }

/* ── MAIN LAYOUT ── */
main { display: grid; grid-template-columns: 320px 1fr; min-height: calc(100vh - 61px); }

/* ── SIDEBAR ── */
aside { background: var(--surface); border-right: 1px solid var(--border); padding: 24px 20px; display: flex; flex-direction: column; gap: 28px; overflow-y: auto; }
.section-label { font-family: var(--mono); font-size: 10px; letter-spacing: 1.5px; color: var(--text-muted); text-transform: uppercase; margin-bottom: 10px; }

.platform-grid { display: flex; flex-direction: column; gap: 6px; }

.platform-btn { 
  display: flex; 
  align-items: center; 
  gap: 12px; 
  padding: 12px 14px; 
  border-radius: 10px; 
  border: 1.5px solid var(--border); 
  background: transparent; 
  cursor: pointer; 
  transition: all 0.15s ease; 
  font-family: var(--sans); 
  text-align: left; 
  width: 100%; 
}

.platform-btn:hover { border-color: var(--text); background: #fafaf7; }

.platform-btn.active { 
  border-color: var(--text); 
  background: var(--text); 
  color: #fff; 
}

.platform-btn.active .plat-meta { color: rgba(255,255,255,0.55); }

/* IKONICA I SVG */
.plat-icon { 
  width: 34px; 
  height: 34px; 
  border-radius: 8px; 
  background: #f0ede4; 
  color: #000; 
  display: flex; 
  align-items: center; 
  justify-content: center; 
  flex-shrink: 0; 
}

.plat-icon svg {
  width: 20px;   
  height: 20px;
  display: block;
  transition: transform 0.2s ease;
}

/* STANJE KADA JE AKTIVNO */
.platform-btn.active .plat-icon {
  background: transparent;
  color: #fff;
}

.platform-btn.active .plat-icon svg {
  transform: scale(1.1);
}

.plat-info { flex: 1; }
.plat-name { font-size: 14px; font-weight: 700; }
.plat-meta { font-family: var(--mono); font-size: 10px; color: var(--text-muted); margin-top: 2px; }

/* ── SLIDER ── */
.slider-wrap { display: flex; flex-direction: column; gap: 8px; }
.slider-row { display: flex; align-items: center; gap: 10px; }
.slider-val { font-family: var(--mono); font-size: 12px; min-width: 32px; text-align: right; color: var(--text-muted); }
input[type=range] { -webkit-appearance: none; flex: 1; height: 4px; background: var(--border); border-radius: 2px; outline: none; cursor: pointer; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%; background: var(--text); cursor: pointer; }

/* ── LEGEND & INFO ── */
.legend { display: flex; flex-direction: column; gap: 8px; }
.legend-item { display: flex; align-items: center; gap: 10px; font-size: 12px; }
.legend-color { width: 16px; height: 16px; border-radius: 4px; flex-shrink: 0; }
.info-box { background: #fafaf7; border: 1px solid var(--border); border-radius: 10px; padding: 14px; font-size: 12px; font-family: var(--mono); color: var(--text-muted); line-height: 1.6; }

/* ── PREVIEW AREA ── */
.preview-area { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; padding: 40px 32px; gap: 24px; background: var(--bg); overflow-y: auto; }
.preview-top { width: 100%; max-width: 800px; display: flex; align-items: center; justify-content: space-between; }
.preview-title { font-size: 22px; font-weight: 400; letter-spacing: -0.5px; }
.preview-platform-tag { font-family: var(--mono); font-size: 11px; padding: 5px 12px; border-radius: 20px; background: var(--text); color: #fff; letter-spacing: 0.3px; }

/* ── UPLOAD ZONE ── */
#upload-zone { height: 65vh; min-height: 400px; max-height: 700px; aspect-ratio: 9/16; width: auto; margin: 0 auto; background: var(--surface); border: 2px dashed var(--border); border-radius: var(--radius); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; cursor: pointer; transition: all 0.2s; position: relative; }
#upload-zone:hover, #upload-zone.dragover { border-color: var(--text); background: #fafaf7; }
.upload-icon { font-size: 40px; opacity: 0.3; }
.upload-text { font-size: 15px; font-weight: 700; text-align: center; }
.upload-sub { font-family: var(--mono); font-size: 11px; color: var(--text-muted); text-align: center; }
.upload-btn { padding: 10px 22px; background: var(--text); color: #fff; border: none; border-radius: 8px; font-family: var(--sans); font-size: 13px; font-weight: 700; cursor: pointer; }
#file-input { display: none; }

/* ── MEDIA CONTAINER ── */
#video-container { display: none; position: relative; height: 65vh; min-height: 400px; max-height: 700px; width: auto; margin: 0 auto; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); background: #000; }
#video-container.active { display: block; }
#main-video, #main-image { width: 100%; height: 100%; object-fit: cover; display: block; cursor: pointer; }

/* ── CANVAS ── */
#overlay-canvas { position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; transition: opacity 0.3s; }

/* ── VIDEO CONTROLS ── */
.video-controls { display: flex; align-items: center; gap: 12px; width: 100%; max-width: 800px; }
.ctrl-btn { width: 38px; height: 38px; border-radius: 8px; border: 1.5px solid var(--border); background: var(--surface); display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 15px; flex-shrink: 0; }
.ctrl-btn:hover { border-color: var(--text); background: var(--text); color: #fff; }
.progress-wrap { flex: 1; height: 38px; display: flex; align-items: center; cursor: pointer; position: relative; }
#progress-bar { width: 100%; height: 4px; background: var(--border); border-radius: 2px; }
#progress-fill { height: 100%; background: var(--text); border-radius: 2px; width: 0%; pointer-events: none; }
.time-display { font-family: var(--mono); font-size: 11px; color: var(--text-muted); min-width: 80px; text-align: right; }
.speed-btns { display: flex; gap: 4px; }
.speed-btn {
  height: 38px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.speed-btn:hover { border-color: var(--text); color: var(--text); }
.speed-btn.active { background: var(--text); border-color: var(--text); color: #fff; }

/* ── DIMENSIONS CHIPS (CENTRIRANO, TANJI FONT) ── */
.dimensions-bar { width: 100%; max-width: 800px; display: flex; gap: 12px; flex-wrap: wrap; margin-top: 8px; justify-content: center; }
.dim-chip { font-family: var(--mono); font-size: 11px; padding: 6px 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; color: var(--text-muted); }
.dim-chip span { color: var(--text); font-weight: 500; } /* Lakši, čitljiviji font */

/* ── ACTION BUTTONS ── */
.action-buttons {
  display: none; 
  align-items: center;
  justify-content: center;
  gap: 16px;
  width: 100%;
  max-width: 800px;
  margin-top: 8px;
}

.action-buttons.active { display: flex; }

.btn-export { 
  background: var(--text); 
  color: #fff; 
  border: 1.5px solid transparent; 
  border-radius: 8px; 
  padding: 0 24px; /* Zadržavamo samo horizontalni padding */
  height: 44px; /* Fiksna visina */
  font-family: var(--sans); 
  font-size: 14px; 
  font-weight: 700; 
  cursor: pointer; 
  display: flex; 
  align-items: center; 
  justify-content: center; /* Dodato za svaki slučaj */
  gap: 8px; 
  transition: opacity 0.2s; 
  box-shadow: 0 4px 12px rgba(0,0,0,0.15); 

}.btn-export:hover { opacity: 0.85; }

.btn-close { 
  background: var(--surface); 
  border: 1.5px solid var(--border); 
  border-radius: 8px; 
  padding: 0 20px; /* Zadržavamo samo horizontalni padding */
  height: 44px; /* Ista fiksna visina */
  font-family: var(--sans); 
  font-size: 14px; 
  font-weight: 600; 
  cursor: pointer; 
  color: var(--text); 
  display: flex; 
  align-items: center; 
  justify-content: center; /* Dodato za svaki slučaj */
  gap: 8px; 
  transition: all 0.15s; 

}.btn-close:hover { border-color: var(--text); background: var(--bg); }

/* ── SEO ACCORDION ── */
.seo-section { background: var(--surface); border-top: 1px solid var(--border); padding: 40px 32px; }
.seo-section h2 { font-size: 13px; font-weight: 800; letter-spacing: -0.3px; margin-bottom: 20px; color: var(--text-muted); text-transform: uppercase; font-family: var(--mono); }
.accordion { display: flex; flex-direction: column; gap: 8px; max-width: 900px; margin: 0 auto; }
.accordion-item { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.accordion-trigger { width: 100%; background: none; border: none; padding: 16px 20px; display: flex; align-items: center; justify-content: space-between; cursor: pointer; font-family: var(--sans); font-size: 14px; font-weight: 700; color: var(--text); text-align: left; }
.accordion-trigger:hover { background: #fafaf7; }
.accordion-arrow { font-family: var(--mono); font-size: 12px; color: var(--text-muted); transition: transform 0.2s; flex-shrink: 0; }
.accordion-item.open .accordion-arrow { transform: rotate(180deg); }
.accordion-body { display: none; padding: 0 20px 18px; font-size: 13px; line-height: 1.75; color: var(--text-muted); }
.accordion-body p { margin-bottom: 10px; }
.accordion-body p:last-child { margin-bottom: 0; }
.accordion-item.open .accordion-body { display: block; }

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  header { padding: 14px 16px; }
  .header-tag { display: none; }

  main { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }

  aside {
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 16px;
    flex-direction: column;
    gap: 16px;
    overflow-x: visible;
    overflow-y: visible;
    align-items: stretch;
  }

  aside > div { flex-shrink: 0; min-width: unset; }
  aside > div:first-child { min-width: unset; }
  .info-box#platform-info { display: none; }
  aside > div:has(.legend) { display: none; }

  .preview-area { padding: 20px 16px; gap: 16px; }
  .preview-title { font-size: 16px; }

  #upload-zone {
    height: 55vw;
    min-height: 260px;
    max-height: 420px;
    aspect-ratio: unset;
    width: 100%;
  }

  #video-container {
    height: auto !important;
    min-height: unset;
    max-height: unset;
    width: 100%;
  }

  .video-controls { flex-wrap: wrap; gap: 8px; }
  .progress-wrap { order: 2; width: 100%; flex-basis: 100%; }
  .ctrl-btn { order: 1; }
  .time-display { order: 3; }
  .speed-btns { order: 4; }

  .dimensions-bar { gap: 8px; justify-content: flex-start; }

  .action-buttons { flex-direction: column; gap: 10px; }
  .btn-export, .btn-close { width: 100%; }

  .seo-section { padding: 28px 16px; }
}

/* ── FOOTER ── */
footer {
  background: var(--text);
  color: rgba(255,255,255,0.5);
  padding: 28px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-family: var(--mono);
  font-size: 11px;
}

.footer-copy { display: flex; align-items: center; gap: 8px; }
.footer-dot { width: 6px; height: 6px; background: var(--accent); border-radius: 50%; flex-shrink: 0; }
.footer-mail { 
  color: rgba(255,255,255,0.5); 
  text-decoration: none; 
  border-bottom: 1px solid rgba(255,255,255,0.15);
  padding-bottom: 1px;
  transition: color 0.15s, border-color 0.15s;
}
.footer-mail:hover { color: #fff; border-color: rgba(255,255,255,0.6); }

@media (max-width: 768px) {
  footer { padding: 20px 16px; flex-direction: column; align-items: flex-start; gap: 10px; }
}