/* ==========================================================================
   VALGKAMP KOORDINATOR - Specifikke Styles
   Disse styles supplerer shared/styles.css
   ========================================================================== */

/* Extra farver til koordinator */
:root {
  --purple: #7c3aed;
  --purple-light: rgba(124, 58, 237, 0.1);
  --purple-hover: #6d28d9;
  --sidebar-w: 260px;
  --sidebar-bg: var(--card);
}

[data-theme="dark"] {
  --purple-light: rgba(124, 58, 237, 0.15);
  --sidebar-bg: #1e1e24;
}

/* ========== LAYOUT ========== */
body {
  overflow: hidden;
  /* Prevent body scroll, handle inside main */
}

.app-layout {
  display: flex;
  height: 100vh;
  width: 100vw;
  background: var(--bg);
}

/* ========== SIDEBAR (Desktop) ========== */
.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 50;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-header {
  padding: 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
}

.app-logo {
  font-size: 24px;
  background: linear-gradient(135deg, var(--accent), var(--purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 900;
  letter-spacing: -1px;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 12px;
  color: var(--muted);
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid transparent;
}

.nav-item:hover {
  background: var(--bg);
  color: var(--text);
}

.nav-item.active {
  background: linear-gradient(90deg, var(--accent-light), transparent);
  color: var(--accent);
  border-left-color: var(--accent);
  font-weight: 700;
}

.nav-item .icon {
  font-size: 18px;
  width: 24px;
  display: flex;
  justify-content: center;
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--border);
}

/* ========== MAIN CONTENT ========== */
.main-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 24px;
  position: relative;
}

.page {
  display: none;
  animation: fadeIn 0.3s ease;
  max-width: 1400px;
  margin: 0 auto;
}

.page.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ========== DASHBOARD GRID ========== */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-2xl, 16px);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.stat-icon {
  position: absolute;
  top: 16px;
  right: 16px;
  font-size: 24px;
  opacity: 0.2;
}

.stat-value {
  font-size: 28px;
  font-weight: 900;
  margin: 8px 0;
  color: var(--text);
}

.stat-label {
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
}

.stat-card.accent {
  border-left: 4px solid var(--accent);
}

.stat-card.success {
  border-left: 4px solid var(--success);
}

.stat-card.warning {
  border-left: 4px solid var(--warning);
}

.stat-card.purple {
  border-left: 4px solid var(--purple);
}

/* ========== WIDGETS ========== */
.dashboard-widgets {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
}

@media (max-width: 1100px) {
  .dashboard-widgets {
    grid-template-columns: 1fr;
  }
}

.widget {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-2xl, 16px);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}

.widget-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 800;
  font-size: 15px;
}

.widget-body {
  padding: 20px;
  flex: 1;
}

/* Chart Styles */
.chart-container {
  height: 200px;
  display: flex;
  align-items: flex-end;
  justify-content: space-around;
  gap: 8px;
  padding-top: 20px;
}

.donut-chart {
  width: 120px;
  height: 120px;
  margin: 0 auto;
  position: relative;
}

.donut-circle {
  fill: none;
  stroke-width: 20;
  stroke: var(--bg);
}

.donut-segment {
  fill: none;
  stroke-width: 20;
  stroke-linecap: round;
  transform: rotate(-90deg);
  transform-origin: 50% 50%;
  transition: stroke-dasharray 0.5s ease;
}

.donut-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}

.donut-text-value {
  font-weight: 900;
  font-size: 24px;
  line-height: 1;
}

.donut-text-label {
  font-size: 11px;
  color: var(--muted);
}

/* Map Widget */
#dashboardMap {
  height: 300px;
  width: 100%;
  border-radius: 12px;
  z-index: 1;
}

/* Budget Widget */
.budget-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.budget-amount {
  font-weight: 800;
  font-size: 18px;
}

.budget-bar {
  height: 10px;
  background: var(--bg);
  border-radius: 5px;
  overflow: hidden;
  margin-bottom: 6px;
}

.budget-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--success), var(--warning));
  border-radius: 5px;
}

/* ========== MOBILE NAV ========== */
.mobile-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--card);
  /* Solid background */
  border-top: 1px solid var(--border);
  padding: 8px 16px;
  z-index: 100;
  justify-content: space-between;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
}

/* Safe area for iPhone X and newer */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .mobile-nav {
    padding-bottom: calc(8px + env(safe-area-inset-bottom));
  }
}


.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  color: var(--muted);
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
}

.mobile-nav-item.active {
  color: var(--accent);
  background: var(--accent-light);
}

.mobile-nav-icon {
  font-size: 20px;
}

/* ========== PRINT STYLES ========== */
@media print {

  .sidebar,
  .mobile-nav,
  .no-print {
    display: none !important;
  }

  .main-content {
    padding: 0;
    overflow: visible;
  }

  body {
    overflow: auto;
    background: white;
  }

  .page {
    display: block !important;
  }

  .stat-card,
  .widget {
    box-shadow: none;
    border: 1px solid #ccc;
    break-inside: avoid;
  }

  .calendar {
    border: 1px solid #ccc;
  }
}

/* ========== RESPONSIVE OVERRIDES ========== */
@media (max-width: 768px) {
  .app-layout {
    flex-direction: column;
  }

  .sidebar {
    display: none;
  }

  .mobile-nav {
    display: flex;
  }

  .main-content {
    padding-bottom: 80px;
  }

  /* Space for mobile nav */
  .dashboard-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* Keep existing styles below for components like calendar, lists etc. */
/* ... Calendar, Shifts, Volunteers styles are inherited from previous versions ... */
.calendar {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}

.calendar-header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.calendar-header-cell {
  padding: 8px;
  text-align: center;
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  color: var(--muted);
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}

.calendar-day {
  min-height: 100px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 4px;
  position: relative;
}

.calendar-day:hover {
  background: var(--bg);
}

.day-number {
  font-weight: 700;
  font-size: 12px;
  margin-bottom: 4px;
}

.event-chip {
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
  margin-bottom: 2px;
  border-left: 2px solid;
  background: rgba(0, 0, 0, 0.05);
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Volunteers List */
.volunteer-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.volunteer-card:hover {
  transform: translateX(2px);
  border-color: var(--accent);
}

.volunteer-avatar {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 16px;
}

/* Shifts List */
.shift-card {
  display: flex;
  gap: 12px;
  padding: 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 12px;
}

.shift-date-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 60px;
  padding: 8px;
  background: var(--bg);
  border-radius: 8px;
}