/* ============================================================
   NasDvoje — Mobile-first CSS
   ============================================================ */

/* CSS varijable — tema */
:root {
  --user1:       #3B82F6;   /* plava — korisnik 1 */
  --user1-light: #EFF6FF;
  --user2:       #EF4444;   /* crvena — korisnik 2 */
  --user2-light: #FEF2F2;

  --primary:     #6C63FF;
  --primary-dark:#5A52D5;
  --bg:          #F8F9FA;
  --surface:     #FFFFFF;
  --border:      #E5E7EB;
  --text:        #1F2937;
  --text-muted:  #6B7280;

  --radius:      12px;
  --radius-sm:   8px;
  --shadow:      0 2px 8px rgba(0,0,0,0.08);
  --shadow-lg:   0 8px 24px rgba(0,0,0,0.12);

  --header-h:    56px;
  --nav-h:       64px;
}

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

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 16px;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

#app {
  display: flex;
  flex-direction: column;
  height: 100dvh;
}

/* ---- Header ---- */
.app-header {
  height: var(--header-h);
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(108,99,255,0.3);
  z-index: 10;
}

.app-header h1 {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.app-header .header-actions {
  display: flex;
  gap: 8px;
}

.btn-icon {
  background: rgba(255,255,255,0.15);
  border: none;
  border-radius: 8px;
  color: #fff;
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-size: 1.1rem;
  transition: background 0.15s;
}
.btn-icon:active { background: rgba(255,255,255,0.25); }

/* ---- Main content ---- */
.app-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 16px;
  padding-bottom: calc(var(--nav-h) + 16px);
}

/* ---- Bottom nav ---- */
.app-nav {
  height: var(--nav-h);
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: stretch;
  flex-shrink: 0;
  z-index: 10;
  box-shadow: 0 -2px 8px rgba(0,0,0,0.06);
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  cursor: pointer;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.7rem;
  transition: color 0.15s;
  padding: 8px 4px;
}

.nav-item .nav-icon { font-size: 1.4rem; line-height: 1; }
.nav-item span:last-child { font-weight: 500; }

.nav-item.active {
  color: var(--primary);
}

.nav-item.active .nav-icon {
  transform: translateY(-2px);
  transition: transform 0.15s;
}

/* ---- Cards & surfaces ---- */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  margin-bottom: 12px;
}

.card-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  border: none;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: filter 0.15s, transform 0.1s;
}

.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover { filter: brightness(1.05); }

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text);
}

.btn-danger {
  background: #FEE2E2;
  color: #DC2626;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
}

.btn-full { width: 100%; }

/* ---- Form elements ---- */
.input, .select, .textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  color: var(--text);
  background: var(--surface);
  outline: none;
  transition: border-color 0.15s;
}

.input:focus, .select:focus, .textarea:focus {
  border-color: var(--primary);
}

.input-group {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.input-group .input { flex: 1; }

.form-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 5px;
  display: block;
}

/* ---- User color chips ---- */
.chip-user1 {
  background: var(--user1-light);
  color: var(--user1);
  border-radius: 20px;
  padding: 2px 10px;
  font-size: 0.78rem;
  font-weight: 600;
}

.chip-user2 {
  background: var(--user2-light);
  color: var(--user2);
  border-radius: 20px;
  padding: 2px 10px;
  font-size: 0.78rem;
  font-weight: 600;
}

.chip-shared {
  background: #EDE9FF;
  color: var(--primary);
  border-radius: 20px;
  padding: 2px 10px;
  font-size: 0.78rem;
  font-weight: 600;
}

/* ---- Kalendar ---- */
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.cal-day-name {
  text-align: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  padding: 6px 0;
  text-transform: uppercase;
}

.cal-day {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 4px 2px 2px;
  border-radius: 8px;
  cursor: pointer;
  position: relative;
  font-size: 0.85rem;
  transition: background 0.1s;
  min-height: 42px;
}

.cal-day:hover { background: var(--bg); }
.cal-day.today { background: #EDE9FF; font-weight: 700; color: var(--primary); }
.cal-day.other-month { opacity: 0.35; }
.cal-day.holiday .cal-day-num { color: #DC2626; }

.cal-dots {
  display: flex;
  gap: 2px;
  margin-top: 2px;
  flex-wrap: wrap;
  justify-content: center;
}

.cal-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
}

.cal-dot.user1   { background: var(--user1); }
.cal-dot.user2   { background: var(--user2); }
.cal-dot.shared  { background: var(--primary); }

.cal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.cal-month-title {
  font-size: 1rem;
  font-weight: 700;
}

/* ---- Event list ---- */
.event-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.event-item:last-child { border-bottom: none; }

.event-bar {
  width: 4px;
  min-height: 40px;
  border-radius: 4px;
  flex-shrink: 0;
}

.event-bar.user1   { background: var(--user1); }
.event-bar.user2   { background: var(--user2); }
.event-bar.shared  { background: var(--primary); }

.event-info { flex: 1; }
.event-title { font-weight: 600; font-size: 0.9rem; }
.event-meta { font-size: 0.78rem; color: var(--text-muted); margin-top: 2px; }

.event-actions { display: flex; gap: 4px; }

/* ---- Shopping lista ---- */
.shop-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
  transition: opacity 0.2s;
}

.shop-item:last-child { border-bottom: none; }

.shop-item.checked {
  opacity: 0.5;
}

.shop-item.checked .shop-name {
  text-decoration: line-through;
  color: var(--text-muted);
}

.shop-checkbox {
  width: 22px; height: 22px;
  border-radius: 6px;
  border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s, border-color 0.15s;
}

.shop-checkbox.checked {
  background: var(--text-muted);
  border-color: var(--text-muted);
  color: #fff;
}

.shop-info { flex: 1; min-width: 0; }
.shop-name { font-size: 0.92rem; font-weight: 500; }
.shop-meta { font-size: 0.75rem; color: var(--text-muted); }

/* ---- Troškovi ---- */
.expense-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.expense-item:last-child { border-bottom: none; }

.expense-icon {
  width: 38px; height: 38px;
  border-radius: 10px;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.expense-info { flex: 1; }
.expense-desc { font-weight: 500; font-size: 0.9rem; }
.expense-meta { font-size: 0.75rem; color: var(--text-muted); margin-top: 1px; }

.expense-amount {
  font-weight: 700;
  font-size: 0.95rem;
}

.expense-amount.user1 { color: var(--user1); }
.expense-amount.user2 { color: var(--user2); }

/* Summary box */
.summary-box {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border-radius: var(--radius);
  padding: 16px;
  color: #fff;
  margin-bottom: 12px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.summary-item { text-align: center; }
.summary-label { font-size: 0.72rem; opacity: 0.8; margin-bottom: 4px; }
.summary-value { font-size: 1.2rem; font-weight: 700; }

/* ---- Modal / bottom sheet ---- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 100;
  display: flex;
  align-items: flex-end;
}

.modal-sheet {
  background: var(--surface);
  border-radius: 20px 20px 0 0;
  padding: 20px 16px 32px;
  width: 100%;
  max-height: 90dvh;
  overflow-y: auto;
  animation: slideUp 0.25s ease;
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}

.modal-handle {
  width: 40px; height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin: 0 auto 16px;
}

.modal-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 16px;
}

/* ---- Toggle / segmented ---- */
.segment {
  display: flex;
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 3px;
  gap: 2px;
  margin-bottom: 14px;
}

.segment-btn {
  flex: 1;
  padding: 8px 6px;
  border: none;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  background: transparent;
  color: var(--text-muted);
  transition: all 0.15s;
}

.segment-btn.active {
  background: var(--surface);
  color: var(--primary);
  box-shadow: var(--shadow);
}

/* ---- Tabs za liste ---- */
.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }

.tab-btn {
  flex-shrink: 0;
  padding: 6px 14px;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  background: transparent;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.15s;
}

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

/* ---- Utils ---- */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mb-8 { margin-bottom: 8px; }
.text-muted { color: var(--text-muted); font-size: 0.85rem; }
.text-center { text-align: center; }
.empty-state { text-align: center; padding: 32px 16px; color: var(--text-muted); }
.empty-state .empty-icon { font-size: 2.5rem; margin-bottom: 8px; }

/* Vue transitions */
.fade-enter-active, .fade-leave-active { transition: opacity 0.2s; }
.fade-enter-from, .fade-leave-to { opacity: 0; }

.slide-enter-active, .slide-leave-active { transition: all 0.25s; }
.slide-enter-from { transform: translateY(20px); opacity: 0; }
.slide-leave-to { transform: translateY(-10px); opacity: 0; }
