/* ---- Reset & Base ---- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #f4f4f6;
  --bg-card: #ffffff;
  --bg-elevated: #f9f9fb;
  --bg-input: #ffffff;
  --primary: #6366f1;
  --primary-hover: #4f52d9;
  --primary-dim: rgba(99, 102, 241, 0.1);
  --secondary: #8b5cf6;
  --success: #10b981;
  --error: #ef4444;
  --warning: #f59e0b;
  --text: #111827;
  --text-muted: #6b7280;
  --border: #e5e7eb;
  --border-focus: #6366f1;
  --card-bg: #ffffff;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 8px rgba(0, 0, 0, 0.08);
  --transition: 0.15s ease;
}

.hidden {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family:
    "Nunito",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

/* ---- Nav ---- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1.5rem;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav.hidden {
  display: none;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--primary);
  text-decoration: none;
}
.nav-logo {
  width: 28px;
  height: 28px;
  color: var(--primary);
}

.nav-links {
  display: flex;
  gap: 0.25rem;
  margin-left: auto;
}
.nav-link {
  padding: 0.4rem 0.8rem;
  border-radius: 8px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  transition:
    color var(--transition),
    background var(--transition);
}
.nav-link:hover,
.nav-link.active {
  color: var(--text);
  background: var(--bg-elevated);
}
.nav-link.hidden {
  display: none;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-left: 1rem;
}

.badge-offline {
  background: var(--warning);
  color: #000;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 99px;
}
.badge-offline.hidden {
  display: none;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: var(--transition);
}

@media (max-width: 640px) {
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 1rem;
    gap: 0.5rem;
  }
  .nav-links.open {
    display: flex;
  }
  .nav-toggle {
    display: flex;
  }
  .nav-actions {
    margin-left: auto;
  }
}

/* ---- Layout ---- */
#main {
  padding: 1.5rem;
  max-width: 1000px;
  margin: 0 auto;
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.6rem 1.25rem;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
}
.btn-secondary {
  background: var(--secondary);
  color: #fff;
}
.btn-secondary:hover:not(:disabled) {
  background: #7c3aed;
}
.btn-success {
  background: var(--success);
  color: #fff;
}
.btn-danger {
  background: var(--error);
  color: #fff;
}
.btn-danger:hover:not(:disabled) {
  background: #dc2626;
}
.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.btn-ghost:hover:not(:disabled) {
  color: var(--text);
  border-color: var(--primary);
}
.btn-sm {
  padding: 0.35rem 0.8rem;
  font-size: 0.8rem;
}
.btn-lg {
  padding: 0.85rem 2rem;
  font-size: 1rem;
  border-radius: var(--radius);
}
.btn-block {
  width: 100%;
}
.btn-icon {
  padding: 0.5rem;
  aspect-ratio: 1;
  border-radius: 8px;
}

/* ---- Cards ---- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}
.card-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text);
}
.card-sm {
  padding: 1rem;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}
.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}

/* ---- Forms ---- */
.form-group {
  margin-bottom: 1.1rem;
}
.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.form-control {
  width: 100%;
  padding: 0.6rem 0.9rem;
  background: var(--bg-input);
  border: 1.5px solid white;
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.9rem;
  transition:
    border-color var(--transition),
    box-shadow var(--transition);
}
.form-control:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--primary-dim);
}
.form-control::placeholder {
  color: var(--text-muted);
}
select.form-control option {
  background: var(--bg-card);
}
.form-error {
  font-size: 0.8rem;
  color: var(--error);
  margin-top: 0.3rem;
}

.input-group {
  display: flex;
  gap: 0.5rem;
}
.input-group .form-control {
  flex: 1;
}

/* ---- Auth views ---- */
.auth-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 2rem);
  padding: 2rem 1rem;
}
.auth-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.5rem;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow);
}
.auth-logo {
  text-align: center;
  margin-bottom: 2rem;
}
.auth-logo svg {
  width: 56px;
  height: 56px;
  color: var(--primary);
  margin-bottom: 0.75rem;
}
.auth-logo h1 {
  font-size: 1.6rem;
  color: var(--primary);
}
.auth-logo p {
  color: var(--text-muted);
  font-size: 0.9rem;
}
.auth-footer {
  text-align: center;
  margin-top: 1.5rem;
  color: var(--text-muted);
  font-size: 0.875rem;
}
.auth-footer a {
  color: var(--primary);
  text-decoration: none;
}
.auth-footer a:hover {
  text-decoration: underline;
}

/* ---- Dashboard ---- */
.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}
.dashboard-welcome h2 {
  font-size: 1.6rem;
  font-weight: 800;
}
.dashboard-welcome p {
  color: var(--text-muted);
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}
.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--primary-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}
.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.stat-value {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--primary);
}

.section-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.section-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ---- Quiz ---- */
.quiz-container {
  max-width: 700px;
  margin: 0 auto;
}
.quiz-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}
.quiz-progress-bar {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  margin-bottom: 1.5rem;
  overflow: hidden;
}
.quiz-progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 3px;
  transition: width 0.4s ease;
}
.quiz-lives {
  display: flex;
  gap: 0.25rem;
  font-size: 1.2rem;
}
.quiz-timer {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--warning);
  font-variant-numeric: tabular-nums;
}
.quiz-question {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  line-height: 1.5;
}
.quiz-category {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}
.quiz-difficulty {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

.quiz-answers {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.quiz-answer {
  padding: 1rem 1.25rem;
  background: var(--bg-elevated);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: left;
  font-size: 0.95rem;
  color: var(--text);
  transition: all var(--transition);
  width: 100%;
}
.quiz-answer:hover:not(:disabled) {
  border-color: var(--primary);
  background: var(--primary-dim);
}
.quiz-answer.correct {
  border-color: var(--success);
  background: rgba(16, 185, 129, 0.15);
  color: var(--success);
}
.quiz-answer.wrong {
  border-color: var(--error);
  background: rgba(239, 68, 68, 0.15);
  color: var(--error);
}
.quiz-answer:disabled {
  cursor: not-allowed;
}

.quiz-explanation {
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  background: var(--bg-elevated);
  border-left: 3px solid var(--primary);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  color: var(--text-muted);
}
.quiz-result {
  text-align: center;
  padding: 2rem;
}
.quiz-result .result-score {
  font-size: 3rem;
  font-weight: 900;
  color: var(--primary);
}
.quiz-result .result-label {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}
.quiz-result .result-achievements {
  margin-top: 1rem;
}

/* ---- Leaderboard ---- */
.leaderboard-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}
.tab-btn {
  padding: 0.4rem 1rem;
  border-radius: 8px;
  border: 1.5px solid #eef2ff;
  background: #eef2ff;
  color: #6366f1;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 600;
  transition: all var(--transition);
}
.tab-btn:hover {
  background: #e0e7ff;
  border-color: #a5b4fc;
}
.tab-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
}
.leaderboard-table th {
  text-align: left;
  padding: 0.75rem 1rem;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
}
.leaderboard-table td {
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
  vertical-align: middle;
}
.leaderboard-table tr:last-child td {
  border-bottom: none;
}
.leaderboard-table tr:hover td {
  background: var(--bg-elevated);
}
.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-weight: 800;
  font-size: 0.85rem;
}
.rank-1 {
  background: #f59e0b;
  color: #000;
}
.rank-2 {
  background: #94a3b8;
  color: #000;
}
.rank-3 {
  background: #b45309;
  color: #fff;
}
.rank-other {
  background: var(--bg-elevated);
  color: var(--text-muted);
}
.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-block;
  object-fit: cover;
  vertical-align: middle;
  margin-right: 0.5rem;
  background: var(--primary-dim);
}
.user-avatar-img {
  border-radius: 50%;
  object-fit: cover;
  display: block;
  flex-shrink: 0;
  border: 1px solid var(--border);
}

/* ---- Admin ---- */
.admin-toolbar {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}
.admin-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.75rem;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  table-layout: auto;
}

.data-table tr {
  height: 1px; /* omogoči stretch v stolpcu Dejanja */
}
.data-table th {
  text-align: left;
  padding: 0.6rem 0.9rem;
  background: var(--bg-elevated);
  color: var(--text-muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.data-table td {
  padding: 0.75rem 0.9rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  max-width: 300px;
}
.data-table tr:last-child td {
  border-bottom: none;
}
.data-table tr:hover td {
  background: rgba(99, 102, 241, 0.04);
}
.data-table td.actions {
  vertical-align: stretch;
  padding: 0;
  width: 1%;
  max-width: none;
  white-space: nowrap;
}
.data-table td.actions .btn + .btn {
  margin-left: 0.4rem;
}

.data-table .actions-cell {
  display: flex;
  align-items: stretch;
  justify-content: flex-end;
  gap: 0.35rem;
  height: 100%;
  min-height: 100%;
  padding: 0.5rem 0.75rem;
  box-sizing: border-box;
}

.data-table .actions-cell .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: stretch;
  min-height: 2.5rem;
}

.push-admin-intro {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  line-height: 1.5;
}

.admin-push-status {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1rem;
  margin-bottom: 1rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.admin-push-status-detail {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0.35rem 0 0;
  line-height: 1.5;
}

.admin-push-status-warn {
  font-size: 0.8rem;
  color: var(--warning);
  margin: 0.5rem 0 0;
  line-height: 1.45;
  max-width: 52rem;
}

.admin-push-status-warn a {
  color: var(--primary);
}

/* Nastavitve – stikalo (shadcn slog) */
.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.25rem 0 1rem;
  margin-bottom: 0.25rem;
  border-bottom: 1px solid var(--border);
}

.settings-row.is-disabled {
  opacity: 0.65;
}

.settings-row-text {
  flex: 1;
  min-width: 0;
}

.settings-row-label {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 0.2rem;
}

.settings-row-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.45;
  margin: 0;
}

.settings-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
  cursor: pointer;
}

.settings-switch input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}

.settings-switch-slider {
  position: absolute;
  inset: 0;
  background: var(--border);
  border-radius: 999px;
  transition: background 0.2s ease;
  pointer-events: none;
}

.settings-switch-slider::before {
  content: "";
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s ease;
  pointer-events: none;
}

.settings-switch.is-loading {
  opacity: 0.6;
  pointer-events: none;
}

.settings-switch input:checked + .settings-switch-slider {
  background: var(--primary);
}

.settings-switch input:checked + .settings-switch-slider::before {
  transform: translateX(20px);
}

.settings-switch input:disabled + .settings-switch-slider {
  opacity: 0.5;
  cursor: not-allowed;
}

.settings-switch:has(input:disabled) {
  cursor: not-allowed;
}

.settings-switch input:focus-visible + .settings-switch-slider {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.push-rule-form .grid-2-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 560px) {
  .push-rule-form .grid-2-form {
    grid-template-columns: 1fr;
  }
}

.form-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
}

.push-preview-list {
  max-height: 240px;
  overflow-y: auto;
  margin: 1rem 0;
  padding-left: 1.25rem;
  font-size: 0.9rem;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 1.25rem;
}

.difficulty-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.difficulty-fill {
  height: 6px;
  border-radius: 3px;
  background: var(--primary);
  min-width: 4px;
}

/* ---- Profile ---- */
.profile-header {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}
.profile-avatar-large {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--primary-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary);
  flex-shrink: 0;
  overflow: hidden;
}
.profile-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.profile-info h2 {
  font-size: 1.5rem;
  font-weight: 800;
}
.profile-info p {
  color: var(--text-muted);
}
.profile-push-btn {
  margin-left: auto;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition:
    color var(--transition),
    transform var(--transition);
}
.profile-push-btn:hover:not(:disabled) {
  color: var(--primary);
  transform: translateY(-1px);
}
.profile-push-btn.active {
  color: var(--primary);
}
.profile-push-btn.active::after {
  content: "";
  position: absolute;
  right: 0.1rem;
  top: 0.2rem;
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: var(--success);
  border: 2px solid var(--card-bg);
}
.profile-push-btn:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}
.level-badge {
  display: inline-block;
  background: var(--primary-dim);
  color: var(--primary);
  padding: 0.2rem 0.6rem;
  border-radius: 99px;
  font-size: 0.8rem;
  font-weight: 700;
  margin-top: 0.25rem;
}

.achievement-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.achievement-item {
  display: flex;
  gap: 1rem;
  align-items: center;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
}
.achievement-item.locked {
  opacity: 0.45;
}
.achievement-icon {
  font-size: 1.4rem;
}
.achievement-name {
  font-weight: 600;
  font-size: 0.9rem;
}
.achievement-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
}
.avatar-upload-form {
  display: grid;
  grid-template-columns: auto minmax(10rem, 1fr) auto;
  gap: 0.8rem;
  align-items: center;
}
.avatar-file-btn {
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.9rem;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 2.35rem;
  transition:
    border-color var(--transition),
    color var(--transition),
    background var(--transition);
}
.avatar-file-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-dim);
}
.avatar-file-name {
  color: var(--text-muted);
  font-size: 0.85rem;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.avatar-upload-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
}
@media (max-width: 640px) {
  .avatar-upload-form {
    grid-template-columns: 1fr;
    align-items: stretch;
  }
  .avatar-file-btn,
  .avatar-upload-actions {
    width: 100%;
  }
  .avatar-upload-actions .btn {
    flex: 1;
  }
}

.history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.875rem;
}
.history-item:last-child {
  border-bottom: none;
}
.history-date {
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* ---- Modal ---- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 1rem;
  backdrop-filter: blur(4px);
}
.modal-overlay.hidden {
  display: none;
}
.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: var(--shadow);
}
.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.25rem;
  line-height: 1;
}
.modal-close:hover {
  color: var(--text);
}
.modal h2 {
  margin-bottom: 1.5rem;
  font-size: 1.2rem;
}

/* ---- Toast ---- */
#toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  z-index: 300;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  font-size: 0.875rem;
  font-weight: 500;
  pointer-events: auto;
  max-width: 360px;
  animation: slideInRight 0.25s ease;
}
.toast.success {
  border-left: 4px solid var(--success);
}
.toast.error {
  border-left: 4px solid var(--error);
}
.toast.info {
  border-left: 4px solid var(--primary);
}
.toast.warning {
  border-left: 4px solid var(--warning);
}
.toast-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
}
.toast.fade-out {
  animation: fadeOut 0.3s ease forwards;
}

@keyframes slideInRight {
  from {
    transform: translateX(110%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}
@keyframes fadeOut {
  to {
    transform: translateX(110%);
    opacity: 0;
  }
}

/* ---- Shortcuts hint ---- */
.shortcuts-hint {
  position: fixed;
  bottom: 1.5rem;
  left: 1.5rem;
  z-index: 250;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
  min-width: 220px;
}
.shortcuts-hint.hidden {
  display: none;
}
.shortcuts-hint h3 {
  margin-bottom: 0.75rem;
  font-size: 0.95rem;
}
.shortcuts-hint ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1rem;
}
.shortcuts-hint li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}
kbd {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.1rem 0.4rem;
  font-size: 0.75rem;
  font-family: monospace;
  color: var(--text);
  font-weight: 700;
}

/* ---- Misc ---- */
.loading {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 3rem;
  color: var(--text-muted);
}
.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.empty-state {
  text-align: center;
  padding: 3rem;
  color: var(--text-muted);
}
.empty-state .empty-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}
.empty-state p {
  font-size: 0.95rem;
}

.tag {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 99px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
}
.tag-success {
  background: rgba(16, 185, 129, 0.2);
  color: var(--success);
}
.tag-error {
  background: rgba(239, 68, 68, 0.2);
  color: var(--error);
}
.tag-info {
  background: var(--primary-dim);
  color: var(--primary);
}

/* ---- Gesture Control ---- */
.btn-gesture {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  font-size: 1.2rem;
  padding: 0.5rem;
  aspect-ratio: 1;
  border-radius: 8px;
  transition: all var(--transition);
}

.btn-gesture:hover:not(:disabled) {
  color: var(--text);
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.1);
}

.btn-gesture.gesture-active {
  background: rgba(16, 185, 129, 0.2);
  color: var(--success);
  border-color: var(--success);
  animation: pulse-gesture 1s ease-in-out infinite;
}

@keyframes pulse-gesture {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

/* Gesture Canvas */
.gesture-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.5);
  border: 3px solid var(--success);
}

.gesture-canvas.hidden {
  display: none;
}
.tag-warning {
  background: rgba(245, 158, 11, 0.2);
  color: var(--warning);
}

.text-muted {
  color: var(--text-muted);
}
.text-center {
  text-align: center;
}
.mt-1 {
  margin-top: 0.5rem;
}
.mt-2 {
  margin-top: 1rem;
}
.mb-2 {
  margin-bottom: 1rem;
}
.flex {
  display: flex;
}
.flex-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.gap-1 {
  gap: 0.5rem;
}
.gap-2 {
  gap: 1rem;
}
.w-full {
  width: 100%;
}

.push-section {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1rem;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
}

.form-control-reg {
  width: 100%;
  padding: 0.6rem 0.9rem;
  background: #f9faff;
  border: 1.5px solid #f9faff;
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.9rem;
  transition:
    border-color var(--transition),
    box-shadow var(--transition);
}
.form-control-reg:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-dim);
}
.form-control-reg::placeholder {
  color: var(--text-muted);
}

/* ============================================================
   Floating glasovni help gumb + bottom sheet panel
   ============================================================ */

.voice-help-fab {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 1.2rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.35);
  z-index: 902;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    transform 0.15s,
    box-shadow 0.15s;
  line-height: 1;
}
.voice-help-fab:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.45);
}
.voice-help-fab.hidden {
  display: none;
}

/* Bottom sheet panel — mobilni: polna širina, animiran od spodaj */
.voice-help-panel {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--card-bg);
  border-top: 1px solid var(--border);
  border-radius: 20px 20px 0 0;
  padding: 0.5rem 1.5rem 2rem; /* 2rem spodaj za iOS safe area */
  box-shadow: 0 -4px 32px rgba(0, 0, 0, 0.18);
  z-index: 901;
  transform: translateY(100%); /* skrit pod zaslonom */
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  max-height: 60vh;
  overflow-y: auto;
  font-size: 0.9rem;
}
/* Povleci ročaj */
.voice-help-panel::before {
  content: "";
  display: block;
  width: 40px;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin: 0.75rem auto 1rem;
}
.voice-help-panel.open {
  transform: translateY(0);
}
.voice-help-panel.hidden {
  display: none; /* ko ni prijavljen */
}
.voice-help-panel ul {
  margin: 0;
  padding-left: 1.1rem;
}
.voice-help-panel li {
  margin-bottom: 0.4rem;
  line-height: 1.45;
}

/* Na večjih zaslonih: centriran blok, ne polna širina */
@media (min-width: 640px) {
  .voice-help-panel {
    left: 50%;
    right: auto;
    width: min(600px, 100%);
    transform: translateX(-50%) translateY(100%);
    border-radius: 20px 20px 0 0;
  }
  .voice-help-panel.open {
    transform: translateX(-50%) translateY(0);
  }
}

/* PWA Install banner */
.install-banner {
  position: fixed;
  bottom: 4.5rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--card-bg);
  border: 1.5px solid var(--primary);
  border-radius: 12px;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.22);
  z-index: 950;
  font-size: 0.88rem;
  font-weight: 500;
  width: calc(100% - 2rem);
  max-width: 460px;
  animation: slideUp 0.3s ease;
}
@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}
.locked-input,
.locked-input:disabled {
  background: #eef1f7;
  border-color: var(--border);
  color: var(--text-muted);
  cursor: not-allowed;
  opacity: 1;
}
