/* Kidsnooze CMS — ista paleta i font kao aplikacija (apps/mobile/tailwind.config.js). */
:root {
  --bg: #061a59;
  --surface: #142776;
  --surface-deep: #0e1f66;
  --primary: #3134ca;
  --accent: #ffad09;
  --on-accent: #000;
  --text: #fff;
  --muted: rgba(255, 255, 255, 0.65);
  --faint: rgba(255, 255, 255, 0.12);
  --danger: #ff6b6b;
  --ok: #7dffb3;
  --radius-card: 24px;
  --radius-pill: 42px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 "Outfit", system-ui, -apple-system, sans-serif;
}

a { color: var(--accent); }
h1 { font-size: 30px; font-weight: 600; margin: 0; }
h2 { font-size: 17px; font-weight: 600; margin: 0 0 14px; }
small, .muted { color: var(--muted); }

.container { max-width: 1040px; margin: 0 auto; padding: 0 20px 120px; }

/* Gornja traka */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  max-width: 1040px; margin: 0 auto; padding: 18px 20px;
}
.topbar form { margin: 0; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-size: 18px; }
.brand b { color: var(--accent); font-weight: 600; }
.brand-mark {
  display: grid; place-items: center; width: 36px; height: 36px; border-radius: 12px;
  background: var(--primary); font-size: 20px;
}

/* Dugmad — pune pilule */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 46px; padding: 0 22px; border: 0; border-radius: var(--radius-pill);
  background: var(--accent); color: var(--on-accent);
  font: 600 15px "Outfit", system-ui, sans-serif; text-decoration: none; cursor: pointer;
  transition: filter .15s, opacity .15s;
}
.btn:hover { filter: brightness(1.08); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-secondary { background: var(--surface); color: var(--text); }
.btn-ghost { background: transparent; color: var(--text); box-shadow: inset 0 0 0 1px var(--faint); }
.btn-danger { background: transparent; color: var(--danger); box-shadow: inset 0 0 0 1px rgba(255, 107, 107, .35); }
.btn-sm { height: 36px; padding: 0 14px; font-size: 14px; }
.icon-btn {
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  border: 1.5px solid var(--accent); background: transparent; color: var(--accent);
  cursor: pointer; font-size: 14px; flex: none;
}
.icon-btn.playing { background: var(--accent); color: var(--on-accent); }

/* Zaglavlje stranice */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 18px 0 22px; }
.page-head p { margin: 4px 0 0; color: var(--muted); }

.toast {
  display: flex; align-items: center; gap: 10px; margin-bottom: 18px;
  padding: 12px 16px; border-radius: 16px; background: rgba(125, 255, 179, .1); color: var(--ok);
  transition: opacity .4s;
}
.toast.error { background: rgba(255, 107, 107, .12); color: var(--danger); }

/* Filteri */
.toolbar { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.segmented { display: inline-flex; padding: 4px; border-radius: var(--radius-pill); background: var(--surface); }
.segmented button, .segmented label {
  height: 38px; padding: 0 16px; border: 0; border-radius: var(--radius-pill);
  background: transparent; color: var(--text); font: 500 14px "Outfit", sans-serif; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
}
.segmented .active, .segmented input:checked + span { background: var(--accent); color: var(--on-accent); }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented label { padding: 0; }
.segmented label span { display: inline-flex; align-items: center; height: 38px; padding: 0 18px; border-radius: var(--radius-pill); }
.search {
  flex: 1; min-width: 180px; height: 46px; padding: 0 18px; border: 0; border-radius: var(--radius-pill);
  background: var(--surface); color: var(--text); font: 15px "Outfit", sans-serif;
}

/* Lista */
.tracks { display: grid; gap: 10px; }
.track {
  display: flex; align-items: center; gap: 14px; padding: 12px 14px;
  background: var(--surface); border-radius: var(--radius-card);
  transition: box-shadow .3s;
}
.track.highlight { box-shadow: 0 0 0 2px var(--accent); }
.thumb {
  width: 60px; height: 60px; flex: none; border-radius: 16px; object-fit: cover;
  background: var(--surface-deep); display: grid; place-items: center; font-size: 24px; color: var(--muted);
}
.track-main { flex: 1; min-width: 0; }
.track-title { font-size: 17px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 5px; align-items: center; }
.badge {
  display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 11px;
  background: var(--surface-deep); color: var(--muted); font-size: 12px; font-weight: 500;
}
.badge.noise { color: #b9c2ff; }
.badge.premium { background: rgba(255, 173, 9, .15); color: var(--accent); }
.track-actions { display: flex; gap: 8px; align-items: center; }
.empty { text-align: center; padding: 60px 20px; background: var(--surface); border-radius: var(--radius-card); color: var(--muted); }
.empty .big { font-size: 40px; }

/* Forma */
.form-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
@media (max-width: 820px) { .form-grid { grid-template-columns: 1fr; } }
.panel { background: var(--surface); border-radius: var(--radius-card); padding: 22px; }
.panel + .panel { margin-top: 18px; }
.field { margin-bottom: 18px; }
.field:last-child { margin-bottom: 0; }
.field > label, .label { display: block; margin-bottom: 7px; font-weight: 500; }
.hint { display: block; margin-top: 6px; font-size: 13px; color: var(--muted); }
input[type=text], input[type=email], input[type=password], select {
  width: 100%; height: 48px; padding: 0 16px; border: 1.5px solid transparent; border-radius: 16px;
  background: var(--surface-deep); color: var(--text); font: 15px "Outfit", sans-serif; outline: none;
}
input[type=text]:focus, input[type=email]:focus, input[type=password]:focus, select:focus { border-color: var(--primary); }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 22px) 21px, calc(100% - 16px) 21px; background-size: 6px 6px; background-repeat: no-repeat; }

.translations { display: grid; gap: 10px; }
.translation { display: grid; grid-template-columns: 110px 1fr; gap: 10px; align-items: center; }
.translation span { color: var(--muted); font-size: 14px; }
details summary { cursor: pointer; color: var(--accent); margin: 12px 0 10px; font-weight: 500; }

.field > label.switch, .switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; }
.switch input:focus-visible + .track-sw { box-shadow: 0 0 0 2px var(--primary); }
.switch .track-sw { width: 50px; height: 30px; border-radius: 15px; background: rgba(255, 255, 255, .18); position: relative; transition: background .2s; flex: none; }
.switch .track-sw::after { content: ""; position: absolute; top: 4px; left: 4px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform .2s; }
.switch input:checked + .track-sw { background: var(--accent); }
.switch input:checked + .track-sw::after { transform: translateX(20px); background: #000; }

/* Polja za fajlove */
.drop {
  position: relative; display: flex; align-items: center; gap: 14px; padding: 16px;
  border: 1.5px dashed rgba(255, 255, 255, .25); border-radius: 18px; background: var(--surface-deep);
  cursor: pointer; transition: border-color .15s, background .15s;
}
.drop:hover, .drop.over { border-color: var(--accent); background: rgba(255, 173, 9, .06); }
.drop input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop-icon { width: 56px; height: 56px; flex: none; border-radius: 14px; background: var(--surface); display: grid; place-items: center; font-size: 22px; overflow: hidden; }
.drop-icon img { width: 100%; height: 100%; object-fit: cover; }
.drop-text { min-width: 0; }
.drop-text strong { display: block; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.drop-text small { display: block; }
.drop.invalid { border-color: var(--danger); }
audio { width: 100%; margin-top: 12px; height: 40px; }

/* Donja traka s progresom */
.savebar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  background: rgba(6, 26, 89, .92); backdrop-filter: blur(10px); border-top: 1px solid var(--faint);
}
.savebar-inner { max-width: 1040px; margin: 0 auto; padding: 14px 20px; display: flex; align-items: center; gap: 16px; }
.progress { flex: 1; min-width: 0; }
.progress-label { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; color: var(--muted); margin-bottom: 7px; }
.progress-bar { height: 8px; border-radius: 4px; background: var(--surface); overflow: hidden; }
.progress-bar div { height: 100%; width: 0; background: var(--accent); border-radius: 4px; transition: width .2s; }
.progress-bar.indeterminate div { width: 35%; animation: slide 1.1s ease-in-out infinite; }
@keyframes slide { from { transform: translateX(-100%); } to { transform: translateX(300%); } }
.savebar .spacer { flex: 1; }
.form-error { color: var(--danger); font-size: 14px; }

.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Prijava */
.login-page { display: grid; place-items: center; padding: 20px; }
.login-card { width: 100%; max-width: 400px; background: var(--surface); border-radius: var(--radius-card); padding: 32px 28px; }
.login-card .brand { justify-content: center; margin-bottom: 22px; font-size: 22px; }
.login-card .btn { width: 100%; margin-top: 8px; height: 52px; }

@media (max-width: 560px) {
  .track { flex-wrap: wrap; }
  .track-actions { width: 100%; justify-content: flex-end; }
  .translation { grid-template-columns: 1fr; gap: 4px; }
}
