/* ==========================================================================
   AAISENSE Unified Ecosystem Navigation & Command Center CSS
   Architected for Apple Mac Desktop, Fold 7 Small Cover Screen & All Devices
   ========================================================================== */

:root {
  --aaisense-nav-bg: rgba(5, 9, 19, 0.88);
  --aaisense-nav-border: rgba(255, 255, 255, 0.08);
  --aaisense-cyan: #00f0ff;
  --aaisense-cyan-glow: rgba(0, 240, 255, 0.25);
  --aaisense-orange: #f78a3d;
  --aaisense-orange-glow: rgba(247, 138, 61, 0.25);
}

/* Modal Overlay */
.aaisense-ecosystem-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 999999;
  background: rgba(3, 7, 18, 0.82);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.22s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.22s;
}
.aaisense-ecosystem-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Modal Window Container */
.aaisense-ecosystem-modal-container {
  background: linear-gradient(145deg, rgba(13, 22, 42, 0.98) 0%, rgba(7, 13, 26, 0.99) 100%);
  border: 1px solid rgba(65, 190, 208, 0.35);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.85), 0 0 45px rgba(65, 190, 208, 0.18);
  border-radius: 20px;
  width: 100%;
  max-width: 1140px;
  max-height: 84vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.97) translateY(10px);
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: 'Poppins', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  color: #f8fafc;
}
.aaisense-ecosystem-modal-overlay.active .aaisense-ecosystem-modal-container {
  transform: scale(1) translateY(0);
}

/* Modal Header */
.aaisense-modal-header {
  padding: 16px 24px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: rgba(5, 10, 22, 0.6);
  flex-shrink: 0;
}
.aaisense-modal-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.aaisense-modal-logo-icon {
  width: 32px;
  height: 32px;
  background: rgba(0, 229, 255, 0.12);
  border: 1px solid rgba(0, 229, 255, 0.35);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #00f0ff;
  font-size: 15px;
  flex-shrink: 0;
}
.aaisense-modal-title {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  background: linear-gradient(90deg, #ffffff 0%, #00f0ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin: 0;
  line-height: 1.2;
}
.aaisense-modal-subtitle {
  font-size: 11.5px;
  color: #94a3b8;
  margin-top: 2px;
}
.aaisense-modal-close-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #94a3b8;
  padding: 6px 12px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  font-family: inherit;
  flex-shrink: 0;
}
.aaisense-modal-close-btn:hover {
  background: rgba(244, 63, 94, 0.18);
  border-color: rgba(244, 63, 94, 0.45);
  color: #fda4af;
  transform: translateY(-1px);
}
.aaisense-kbd-hint {
  font-size: 10px;
  background: rgba(255, 255, 255, 0.12);
  padding: 1px 5px;
  border-radius: 4px;
  color: #cbd5e1;
}

/* Modal Search & Filter Bar */
.aaisense-modal-search-bar {
  padding: 12px 24px;
  background: rgba(4, 8, 18, 0.4);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex-shrink: 0;
}
.aaisense-modal-search-input-wrap {
  position: relative;
  width: 100%;
}
.aaisense-modal-search-input {
  width: 100%;
  background: rgba(15, 25, 48, 0.85);
  border: 1px solid rgba(65, 190, 208, 0.3);
  border-radius: 12px;
  padding: 10px 42px 10px 38px;
  color: #ffffff;
  font-size: 13.5px;
  font-family: inherit;
  outline: none;
  transition: all 0.2s ease;
  box-sizing: border-box;
}
.aaisense-modal-search-input:focus {
  border-color: #00f0ff;
  box-shadow: 0 0 18px rgba(0, 240, 255, 0.25);
  background: rgba(18, 30, 58, 0.95);
}
.aaisense-modal-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 15px;
  opacity: 0.6;
  pointer-events: none;
}
.aaisense-modal-search-clear {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #94a3b8;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  cursor: pointer;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  display: none;
}
.aaisense-modal-search-clear:hover {
  background: rgba(244, 63, 94, 0.25);
  color: #ffffff;
}

/* Filter Tags (Horizontal Scrollable Strip on Mobile / Clean Row on Desktop) */
.aaisense-modal-filter-tags {
  display: flex;
  gap: 6px;
  align-items: center;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 2px;
}
.aaisense-modal-filter-tags::-webkit-scrollbar {
  display: none;
}
.aaisense-filter-tag {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  padding: 4px 11px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
  user-select: none;
  font-family: inherit;
  white-space: nowrap;
  flex-shrink: 0;
}
.aaisense-filter-tag:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.2);
}
.aaisense-filter-tag.active {
  background: rgba(65, 190, 208, 0.18);
  border-color: #41bed0;
  color: #41bed0;
  box-shadow: 0 0 10px rgba(65, 190, 208, 0.2);
}

/* Modal Body & Grid */
.aaisense-modal-body {
  padding: 18px 24px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.aaisense-modal-body::-webkit-scrollbar {
  width: 6px;
}
.aaisense-modal-body::-webkit-scrollbar-track {
  background: rgba(4, 8, 18, 0.5);
}
.aaisense-modal-body::-webkit-scrollbar-thumb {
  background: rgba(65, 190, 208, 0.3);
  border-radius: 9999px;
}
.aaisense-modal-body::-webkit-scrollbar-thumb:hover {
  background: rgba(65, 190, 208, 0.5);
}

/* Cluster Section */
.aaisense-cluster-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.aaisense-cluster-title {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #cbd5e1;
  display: flex;
  align-items: center;
  gap: 8px;
  border-left: 3px solid #f78a3d;
  padding-left: 8px;
  margin: 0;
}
.aaisense-cluster-title.c-austria { border-color: #f43f5e; color: #fca5a5; }
.aaisense-cluster-title.c-tech { border-color: #00f0ff; color: #7dd3fc; }
.aaisense-cluster-title.c-team { border-color: #f78a3d; color: #fdba74; }
.aaisense-cluster-title.c-legal { border-color: #10b981; color: #6ee7b7; }

.aaisense-portals-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(245px, 1fr));
  gap: 10px;
}

/* Portal Card */
.aaisense-portal-card {
  background: rgba(15, 24, 48, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 12px 14px;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}
.aaisense-portal-card:hover {
  background: rgba(22, 35, 68, 0.95);
  border-color: rgba(65, 190, 208, 0.45);
  transform: translateY(-2px);
  box-shadow: 0 10px 25px -8px rgba(0, 0, 0, 0.5), 0 0 16px rgba(65, 190, 208, 0.15);
}
.aaisense-portal-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.aaisense-portal-title {
  font-size: 13.5px;
  font-weight: 700;
  color: #ffffff;
  margin: 0;
  line-height: 1.3;
}
.aaisense-portal-slug {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  padding: 2px 6px;
  border-radius: 5px;
  font-weight: 600;
  flex-shrink: 0;
}
.aaisense-portal-desc {
  font-size: 11.5px;
  color: #94a3b8;
  line-height: 1.4;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.aaisense-portal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 10.5px;
}
.aaisense-portal-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.06);
  color: #cbd5e1;
}
.aaisense-portal-badge.badge-austria { background: rgba(244, 63, 94, 0.14); color: #fda4af; }
.aaisense-portal-badge.badge-noe { background: rgba(245, 158, 11, 0.14); color: #fcd34d; }
.aaisense-portal-badge.badge-wien { background: rgba(217, 4, 41, 0.14); color: #fca5a5; }
.aaisense-portal-badge.badge-melk { background: rgba(14, 165, 233, 0.14); color: #7dd3fc; }
.aaisense-portal-badge.badge-mozart { background: rgba(0, 240, 255, 0.14); color: #67e8f9; }
.aaisense-portal-badge.badge-radar { background: rgba(168, 85, 247, 0.14); color: #d8b4fe; }
.aaisense-portal-badge.badge-gemini { background: rgba(139, 92, 246, 0.18); color: #c4b5fd; }
.aaisense-portal-badge.badge-nick { background: rgba(247, 138, 61, 0.16); color: #fdba74; }
.aaisense-portal-badge.badge-potenzial { background: rgba(16, 185, 129, 0.16); color: #6ee7b7; }
.aaisense-portal-badge.badge-bridge { background: rgba(244, 63, 94, 0.16); color: #fda4af; }

.aaisense-portal-arrow {
  color: #94a3b8;
  font-weight: 700;
  transition: transform 0.2s ease, color 0.2s ease;
}
.aaisense-portal-card:hover .aaisense-portal-arrow {
  color: #00f0ff;
  transform: translateX(3px);
}

/* Modal Footer */
.aaisense-modal-footer {
  padding: 12px 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(5, 10, 22, 0.6);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 11px;
  color: #94a3b8;
  flex-shrink: 0;
}
.aaisense-modal-footer-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.aaisense-footer-link {
  color: #cbd5e1;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: color 0.15s ease;
}
.aaisense-footer-link:hover {
  color: #00f0ff;
}
.aaisense-status-dot {
  width: 7px;
  height: 7px;
  background: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 8px #10b981;
  display: inline-block;
}

/* Universal Header Trigger Button */
.aaisense-menu-trigger-btn {
  background: linear-gradient(135deg, rgba(247, 138, 61, 0.14) 0%, rgba(65, 190, 208, 0.16) 100%);
  border: 1px solid rgba(65, 190, 208, 0.35);
  color: #ffffff;
  padding: 6px 14px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  font-family: inherit;
  box-shadow: 0 0 14px rgba(65, 190, 208, 0.12);
  text-decoration: none;
  white-space: nowrap;
  user-select: none;
}
.aaisense-menu-trigger-btn:hover {
  background: linear-gradient(135deg, rgba(247, 138, 61, 0.25) 0%, rgba(65, 190, 208, 0.3) 100%);
  border-color: #00f0ff;
  color: #ffffff;
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.25);
  transform: translateY(-1px);
}
.aaisense-menu-trigger-badge {
  background: #f78a3d;
  color: #050913;
  font-size: 9.5px;
  font-weight: 900;
  padding: 1px 6px;
  border-radius: 9999px;
  letter-spacing: 0.04em;
}
.trigger-label-mobile {
  display: none;
}

/* ==========================================================================
   MOBILE & SAMSUNG GALAXY Z FOLD 7 SMALL COVER SCREEN OPTIMIZATION
   Strict edge-to-edge sheet, zero line wrapping, one-thumb usability
   ========================================================================== */
@media (max-width: 680px) {
  .aaisense-ecosystem-modal-overlay {
    padding: 0;
    align-items: flex-end;
  }
  .aaisense-ecosystem-modal-container {
    border-radius: 18px 18px 0 0;
    max-height: 94dvh;
    height: 94dvh;
    max-width: 100%;
    border-left: none;
    border-right: none;
    border-bottom: none;
    border-top: 1px solid rgba(65, 190, 208, 0.4);
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.8);
  }
  .aaisense-modal-header {
    padding: 12px 14px;
    gap: 10px;
  }
  .aaisense-modal-logo-icon {
    width: 28px;
    height: 28px;
    font-size: 13px;
  }
  .aaisense-modal-title {
    font-size: 14px;
  }
  .aaisense-modal-subtitle {
    font-size: 10.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
  }
  .aaisense-modal-close-btn {
    padding: 6px 10px;
    font-size: 12px;
  }
  .aaisense-kbd-hint {
    display: none;
  }

  .aaisense-modal-search-bar {
    padding: 10px 14px;
    gap: 8px;
  }
  .aaisense-modal-search-input {
    padding: 9px 34px 9px 34px;
    font-size: 13px;
    border-radius: 10px;
  }
  .aaisense-filter-tag {
    padding: 4px 10px;
    font-size: 10.5px;
  }

  .aaisense-modal-body {
    padding: 12px 14px 20px;
    gap: 16px;
  }
  .aaisense-cluster-title {
    font-size: 11.5px;
    padding-left: 6px;
  }
  .aaisense-portals-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .aaisense-portal-card {
    padding: 10px 12px;
    border-radius: 10px;
    gap: 6px;
  }
  .aaisense-portal-title {
    font-size: 13px;
  }
  .aaisense-portal-slug {
    font-size: 10px;
    padding: 1px 5px;
  }
  .aaisense-portal-desc {
    font-size: 11px;
    line-height: 1.35;
  }
  .aaisense-portal-footer {
    padding-top: 6px;
  }

  .aaisense-modal-footer {
    padding: 10px 14px;
    font-size: 10.5px;
  }
  .aaisense-modal-footer-left {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
  .aaisense-modal-footer-left span:nth-child(2),
  .aaisense-modal-footer-left span:nth-child(4) {
    display: none;
  }

  /* Trigger button on mobile / Fold 7 */
  .aaisense-menu-trigger-btn {
    padding: 5px 10px;
    font-size: 11px;
    gap: 4px;
  }
  .trigger-label-desktop {
    display: none;
  }
  .trigger-label-mobile {
    display: inline;
  }
}
