/* ══════════════════════════════════════════════════════════════════
   ChevalTools Shell — Shared Navigation Shell
   Covers: top-nav, drawer, bottom-tab-bar, FAB, bottom-spacer
   ══════════════════════════════════════════════════════════════════ */

/* ── Design Tokens ────────────────────────────────────────────────── */
:root {
  --ct-primary:       #1a365d;
  --ct-primary-light: #2c5282;
  --ct-accent:        #38a169;
  --ct-accent-light:  #68d391;
  --ct-accent-dark:   #2f855a;
  --ct-accent-soft:   rgba(56,161,105,0.10);
  --ct-warm:          #ed8936;
  --ct-warm-soft:     rgba(237,137,54,0.10);
  --ct-danger:        #e53e3e;
  --ct-danger-soft:   rgba(229,62,62,0.10);
  --ct-surface:       #ffffff;
  --ct-surface-sunken:#f1f5f9;
  --ct-text:          #1a202c;
  --ct-text-body:     #4a5568;
  --ct-text-muted:    #718096;
  --ct-border:        #e2e8f0;
  --ct-border-strong: #cbd5e0;
  --ct-shadow-xs:     0 1px 2px rgba(0,0,0,0.04);
  --ct-shadow-sm:     0 1px 3px rgba(0,0,0,0.04), 0 2px 8px rgba(0,0,0,0.03);
  --ct-shadow-md:     0 2px 8px rgba(0,0,0,0.06), 0 4px 16px rgba(0,0,0,0.04);
  --ct-font-display:  'Outfit', -apple-system, system-ui, sans-serif;
  --ct-font-body:     'Plus Jakarta Sans', -apple-system, system-ui, sans-serif;
  --ct-nav-h:         56px;
  --ct-tab-h:         64px;
  --ct-sa-bottom:     env(safe-area-inset-bottom, 0px);
  --ct-sa-top:        env(safe-area-inset-top, 0px);
}

/* ── Resets ───────────────────────────────────────────────────────── */
#ct-shell *, #ct-shell *::before, #ct-shell *::after {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}
#ct-shell a { text-decoration: none; }
#ct-shell button { font-family: inherit; cursor: pointer; }

/* ── Top Navigation ───────────────────────────────────────────────── */
.ct-top-nav {
  position: sticky;
  top: 0;
  z-index: 500;
  padding-top: var(--ct-sa-top);
  background: color-mix(in srgb, #fff 88%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--ct-border);
}
.ct-top-nav-inner {
  height: var(--ct-nav-h);
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 12px;
  max-width: 1200px;
  margin: 0 auto;
}
.ct-top-nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  text-decoration: none;
}
.ct-top-nav-logo {
  width: 32px; height: 32px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--ct-primary), var(--ct-primary-light));
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 14px; flex-shrink: 0;
}
.ct-top-nav-title {
  font-family: var(--ct-font-display);
  font-weight: 800;
  font-size: 17px;
  color: var(--ct-text);
  letter-spacing: -0.3px;
}
.ct-top-nav-links {
  display: none;
  gap: 24px;
  align-items: center;
}
@media (min-width: 768px) {
  .ct-top-nav-links { display: flex; }
}
.ct-top-nav-link {
  font-size: 14px;
  font-weight: 600;
  color: var(--ct-text-muted);
  padding: 4px 0;
  transition: color .15s;
  text-decoration: none;
}
.ct-top-nav-link:hover { color: var(--ct-text); }
.ct-top-nav-link.is-active {
  color: var(--ct-text);
  border-bottom: 2px solid var(--ct-accent);
}
.ct-top-nav-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
.ct-avatar-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--ct-accent), var(--ct-accent-dark));
  border: none;
  color: #fff;
  font-family: var(--ct-font-display);
  font-weight: 700;
  font-size: 13px;
  display: flex; align-items: center; justify-content: center;
  transition: opacity .15s;
  text-decoration: none;
  flex-shrink: 0;
  cursor: pointer;
  overflow: hidden;
  padding: 0;
}
.ct-avatar-btn:hover { opacity: .9; color: #fff; }
.ct-burger-btn {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: var(--ct-surface);
  border: 1px solid var(--ct-border);
  color: var(--ct-text);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px;
  box-shadow: var(--ct-shadow-xs);
}
@media (min-width: 768px) {
  .ct-burger-btn { display: none; }
}

/* ── Drawer ───────────────────────────────────────────────────────── */
.ct-drawer-scrim {
  display: none;
  position: fixed; inset: 0;
  z-index: 600;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(2px);
}
.ct-drawer-scrim.is-open {
  display: block;
  animation: ct-scrim-in .2s ease;
}
@keyframes ct-scrim-in { from { opacity: 0; } to { opacity: 1; } }

.ct-drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  z-index: 610;
  width: min(320px, 88vw);
  background: var(--ct-surface);
  box-shadow: -8px 0 32px rgba(0,0,0,0.14);
  display: flex; flex-direction: column;
  transform: translateX(100%);
  transition: transform .25s cubic-bezier(.2,.8,.2,1);
  padding-top: var(--ct-sa-top);
  padding-bottom: var(--ct-sa-bottom);
}
.ct-drawer.is-open { transform: translateX(0); }

.ct-drawer-head {
  height: var(--ct-nav-h);
  display: flex; align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  border-bottom: 1px solid var(--ct-border);
}
.ct-drawer-title {
  font-family: var(--ct-font-display);
  font-weight: 800;
  font-size: 17px;
  color: var(--ct-text);
  letter-spacing: -0.3px;
}
.ct-drawer-close {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: var(--ct-surface-sunken);
  border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--ct-text); font-size: 15px;
}

.ct-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px 8px;
}
.ct-drawer-nav-item {
  display: flex; align-items: center;
  gap: 14px;
  padding: 13px 12px;
  border-radius: 12px;
  color: var(--ct-text-body);
  font-size: 15px;
  font-weight: 600;
  font-family: var(--ct-font-body);
  transition: background .12s, color .12s;
  min-height: 48px;
  text-decoration: none;
}
.ct-drawer-nav-item:hover {
  background: var(--ct-surface-sunken);
  color: var(--ct-text);
}
.ct-drawer-nav-item.is-active {
  background: var(--ct-accent-soft);
  color: var(--ct-accent);
}
.ct-drawer-nav-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px;
}
.ct-drawer-divider {
  height: 1px;
  background: var(--ct-border);
  margin: 8px 12px;
}
.ct-drawer-foot {
  padding: 12px 8px;
  border-top: 1px solid var(--ct-border);
}
.ct-drawer-logout {
  display: flex; align-items: center;
  gap: 14px;
  padding: 13px 12px;
  border-radius: 12px;
  width: 100%;
  background: none; border: none; cursor: pointer;
  color: var(--ct-danger);
  font-size: 15px; font-weight: 600;
  font-family: var(--ct-font-body);
  min-height: 48px;
  transition: background .12s;
}
.ct-drawer-logout:hover { background: var(--ct-danger-soft); }

/* ── FAB ──────────────────────────────────────────────────────────── */
.ct-fab {
  position: fixed;
  right: 20px;
  bottom: calc(var(--ct-tab-h) + var(--ct-sa-bottom) + 18px);
  width: 56px; height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--ct-accent), var(--ct-accent-dark));
  color: #fff; border: none;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  box-shadow: 0 10px 24px rgba(56,161,105,0.40), 0 2px 6px rgba(0,0,0,0.10);
  z-index: 50;
  transition: transform .15s ease;
  text-decoration: none;
}
.ct-fab:hover { transform: scale(1.06); color: #fff; }
.ct-fab:active { transform: scale(0.94); color: #fff; }
@media (min-width: 768px) { .ct-fab { display: none; } }

/* ── Bottom Tabs ──────────────────────────────────────────────────── */
.ct-bottom-tabs {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 490;
  padding-bottom: var(--ct-sa-bottom);
  background: color-mix(in srgb, #fff 94%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-top: 1px solid var(--ct-border);
}
.ct-bottom-tabs-inner {
  height: var(--ct-tab-h);
  display: flex;
  max-width: 640px;
  margin: 0 auto;
}
.ct-tab-btn {
  flex: 1;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 3px;
  background: none; border: none;
  color: var(--ct-text-muted);
  font-family: var(--ct-font-body);
  min-height: 48px;
  font-size: 10px; font-weight: 700;
  position: relative;
  transition: color .15s;
  text-decoration: none;
  cursor: pointer;
}
.ct-tab-btn.is-active { color: var(--ct-accent); }
.ct-tab-btn.is-active::before {
  content: '';
  position: absolute; top: 0;
  left: 50%; transform: translateX(-50%);
  width: 28px; height: 3px;
  border-radius: 0 0 3px 3px;
  background: var(--ct-accent);
}
.ct-tab-btn i { font-size: 17px; }
@media (min-width: 768px) { .ct-bottom-tabs { display: none; } }

/* ── Bottom Spacer (mobile) ───────────────────────────────────────── */
.ct-bottom-spacer {
  display: none;
}
@media (max-width: 767px) {
  .ct-bottom-spacer {
    display: block;
    height: calc(var(--ct-tab-h) + var(--ct-sa-bottom) + 24px);
    pointer-events: none;
  }
}

/* ── Notification Bell ────────────────────────────────────────── */
.ct-notif-wrap {
  position: relative;
}
.ct-notif-btn {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: var(--ct-surface);
  border: 1px solid var(--ct-border);
  color: var(--ct-text);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  position: relative;
  box-shadow: var(--ct-shadow-xs);
  font-size: 15px;
  flex-shrink: 0;
}
.ct-notif-btn:hover { background: var(--ct-surface-sunken); }
.ct-notif-badge {
  position: absolute;
  top: 5px; right: 5px;
  min-width: 16px; height: 16px;
  border-radius: 999px;
  background: var(--ct-danger);
  border: 1.5px solid var(--ct-surface);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  font-family: var(--ct-font-display);
  display: flex; align-items: center; justify-content: center;
  padding: 0 3px;
  line-height: 1;
}
.ct-notif-panel {
  position: fixed;
  top: calc(var(--ct-nav-h, 56px) + 8px);
  right: 16px;
  width: 300px;
  max-height: min(420px, calc(100dvh - 80px));
  background: var(--ct-surface);
  border: 1px solid var(--ct-border);
  border-radius: 16px;
  box-shadow: var(--ct-shadow-md);
  z-index: 700;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: ct-notif-in .15s ease;
}
@media (max-width: 340px) {
  .ct-notif-panel { width: calc(100vw - 32px); right: 8px; }
}
@keyframes ct-notif-in {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.ct-notif-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px 10px;
  border-bottom: 1px solid var(--ct-border);
  flex-shrink: 0;
}
.ct-notif-header-title {
  font-family: var(--ct-font-display);
  font-weight: 700;
  font-size: 14px;
  color: var(--ct-text);
}
.ct-notif-close-btn {
  width: 28px; height: 28px;
  border-radius: 8px;
  background: var(--ct-surface-sunken);
  border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--ct-text-muted);
  font-size: 13px;
}
.ct-notif-close-btn:hover { background: var(--ct-border); }
.ct-notif-list {
  overflow-y: auto;
  flex: 1;
}
.ct-notif-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  cursor: pointer;
  transition: background .12s;
}
.ct-notif-item:hover { background: var(--ct-surface-sunken); }
.ct-notif-item + .ct-notif-item { border-top: 1px solid var(--ct-border); }
.ct-notif-icon {
  width: 34px; height: 34px;
  border-radius: 10px;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  background: rgba(237,137,54,0.12);
  color: #c05621;
}
.ct-notif-icon--termin   { background: rgba(66,153,225,0.12); color: #2b6cb0; }
.ct-notif-icon--turnier  { background: rgba(26,54,93,0.10);   color: #1a365d; }
.ct-notif-icon--training { background: rgba(56,161,105,0.12); color: #276749; }
.ct-notif-icon--notiz    { background: rgba(236,201,75,0.14); color: #975a16; }
.ct-notif-content { flex: 1; min-width: 0; }
.ct-notif-title {
  font-family: var(--ct-font-display);
  font-weight: 600;
  font-size: 13px;
  color: var(--ct-text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ct-notif-meta {
  font-size: 11px;
  color: var(--ct-text-muted);
  margin-top: 2px;
}
.ct-notif-empty {
  padding: 28px 16px;
  text-align: center;
  font-size: 13px;
  color: var(--ct-text-muted);
}
.ct-notif-loading {
  padding: 28px 16px;
  text-align: center;
  color: var(--ct-text-muted);
  font-size: 16px;
}
