/* Reset & Base */
* { box-sizing: border-box; }
html, body { height: 100%; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
  color: #111827; /* near-black */
  background: #ffffff;
  line-height: 1.65;
  display: flex;
  flex-direction: column;
  min-height: 100%; /* ensures full height */
}

main {
  flex: 1;
}

/* Footer */
footer {
  height: 2.5rem;
  width: 100%;
  background-color: white;
  padding: 10px;
  text-align: center;
  color: black;
  border-top: 1px solid #e5e7eb; /* optional: subtle divider */
}

/* Accessibility helpers */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

/* Links & buttons */
a { color: #0F62FE; text-decoration: none; }
a:hover { text-decoration: underline; }
.cta-button {
  display: inline-block;
  padding: 0.85rem 1.2rem;
  border-radius: 14px;
  font-weight: 600;
  border: 1px solid rgba(15,98,254,0.2);
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease, color .2s ease;
  text-align: center;
}
.cta-button.primary {
  background: #0F62FE;
  color: #fff;
  box-shadow: 0 10px 24px rgba(15,98,254,0.28);
}
.cta-button.primary:hover { transform: translateY(-1px); box-shadow: 0 14px 30px rgba(15,98,254,0.35); }
.cta-button.ghost {
  background: #fff;
  color: #0F62FE;
}
.cta-button.ghost:hover {
  background: #F0F5FF;
}

/* Only enable snap-scrolling if the device supports touch */
@media (hover: none) and (pointer: coarse) {
  html, body {
    scroll-snap-type: y mandatory;
  }
  .snap-section {
    scroll-snap-align: start;
  }
}

/* All other devices: normal scrolling */
@media (hover: hover) and (pointer: fine) {
  html, body {
    scroll-snap-type: none;
  }
  .snap-section {
    scroll-snap-align: none;
  }
}

/* HERO */
.hero {
  background: #ffffff;
  padding: 3.25rem 1.25rem 2rem;
  border-bottom: 1px solid #F3F4F6;
}
.hero-inner {
  max-width: 1100px;
  margin: 0 auto;
  text-align: center;
}
.hero h1 {
  font-size: clamp(1.8rem, 3.6vw, 3rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 .6rem;
}
.hero-sub {
  font-size: clamp(1rem, 1.35vw, 1.125rem);
  color: #374151;
  max-width: 900px;
  margin: 0 auto 1.25rem;
}
.hero-ctas {
  display: flex; gap: .75rem; justify-content: center; flex-wrap: wrap;
}
.scroll-down {
  margin-top: 1rem;
  border: none; background: transparent; cursor: pointer;
  font-size: 1.6rem; color: #9CA3AF;
  transition: transform .25s ease, color .25s ease;
}
.scroll-down:hover { transform: translateY(2px); color: #6B7280; }


/* NAVBAR (kept compatible with your existing navigation.php) */

.nav {
  margin:0 auto;
  max-width:2500px;
}

.navbar {
  background: #fff;
  border-bottom: 1px solid #E5E7EB;
  padding: .5rem 1rem;
}
.navbar-container {
  display: flex; align-items: center; justify-content: space-between;
  max-width: 1200px; margin: 0 auto; flex-wrap: wrap;
}
.logo img { max-height: 28px; display:block;}
.menu-toggle {
  display: none; width: 28px; height: 22px; border:0; background:transparent; cursor:pointer;
}
.menu-toggle span { display:block; height:3px; background:#111827; border-radius:2px; margin:3px 0; }
.navbar-menu { display:flex; gap: .75rem; align-items:center; flex-wrap:wrap; }
.navbar-menu > li > a { display:block; padding:.4rem .5rem; border-radius:10px; font-weight:600; color:#111827; }
.navbar-menu > li > a:hover { background:#F3F4F6; text-decoration:none; }

.navbar-menu,
.navbar-menu ul,
.dropdown-menu {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* Dropdowns */
.dropdown { position: relative; }
.dropdown-menu {
  display: none; position: absolute; top: 100%; left: 0;
  min-width: 220px; background:#fff; border:1px solid #E5E7EB;
  border-radius: 12px; box-shadow: 0 18px 40px rgba(0,0,0,0.08);
  padding:.35rem; z-index: 30;
}

.dropdown-menu li { margin: 0 0 .15rem; }

.dropdown-menu li a {
  display:block; padding:.6rem .75rem; border-radius: 10px; color:#111827; font-weight:500;
}
.dropdown-menu li a:hover { background:#F3F4F6; text-decoration:none; }
.dropdown:hover .dropdown-menu { display:block; }

@media (max-width: 860px) {
  .menu-toggle { display:flex; flex-direction:column; justify-content:center; }
  .navbar-menu { display:none; width:100%; margin-top:.5rem; }
  .navbar-menu.active { display:flex; flex-direction:column; align-items:flex-start; }
  .dropdown-menu { position: static; box-shadow:none; border:0; padding-left:.5rem; }
  .node-label { font-size: 1.05rem !important; } /* bump label size on mobile */
  .info-card { width: 86vw; max-width: 86vw; }     /* slightly wider on mobile */
}

@media (max-height: 650px) {
  .node-label { font-size: 1rem !important; }
}

/* NETWORK */
.ecosystem {
  position: relative;
  padding: 1rem 0 0;
  min-height: 90vh; /* vertically cover more of the page */
}
.legend {
  position: absolute;
  left: 50%;
  transform: translate(-50%, -50%);

  z-index: 999;
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;

  max-width: 90%;           /* shrink on small screens */
  width: auto;
  margin: 0;
  padding: 1rem 1.5rem;

  color: #374151;
  font-size: 0.9rem;

  background: rgba(255, 255, 255, 0.95);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  text-align: center;
}




/* Mobile adjustments */
@media (max-width: 600px) {

  .legend {
      display: none;
    }

}

.legend-item { display:flex; align-items:center; gap:.45rem; }
.dot { width:10px; height:10px; border-radius:50%; display:inline-block; }
.dot-public   { background:#1363DF; }
.dot-health   { background:#0E9F6E; }
.dot-corporate{ background:#F59E0B; }
.dot-research { background:#7C3AED; }
.dot-platform { background:#0EA5E9; }
.dot-usecases { background:#EF4444; }

.network-stage {
  position: relative;
  max-width: 1200px;
  margin: 0 auto;
  aspect-ratio: 12 / 7;
}

/* ---------- NETWORK: make card layer fixed & card always on top ---------- */
/* make card layer fixed so cards float above everything (legend, other sections) */
.network-stage .card-layer {
  position: fixed;    /* was absolute */
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 9999;      /* high so cards are above legend and nav */
  pointer-events: none; /* allow clicks to fall through except on cards */
}



#networkSvg {
  width: 100%; height: 100%;
  overflow: visible;
  display:block;
}
.link {
  fill: none;
  stroke: #E5E7EB;
  stroke-width: 2px;
}
.nodes .node-circle {
  stroke: #fff; stroke-width: 3px;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,0.08));
  transition: transform .18s ease, filter .18s ease;
}
.nodes .node-circle:hover {
  filter: drop-shadow(0 8px 18px rgba(0,0,0,0.12));
  transform: translateZ(0) scale(1.02);
}
.nodes .node-circle.active {
  filter: drop-shadow(0 10px 22px rgba(0,0,0,0.18));
  transform: translateZ(0) scale(1.08);
}
.node-label {
  font-size: .9rem;
  fill: #111827;
  font-weight: 600;
  pointer-events: none;
  user-select: none;
}

/* Card layer (cards open IN PLACE) */
.card-layer {
  position: absolute;
  inset: 0;
  pointer-events: none; /* click-through except for the card itself */
}
/* info card improvements */
.info-card {
  position: absolute;            /* we position it in JS near node coords */
  width: 320px;
  max-width: calc(100vw - 20px); /* leave margin on small screens */
  max-height: calc(100vh - 28px);/* never exceed viewport */
  overflow: auto;                /* allow scrolling inside the card if long */
  background: #ffffff;
  border: 1px solid #E5E7EB;
  border-radius: 16px;
  box-shadow: 0 30px 60px rgba(0,0,0,0.25);
  padding: 1rem 1rem 0.85rem;
  pointer-events: auto;          /* so card can be clicked */
  transform: scale(.98);
  opacity: 0;
  transition: transform .18s ease, opacity .18s ease;
  touch-action: manipulation;
}

.info-card.show {
  transform: scale(1);
  opacity: 1;
}

.info-card h4 {
  font-size: 1.05rem; margin: 0 1.8rem .25rem 0; line-height: 1.3;
}
.info-card .card-body { color:#374151; margin:.25rem 0 .65rem; }
.info-card .card-links { display:flex; gap:.5rem; flex-wrap:wrap; padding-bottom:.5rem; }
.info-card .card-link {
  display:inline-block; padding:.45rem .6rem; border-radius: 10px;
  background:#F3F4F6; color:#111827; text-decoration:none; font-weight:600; font-size:.9rem;
}
.info-card .card-link:hover { background:#E5E7EB; }

/* ensure close button sits above content and is easily tappable */
.card-close {
  position: absolute;
  top: .45rem;
  right: .6rem;
  z-index: 10000;
  width: 36px; height: 36px;
  display:flex; align-items:center; justify-content:center;
}

.card-close:hover { background:#E5E7EB; }

/* CTAs below the network */
.network-cta {
  max-width: 1100px; margin: .8rem auto 1.6rem; padding: 0 1rem;
  display:flex; gap:.75rem; justify-content:center; flex-wrap:wrap;
}

/* Content (SEO) */
.content {
  background:#ffffff;
  padding: 2.25rem 1rem;
}
.content-section {
  max-width: 980px; margin: 0 auto 1.35rem;
}
.content-section h2, .content-section h3 {
  letter-spacing: -0.01em;
}
.content-section h2 { font-size: clamp(1.5rem, 2.6vw, 2.1rem); margin: 0 0 .5rem; }
.content-section h3 { font-size: clamp(1.18rem, 1.9vw, 1.4rem); margin: .9rem 0 .3rem; }
.content-section p { margin: .5rem 0; color:#1F2937; }
.tick-list { padding-left: 1.2rem; }
.tick-list li {
  margin: .35rem 0; position: relative; padding-left: .6rem;
}
.tick-list li::before {
  content: '✓';
  position: absolute; left: -1.1rem; color: #10B981; font-weight: 800;
}
.cta-inline { margin-top: .6rem; display:flex; gap:.6rem; flex-wrap:wrap; }

/* Final CTA */
.final-cta {
  text-align:center;
  padding: 2.2rem 1rem 2.8rem;
  background:#ffffff;
  border-top: 1px solid #F3F4F6;
}
.final-cta h2 { margin: 0 0 .3rem; }
.final-cta p { color:#374151; margin: 0 0 .9rem; }

/* Images */
img { max-width:100%; height:auto; display:block; }

/* Motion preferences */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* Small helpers */
.noscript-hint {
  max-width: 800px; margin: .6rem auto 0; padding:.85rem 1rem;
  background:#FFF7ED; border:1px solid #FED7AA; color:#7C2D12;
  border-radius: 12px;
}










/* NEW ELEMENTS*/

/* --- NAVBAR ICON + LABEL LAYOUT (Mobile First) --- */
/* Keep this for icon+label inside each menu item */
.navbar-menu > li > a {
  display: flex;
  flex-direction: column; /* icon on top, text below */
  align-items: center;
  justify-content: center;
  padding: 0.5rem 0.75rem;
  text-align: center;
  gap: 0.25rem;
}

/* Layout the menu items in a row on mobile */
.navbar-menu {
  display: flex;
  flex-wrap: wrap; /* allows wrapping if too many items */
  justify-content: space-around;
}

/* Optional: prevent li from stretching too wide */
.navbar-menu > li {
  flex: 1 1 auto;
  max-width: 80px; /* tweak based on icon size */
}


.dashboard-container {
  display: flex;
  flex-direction: column; /* Stack vertically on mobile */
  gap: 0px;
  background-color: #fff;
}

/* Left column (overview) */
.dashboard-left {
  flex: 1;
  background-color: #fff;
  padding: 10px;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

/* Right column (cards) */
.dashboard-right {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 15px;
}

/* Individual cards */
.dashboard-card {
  background-color: #f8f8f8;
  border: 1px solid #cbd5c0;
  border-radius: 8px;
  padding: 10px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}


.menuINDEX {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: space-between;
/*  background-color:#10253f;  */
    margin-bottom:0px;
}

.menuINDEX li {
    list-style: none;
}

.menuINDEX li a {
    display: block;
    padding: 0px 0px;
}
.menuINDEX li.subitem a {
    padding: 10px;
    color: black;
}


.articlecentercontent {
  justify-content:center;
  width:100%;
  padding:0 8% 0 8%;
  max-width:2500px;
  margin:0 auto;
}


.contentfield {
  width: auto;
  margin: 0;
  padding: 1rem 1.5rem;

  color: #374151;
  font-size: 0.9rem;

  background: rgba(255, 255, 255, 0.95);
  border-radius: 12px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
}

/* Expanded state */
.contentfield.expanded {
  position: fixed;
  /* No top:50% for small screens — we'll adjust it via media query */
  top: 5%;
  left: 50%;
  transform: translateX(-50%);
  width: 90vw;
  max-width: 1400px;
  height: 90vh;
  max-height: 90vh;      /* Override the old max-height */
  background: white;
  z-index: 9999;
  box-shadow: 0 0 30px rgba(0,0,0,0.4);
  border-radius: 12px;
  padding: 20px;
  overflow: hidden;       /* Clip overflowing content if needed */
}

/* Ensure canvas fills expanded container */
.contentfield.expanded .canvas {
  height: calc(100% - 60px); /* leaves room for toolbar */
  max-width: none;
}

/* SVG scales with container */
.contentfield.expanded .canvas #networkSvg {
  width: 100%;
  height: 100%;
}

.wrap {
  height: 100%;
}

/* Grid container */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); /* flexible but fits small cards */
  gap: 16px;
  width: 100%;
  margin: 0 auto;
  padding: 20px;
  box-sizing: border-box;
  justify-content: center;
}

/* Card styling */
.card {
  background: linear-gradient(180deg, #ffffff 0%, #f9fafb 100%);
  border-radius: 12px;
  width: 100%;
  max-width: 200px;
  height: 125px;
  box-shadow: 0 3px 10px rgba(0,0,0,0.08);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center; /* centers contents vertically */
  padding: 10px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border: 1px solid #e5e7eb;
  overflow: hidden; /* makes sure nothing spills out */
}

/* Hover effect */
.card:hover {
  transform: translateY(-6px);
  box-shadow: 0 8px 18px rgba(0,0,0,0.15);
}

/* Card title */
.card-title {
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  margin-bottom: 6px;
  color: #1f2937;
  line-height: 1.2;
  max-height: 2.4em;        /* clamps to 2 lines */
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Card icon */
.card-icon .icon {
  width: 36px;
  height: 36px;
  margin: 0 auto 6px;
  transition: transform 0.3s ease;
  flex-shrink: 0;
}

.card:hover .icon {
  transform: scale(1.08);
}

/* Card type text */
.card-type span {
  font-size: 11px;
  font-weight: 500;
  color: #f97316;
  text-align: center;
}




:root{
    --bg:#0b1020;
    --panel:#0f172a;
    --text:#e5e7eb;
    --muted:#94a3b8;
    --primary:#4f46e5;    /* network nodes */
    --secondary:#22c55e;  /* team nodes */
    --member:#38bdf8;     /* access=member */
    --network:#8b5cf6;    /* access=network */
    --none:#334155;       /* access=none */
    --innovation:#f59e0b; /* innovation accent ring */
    --link:#64748b;
    --linkHover:#e2e8f0;
    --card-bg:#0b1223;
    --card-border:#1f2a44;
    --chip:#1e293b;
  }

   .toolbar {
  display: flex;
  justify-content: space-between; /* title left, actions right */
  align-items: center;
  background: #f8f9fa;
  border-bottom: 1px solid #ddd;
  padding: 8px 16px;
  font-family: sans-serif;
}

    .toolbar .title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
    }

    .toolbar-actions {
    display: flex;
    align-items: center;
    gap: 12px; /* space between toggle and refresh */
    }

    .segmented {
    display: inline-flex;
    border: 1px solid #ccc;
    border-radius: 6px;
    overflow: hidden;
    }

    .segmented button {
    background: #fff;
    border: none;
    padding: 6px 12px;
    cursor: pointer;
    font-size: 0.9rem;
    }

    .segmented button.active {
    background: #007bff;
    color: #fff;
    }

    .segmented button:not(.active):hover {
    background: #f1f1f1;
    }

    .btn {
    background: #007bff;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 6px 12px;
    cursor: pointer;
    font-size: 0.9rem;
    }

    .btn:hover {
    background: #0056b3;
    }

  .canvas{
    position:relative;
    width:100%;
    /*max-width:830px;*/
    height:210px;
    background:white;
    overflow:hidden;
  }

  svg{ display:block; width:100%; height:100%; }

  /* links & nodes */
  .link{ stroke:var(--link); stroke-opacity:.5; vector-effect:non-scaling-stroke; }
  .link.dim{ opacity:.15; }
  .nodes g{ cursor:pointer; }
  .node-circle{ stroke:#0b1020; stroke-width:1.5px; }
  .node-circle.member { fill:var(--member); }
  .node-circle.network{ fill:var(--network); }
  .node-circle.none   { fill:var(--none); }
  .node-circle.team   { fill:var(--secondary); }
  .node-circle.center { fill:#111827; }
  .node-innovation .ring{
    fill:none; stroke:var(--innovation); stroke-width:2; stroke-dasharray:3,3;
  }

/* labels */

  .node-label.hidden{ /* opacity:0; */ }

  /* component badges (for disconnected networks) */
  .comp-badge{
    fill:rgba(255,255,255,0.03); stroke-width:1; rx:10; ry:10;
  }
  .comp-text{
    fill:#cbd5e1; font-size:10px; opacity:.9;
  }

  /* card layer */
  #cardLayer{
    position:absolute; inset:0; pointer-events:none;
  }

  /* accessibility / focus */
  .nodes g:focus { outline:2px solid #3b82f6; outline-offset:3px; border-radius:8px; }

  /* mobile node filtering (reused from your snippet) */
  .node-hidden-for-mobile{ opacity:.28; pointer-events:none; }


.projectcard {
  position: relative; /* needed for icon positioning */
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  width: 100%;
  max-width: 200px;
  min-height: 120px;   /* compact height */
  display: flex;
}

.projectcard:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 18px rgba(0,0,0,0.15);
}

.projectcard-link {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex: 1;
  text-decoration: none;
  color: inherit;
  padding: 12px 14px;
  gap: 8px;
}

/* Title */
.projectcard-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: #1f2937;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-right: 36px; /* leave space so title doesn’t overlap icon */
}

/* Icon (top-right, overlapping border) */
.projectcard-icon {
  position: absolute;
  top: -10px;
  right: -10px;
  background: #fff;
  border-radius: 50%;
  padding: 6px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.projectcard-icon .icon {
  width: 32px;
  height: 32px;
  display: block;
}

/* Type badge */
.projectcard-type {
  font-size: 0.75rem;
  font-weight: 600;
  text-align: center;
  padding: 3px 8px;
  border-radius: 6px;
  align-self: flex-start;
  display: inline-block;
  margin-top: auto;
}

/* Different colors depending on type */
.projectcard-type span {
  display: inline-block;
}

.projectcard-type span:contains("Team project"),
.projectcard-type span:contains("Team Projekt") {
  background: #e0f2fe;
  color: #0369a1;
}

.projectcard-type span:contains("Network project"),
.projectcard-type span:contains("Netzwerk Projekt") {
  background: #fef3c7;
  color: #92400e;
}

.projectcard-type span:contains("Innovation hub"),
.projectcard-type span:contains("Innov.-Zentrum") {
  background: #f3e8ff;
  color: #6b21a8;
}




.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  border-bottom: 1px solid #e5e7eb;
  padding-bottom: 0.5rem;
}

.dashboard-header .team-name a {
  font-size: 1.2rem;
  font-weight: bold;
  color: #374151;
  text-decoration: none;
}

.dashboard-header .team-name a:hover {
  text-decoration: underline;
}

.team-function {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 12px;
  text-transform: capitalize;
  color: white;
}

.team-function--creator { background-color: #46087a; }
.team-function--manager { background-color: #ec7d01; }
.team-function--member  { background-color: #1da1e8; }

.team-function-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 9999px; /* pill shape */
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: capitalize;
  color: #fff;
  cursor: default;
  transition: transform 0.2s ease;
}

.team-function-badge:hover {
  transform: scale(1.05);
}

/* Role-specific colors */
.team-function--creator {
  background-color: #46087a; /* purple */
}

.team-function--manager {
  background-color: #ec7d01; /* orange */
}

.team-function--member {
  background-color: #1da1e8; /* blue */
}

.dashboard-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  text-align: center;
  margin-bottom: 1rem;
}

.stat-box .stat-number {
  font-size: 1.5rem;
  font-weight: 700;
  color: #374151;
}

.stat-box .stat-label {
  font-size: 0.75rem;
  color: #6b7280;
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Actions */
.dashboard-actions {
  margin-bottom: 0.75rem;
  text-align: center;
}

.invite-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  color: #2563eb;
  text-decoration: none;
}

.invite-link i {
  color: #00ca02;
}

/* Outstanding invitations */
.dashboard-invitations {
  padding-top: 0.75rem;
  border-top: 1px solid #e5e7eb;
  font-size: 0.85rem;
  color: #374151;
}

.dashboard-invitations i {
  color: #f97316;
  margin-right: 6px;
}

.dashboard-invitations a {
  margin-left: 4px;
  font-weight: 500;
  color: #2563eb;
  text-decoration: none;
}
/* TOP NAVIGATION */
.topnav {
  background: #ffffff;
  border-bottom: 1px solid #E5E7EB;
  padding: 0.5rem 1rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  position: sticky;
  top: 0;
  z-index: 10;
}

/* Keep container simple and centered */
.topnav-container {
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

/* Main menu */
.topnav-menu {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
  flex-wrap: nowrap; /* default: one row on desktop */
}

/* Menu items + links */
.topnav-menu > li {
  display: flex;
  align-items: center;
}

.topnav-menu > li > a {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  color: #374151;
  padding: 0.6rem 0.75rem;
  border-radius: 10px;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
  white-space: normal;   /* allow text wrapping */
  text-align: left;      /* keep text aligned nicely */
}

.topnav-menu > li > a:hover {
  background: #F3F4F6;
  color: #111827;
}

/* Icons */
.nav-icon {
  width: 45px;
  height: 40px;
  flex-shrink: 0;
}


.open-btn {
  display: inline-block;
  margin-top: 12px;
  padding: 8px 14px;
  background: #2563eb;
  color: white;
  font-weight: 500;
  border-radius: 6px;
  text-decoration: none;
  transition: background 0.2s;
}
.open-btn:hover {
  background: #1e40af;
}


/* === CHAT WINDOW === */
.chat-container {
  display: flex;
  flex-direction: column;
  background: #fff;
  height: 500px;
  max-width: 700px;
  margin: auto;
}

/* Chat header */
.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  border-bottom: 1px solid #ddd;
  background: #fafafa;
}

.chat-title {
  font-size: 18px;
  font-weight: bold;
  color: #000;
  margin: 0;
}

/* Controls (dropdown + expand button) */
.chat-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Channel dropdown */
.chat-channel-select {
  padding: 4px 8px;
  font-size: 14px;
  border: 1px solid #ccc;
  border-radius: 4px;
  background-color: #fff;
  color: #333;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.chat-channel-select:hover {
  border-color: #999;
}

.chat-channel-select:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 3px rgba(0, 123, 255, 0.5);
}


.chat-messages {
  flex: 1;
  padding: 15px;
  overflow-y: auto;
}

.chat-bubble {
  display: flex;
  align-items: flex-start;
  margin-bottom: 15px;
  max-width: 70%;
}

.chat-bubble img {
  border-radius: 50%;
  width: 32px;
  height: 32px;
  margin-right: 10px;
}

.chat-bubble .bubble {
  padding: 10px 14px;
  border-radius: 15px;
  font-size: 15px;
  line-height: 1.4;
  background: #e5e5ea;
  color: #000;
}

.chat-bubble.own {
  margin-left: auto;
  flex-direction: row-reverse;
}

.chat-bubble.own img {
  margin-left: 10px;
  margin-right: 0;
}

.chat-bubble.own .bubble {
  background: #b2d2ee;
  color: black;
}

/* Meta info */
.chat-meta {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  margin-bottom: 3px;
  color: #666;
}

/* Input area */
.chat-input {
  display: flex;
  border-top: 1px solid #eee;
  padding: 10px;
}

.chat-input textarea {
  flex: 1;
  resize: none;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 14px;
}

.chat-input button {
  margin-left: 8px;
  background: #0078ff;
  color: #fff;
  border: none;
  padding: 0 18px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
}

.chat-input button:hover {
  background: #005fcc;
}



/*communication center*/
:root {
  --cc-topbar-h: 52px;
  --cc-gap: 12px;
  --cc-radius: 10px;
  --cc-shadow: 0 8px 24px rgba(0,0,0,0.08);
  --cc-slate-900: #111827;
  --cc-slate-700: #374151;
  --cc-slate-600: #4b5563;
  --cc-slate-200: #e5e7eb;
  --cc-slate-100: #f3f4f6;
}

/* Hidden by default */
#commCenter {
  display: none;
  position: fixed;
  inset: 0;
  width: 100vw;           /* ensure full width */
  height: 100dvh;         /* safe mobile viewport height */
  z-index: 2000;
  background: #f9fafc;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color: var(--cc-slate-900);
  box-sizing: border-box;
}

/* MOBILE-FIRST: open = vertical stack */
#commCenter.open {
  display: flex;
  flex-direction: column;
}

/* Top bar always visible */
.cc-topbar {
  height: var(--cc-topbar-h);
  min-height: var(--cc-topbar-h);
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: var(--cc-gap);
  padding: 0 12px;
  background: #e2f7ff;
  border-bottom: 1px solid var(--cc-slate-200);
}

.cc-topbar-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cc-nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  width: 34px;
  border-radius: 8px;
  border: 1px solid var(--cc-slate-200);
  background: #fff;
  cursor: pointer;
}

.cc-title {
  margin: 0;
  font-size: 1rem;      /* right-sized on mobile */
  font-weight: 600;
}

.cc-team-info {
  font-size: .9rem;
  color: var(--cc-slate-600);
  white-space: nowrap;
}
.cc-team-label { opacity: .8; margin-right: 4px; }
.cc-team-name { font-weight: 600; }

.cc-close-btn {
  border: none;
  background: transparent;
  color: var(--cc-slate-600);
  font-size: 1.1rem;
  cursor: pointer;
}

/* Drawers: hidden off-canvas on mobile */
.cc-drawer {
  position: fixed;
  top: var(--cc-topbar-h);
  bottom: 0;
  width: 80vw;
  max-width: 320px;
  background: #fff;
  box-shadow: var(--cc-shadow);
  overflow-y: auto;
  transition: transform .25s ease;
  z-index: 2100;
}

/* Spaces (left) */
#ccSpaces {
  left: 0;
  transform: translateX(-100%);
  background: #f2f2f2;
  color: #fff;
  padding: 1rem;
}
#ccSpaces .cc-section-title { color: #595959; font-size:25px; }
#ccSpaces .cc-space-list li { padding: 6px 8px; border-radius: 6px; cursor: pointer; }
#ccSpaces .cc-space-list li.active { background: #374151; font-weight: 600; }

/* Channels (right) */
#ccChannels {
  right: 0;
  transform: translateX(100%);
  background: #f7f7f7;
  border-left: 1px solid var(--cc-slate-200);
  padding: 1rem;
}
#ccChannels .cc-section-title { color: #595959; font-size:25px; }
.cc-channel-list li { padding: 6px 8px; border-radius: 6px; cursor: pointer; }
.cc-channel-list li.active { background: #e5e7eb; font-weight: 600; }

/* Drawer visible */
.cc-drawer.show { transform: translateX(0); }

/* Conversation fills the rest on mobile */
.cc-conversation {
  position: relative;
  top: 0;
  bottom: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #fff;
  min-height: 0; /* allow children to scroll */
}

.cc-header {
  padding: .7rem .9rem;
  border-bottom: 1px solid var(--cc-slate-200);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.cc-channel-header { margin: 0; font-size: 1rem; font-weight: 600; }

.cc-messages {
  flex: 1;
  padding: 1rem;
  overflow-y: auto;
  background: #fafafa;
}

.cc-input {
  display: flex;
  gap: 8px;
  padding: 8px;
  border-top: 1px solid var(--cc-slate-200);
  background: #fff;
}
.cc-input textarea {
  flex: 1;
  border: 1px solid var(--cc-slate-200);
  border-radius: 10px;
  padding: .7rem .9rem;
  resize: none;
  font-size: .95rem;
  background: #fff;
}
.cc-send-btn {
  background: #2563eb;
  color: white;
  border: none;
  border-radius: 10px;
  padding: 0 14px;
  cursor: pointer;
}

.cc-channels-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cc-add-channel-btn {
  background: #007bff;
  color: white;
  border: none;
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
}

.cc-add-channel-btn:hover {
  background: #0056b3;
}

.cc-channel-list li {
  position: relative;
  padding-right: 30px;
}

.cc-channel-actions {
  position: absolute;
  right: 5px;
  top: 2px;
}




#addChannelModal {
  position: fixed; /* detach from parent stacking context */
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: white;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.3);
  z-index: 2000; /* higher than #commCenter */
  width: 400px;
  max-width: 90%;
}

#addChannelModal[aria-hidden="true"] {
  display: none;
}

/* Optional: dim background */
#addChannelModal::before {
  content: "";
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: -1; /* sits behind modal itself */
}






/* === Add Channel Modal === */
.cc-modal {
  position: fixed;
  inset: 0;
  z-index: 4000;            /* higher than #commCenter */
  display: none;
  align-items: center;
  justify-content: center;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

.cc-modal[aria-hidden="false"] { display: flex; }

.cc-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
}

.cc-modal-panel {
  position: relative;
  width: min(420px, 92vw);
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.35);
  overflow: hidden;
  animation: ccModalIn 180ms ease-out;
}

@keyframes ccModalIn {
  from { transform: translateY(8px); opacity: 0.6; }
  to   { transform: translateY(0);    opacity: 1;   }
}

.cc-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid #eee;
}
.cc-modal-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: #111;
}
.cc-modal-close {
  border: 0;
  background: transparent;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  opacity: 0.7;
}
.cc-modal-close:hover { opacity: 1; }

.cc-modal-body {
  padding: 16px;
}

.cc-modal-helper {
  margin: 0 0 10px;
  font-size: 13px;
  color: #444;
}

.cc-field { display: block; margin: 0 0 16px; }
.cc-label { display: block; font-size: 13px; margin-bottom: 6px; color: #111; font-weight: 600; }
.cc-input {
  width: 100%;
  border: 1px solid #d6dbe3;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  outline: none;
}
.cc-input:focus { border-color: #4a7cff; box-shadow: 0 0 0 3px rgba(74,124,255,0.15); }
.cc-hint { display:block; margin-top:6px; font-size:12px; color:#6b7280; }

.cc-modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 8px;
}
.cc-btn {
  padding: 9px 14px;
  border-radius: 10px;
  border: 0;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
}
.cc-btn-primary { background:#4a7cff; color:#fff; }
.cc-btn-primary:hover { filter: brightness(1.05); }
.cc-btn-secondary { background:#eef1f6; color:#111; }
.cc-btn-secondary:hover { filter: brightness(0.98); }

.cc-channels-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.cc-add-channel-btn {
  border: 0;
  background: #4a7cff;
  color: #fff;
  border-radius: 10px;
  padding: 6px 10px;
  font-weight: 700;
  cursor: pointer;
}
.cc-add-channel-btn:hover { filter: brightness(1.05); }

.cc-channel-actions {
  display: inline-block;
  margin-left: 8px;
}

.cc-delete-channel-btn {
  background: none;
  border: none;
  font-size: 16px;
  cursor: pointer;
  color: #666;
}

.cc-delete-channel-btn:hover {
  color: #e00;
}

.cc-channel-list li.active {
  background: #e6f0ff;
  font-weight: bold;
}




/* DESKTOP: switch to your 3-column grid */
@media (min-width: 900px) {
  #commCenter.open {
    display: grid;
    grid-template-columns: 220px 260px minmax(0, 1fr);
    grid-template-rows: var(--cc-topbar-h) 1fr;
    height: 100dvh;
  }

  .cc-topbar {
    grid-column: 1 / -1;   /* span all columns */
    padding: 0 1rem;
  }

  /* show columns in place; remove drawer behavior */
  .cc-drawer {
    position: static;
    transform: none !important;
    width: auto;
    max-width: none;
    box-shadow: none;
    z-index: auto;
  }

  .cc-sidebar { grid-column: 1; grid-row: 2; }
  .cc-channels { grid-column: 2; grid-row: 2; }
  .cc-conversation { grid-column: 3; grid-row: 2; }

  /* hide mobile nav buttons on desktop */
  .cc-nav-btn { display: none; }

  /* refine type sizes a bit larger on desktop */
  .cc-title { font-size: 1.05rem; }
  .cc-channel-header { font-size: 1.05rem; }
}

.cc-messages {
  overflow-anchor: none;
  /* javascript will set padding-bottom dynamically to match input height,
     but keep a sensible fallback */
  padding-bottom: 4.5rem; /* fallback; JS will increase if input is taller */
}

.cc-sidebar ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.cc-sidebar ul li {
  padding: 0.5rem 0.75rem;
  margin-bottom: 0.25rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  color: black;
  transition: background 0.2s, color 0.2s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cc-sidebar ul li:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #50bfea;
}

.cc-sidebar ul li.active {
  background: #4a90e2;
  color: #fff;
}

.cc-projects-header {
  font-size: 0.85rem;
  font-weight: bold;
  color: #555;
  padding: 0.5rem 1rem 0.2rem;
  text-transform: uppercase;
  cursor: default;
  list-style: none; /* ensure no bullet */
}









/* Threaded message style */
.message { margin-bottom: 1rem; }
.msg-header {
  font-weight: 600;
  display: flex;
  align-items: center;
}
.msg-header img {
  width: 24px; height: 24px; border-radius: 50%; margin-right: 6px;
}
.msg-time { margin-left: auto; font-size: .8rem; color: #888; }
.msg-body {
  background: #fff;
  border-radius: 8px;
  padding: .7rem 1rem;
  margin-top: .35rem;
  box-shadow: 0 1px 2px rgba(0,0,0,.05);
}

/* Input */
.cc-input {
  display: flex;
  border-top: 1px solid #ddd;
  background: #fff;
}
.cc-input textarea {
  flex: 1;
  border: none;
  padding: .8rem;
  resize: none;
  font-size: 1rem;
}
.cc-input button {
  border: none;
  background: #2f80ed;
  color: #fff;
  padding: 0 1.2rem;
  cursor: pointer;
}

/* Optional: prevent page scroll while open */
body.noscroll { overflow: hidden; }

/* Expand button in small chat */
.expand-btn {
  margin-top: 8px;
  padding: 6px 12px;
  font-size: 0.9rem;
  background: #2f80ed;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

/* Simple accessibility helper */
.visually-hidden { position:absolute; left:-10000px; top:auto; width:1px; height:1px; overflow:hidden; }

/* Modal layout */
.e2ee-modal {
  display: none;
  position: fixed;
  z-index: 10050;
  inset: 0;
  background: rgba(12,14,18,0.6);
  backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
}

.e2ee-modal[aria-hidden="false"] { display: flex; }

.e2ee-modal-panel {
  width: 460px;
  max-width: calc(100% - 24px);
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 12px 40px rgba(2,6,23,0.35);
  overflow: hidden;
}

.e2ee-header { padding: 20px 24px; border-bottom: 1px solid #eef2f6; }
.e2ee-header h2 { margin: 0 0 6px; font-size: 18px; color: #0b1726; }
.e2ee-sub { margin:0; color:#52606d; font-size: 13px; }

.e2ee-body { padding: 18px 24px; }
.e2ee-body input[type="password"] {
  width: 100%;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid #dce3ea;
  font-size: 15px;
  outline: none;
}
.e2ee-help { margin-top: 10px; color:#556; font-size:13px; display:flex; align-items:center; gap:8px; }

.e2ee-error { color: #a33; font-size: 13px; margin-top:8px; min-height:18px; }

.e2ee-actions { display:flex; justify-content:flex-end; gap:10px; padding: 12px 20px; border-top: 1px solid #eef2f6; }
.btn { padding: 8px 14px; border-radius: 8px; font-size: 14px; cursor: pointer; }
.btn-ghost { background: transparent; border: 1px solid #dfe7ee; color: #344; }
.btn-primary { background: #0058ff; color: #fff; border: none; }



/* Parent wrapper must be relative for absolute positioning */
.msg-wrapper {
  position: relative;
}

/* Three-dot button */
.chat-msg-options-button {
  background: #eee;
  border: none;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  font-size: 16px;
  line-height: 24px;
  text-align: center;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.chat-msg-options-button:hover {
  background: #ddd;
}

/* Floating menu container */
.chat-msg-options-wrapper {
  position: absolute;
  top: -4px; /* slightly above bubble */
  right: -4px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  z-index: 100;
}

/* Menu panel */
.chat-msg-options-menu {
  display: none; /* hidden by default */
  flex-direction: column;
  background: #ffffff;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  border-radius: 12px;
  padding: 4px 0;
  min-width: 100px;
  overflow: hidden;
  transform: scale(0);
  transform-origin: top right;
  transition: transform 0.2s ease, opacity 0.2s ease;
  opacity: 0;
}

/* Menu visible */
.chat-msg-options-menu.show {
  display: flex;
  transform: scale(1);
  opacity: 1;
}

/* Individual items */
.chat-msg-options-item {
  padding: 8px 12px;
  cursor: pointer;
  font-size: 14px;
  white-space: nowrap;
  transition: background 0.15s;
}

.chat-msg-options-item:hover {
  background: #f0f0f0;
}


























/* Responsive */
@media (max-width: 768px) {
  .cards-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
  }

  .topnav-menu {
    flex-wrap: wrap;               /* allow multiple rows */
    justify-content: flex-start;   /* align items to the left */
    gap: 0.75rem 1rem;             /* tighter spacing on mobile */
  }

  .topnav-menu > li {
    flex: 1 1 calc(50% - 1rem);    /* two items per row by default */
    max-width: calc(50% - 1rem);
  }

  .topnav-menu > li > a {
    width: 100%;
    justify-content: flex-start;   /* keep icon+text aligned left */
  }

  .contentfield.expanded {
    top: 5vh;              /* push down slightly from top edge */
    transform: translateX(-50%); /* only center horizontally */
    height: 90vh;          /* use more vertical space */
    max-height: 95vh;
  }


}

@media (max-width: 480px) {
  .cards-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

/* Tablet & up: increase icon & text slightly */
@media (min-width: 600px) {
  .navbar-menu > li > a .nav-icon {
    height: 32px;
  }
  .navbar-menu > li > a span {
    font-size: 0.85rem;
  }
}

/* Desktop: give them a bit more breathing room */
@media (min-width: 1024px) {
  .navbar-menu > li > a {
    padding: 0.6rem 1rem;
  }
  .navbar-menu > li > a .nav-icon {
    height: 34px;
  }
  .navbar-menu > li > a span {
    font-size: 0.9rem;
  }

  .dashboard-container {
    flex-direction: row; /* Side by side layout on desktop */
  }

  .dashboard-left {
    flex: 2;
    min-width: 300px;
    margin-right: 20px;
  }

  .dashboard-card {
    width: 100%; /* Fill parent */
    margin-bottom: 15px;
  }
}




