/* ---------------------------------------------------------
   GLOBAL
--------------------------------------------------------- */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, sans-serif;
  background: #000;
  color: #fff;
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
}

:root {
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --tabbar-height: 60px;
  --header-height: 56px;

  /* Fokusfarben */
  --focus-color: #9ca3af;
}

body.focus-zentrale { --focus-color: #9ca3af; }
body.focus-arbeiten { --focus-color: #3b82f6; }
body.focus-freizeit { --focus-color: #ec4899; }
body.focus-unterwegs { --focus-color: #10b981; }
body.focus-schlafen { --focus-color: #6366f1; }
body.focus-nichtstoeren { --focus-color: #8b5cf6; }

/* ---------------------------------------------------------
   APP CONTENT OFFSET
--------------------------------------------------------- */
#app {
  padding-top: calc(var(--header-height) + env(safe-area-inset-top));
  padding-bottom: calc(var(--tabbar-height) + env(safe-area-inset-bottom));
  padding-left: 12px;
  padding-right: 12px;
}

/* ---------------------------------------------------------
   NAVIGATION BAR (iOS‑18)
--------------------------------------------------------- */
.nav-ios {
  position: fixed;
  top: env(safe-area-inset-top);
  left: 0;
  right: 0;
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  background: #111;
  border-bottom: 1px solid #222;
  z-index: 1000;
}

.nav-left span {
  font-size: 18px;
  background: #222;
  padding: 6px 10px;
  border-radius: 12px;
}

.nav-center {
  flex: 1;
  padding-left: 10px;
}

.nav-title {
  font-size: 16px;
  font-weight: 600;
}

.nav-subtitle {
  font-size: 12px;
  opacity: 0.7;
}

.nav-right button {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  font-size: 14px;
}

/* ---------------------------------------------------------
   TABBAR (iOS‑18)
--------------------------------------------------------- */
.tabbar-ios {
  position: fixed;
  bottom: env(safe-area-inset-bottom);
  left: 0;
  right: 0;
  height: var(--tabbar-height);
  display: flex;
  justify-content: space-around;
  align-items: center;
  background: #111;
  border-top: 1px solid #222;
  z-index: 1000;
}

.tabbar-ios button {
  flex: 1;
  background: none;
  border: none;
  color: #fff;
  font-size: 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tabbar-ios button.active {
  color: var(--focus-color);
}

/* ---------------------------------------------------------
   FOKUSBAR
--------------------------------------------------------- */
.focusbar-inner {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 6px 0;
}

.focusbar-inner button {
  flex: 1;
  background: rgba(255,255,255,0.06);
  border-radius: 14px;
  padding: 10px 12px;
  border: 1px solid rgba(255,255,255,0.1);
  color: #fff;
  white-space: nowrap;
}

.focusbar-inner button.active {
  background: var(--focus-color);
  color: #000;
  font-weight: 600;
}

/* ---------------------------------------------------------
   CARDS
--------------------------------------------------------- */
.card {
  background: rgba(255,255,255,0.08);
  backdrop-filter: blur(20px) saturate(180%);
  border-radius: 22px;
  padding: 18px 20px;
  margin: 14px 0;
  border: 1px solid rgba(255,255,255,0.12);
}

.card h3 {
  margin: 0 0 12px 0;
  font-size: 17px;
  font-weight: 600;
  color: var(--focus-color);
}

/* ---------------------------------------------------------
   WIDGET GRID
--------------------------------------------------------- */
.widgets-ios-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 70px;
  gap: 12px;
}

.widget-ios {
  background: rgba(255,255,255,0.08);
  border-radius: 18px;
  padding: 12px;
  border: 1px solid rgba(255,255,255,0.12);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  font-size: 13px;
  backdrop-filter: blur(20px) saturate(180%);
}

.widget-ios-large { grid-column: span 4; grid-row: span 2; }
.widget-ios-medium { grid-column: span 2; grid-row: span 2; }
.widget-ios-small  { grid-column: span 2; grid-row: span 1; }

.widget-title { font-weight: 600; opacity: 0.8; }
.widget-body  { font-size: 16px; }

/* ---------------------------------------------------------
   DASHBOARD
--------------------------------------------------------- */
.dash-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.dash-item {
  background: rgba(255,255,255,0.06);
  border-radius: 18px;
  padding: 14px;
  text-align: center;
  border: 1px solid rgba(255,255,255,0.1);
}

.dash-item-title { font-size: 14px; opacity: 0.8; }
.dash-item-value { font-size: 18px; font-weight: 600; margin-top: 4px; }

/* ---------------------------------------------------------
   BUTTONS
--------------------------------------------------------- */
button {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 16px;
  padding: 10px 14px;
  font-size: 16px;
  color: #fff;
  transition: background .2s ease, border-color .2s ease;
}

button:active {
  background: rgba(255,255,255,0.18);
  border-color: rgba(255,255,255,0.2);
}


/* ---------------------------------------------------------
   CONTROL CENTER OVERLAY (iOS-style)
--------------------------------------------------------- */
.cc-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(12px);
  display: flex;
  justify-content: center;
  align-items: flex-end;
  padding-bottom: 40px;
  z-index: 99999;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
}

.cc-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.cc-panel {
  width: 90%;
  background: rgba(30,30,30,0.85);
  border-radius: 28px;
  padding: 20px;
  border: 1px solid rgba(255,255,255,0.12);
}

body[data-focus="schlafen"] {
  --accent: #445;
  --bg: #111;
}

body[data-focus="nichtstoeren"] {
  --accent: #663;
  --bg: #222;
}

body[data-focus="arbeiten"] {
  --accent: #335;
  --bg: #f0f0f0;
}

body[data-focus="freizeit"] {
  --accent: #355;
  --bg: #fafafa;
}

body[data-focus="unterwegs"] {
  --accent: #553;
  --bg: #fff8e0;
}

body[data-focus="fahren"] {
  --accent: #933;
  --bg: #1a1a1a;
}
