/* ===================================
   SYNNIO SIDEBAR - FRONTEND STYLES
   DESKTOP: Sticky Sidebar
   TABLET: Kompakte Sidebar mit Text
   MOBILE: Fixed Drawer Navigation
   =================================== */

.synnio-sidebar {
  width: 100%;
  min-width: 200px;
  max-width: 100%;
  
  /* DESKTOP/LAPTOP: Sticky */
  position: sticky;
  top: 0;
  
  height: 100vh;
  min-height: 600px;
  
  background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
  color: #fff;
  
  display: flex;
  flex-direction: column;
  
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  z-index: 999;
  
  overflow-y: auto;
  overflow-x: hidden;
}

.synnio-sidebar::-webkit-scrollbar {
  width: 6px;
}

.synnio-sidebar::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.5);
}

.synnio-sidebar::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.3);
  border-radius: 3px;
}

.synnio-sidebar::-webkit-scrollbar-thumb:hover {
  background: rgba(148, 163, 184, 0.5);
}

.synnio-brand {
  padding: 24px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  flex-shrink: 0;
}

.synnio-brand .logo {
  font-size: 24px;
  font-weight: 700;
  background: linear-gradient(90deg, #60a5fa 0%, #22d3ee 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin: 0;
  line-height: 1;
}

.synnio-brand .subtitle {
  font-size: 11px;
  color: #94a3b8;
  margin: 4px 0 0 0;
  letter-spacing: 0.3px;
}

.synnio-nav {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}

.synnio-nav .nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 10px;
  color: #e2e8f0;
  text-decoration: none;
  font-weight: 500;
  font-size: 15px;
  transition: all 0.2s ease;
  position: relative;
  white-space: nowrap;
}

.synnio-nav .nav-item:hover {
  background: rgba(51, 65, 85, 0.5);
  transform: translateX(2px);
}

.synnio-nav .nav-item.active,
.synnio-nav .nav-item:active {
  background: linear-gradient(90deg, #2563eb 0%, #06b6d4 100%);
  box-shadow: 0 10px 15px -3px rgba(37, 99, 235, 0.3);
}

.synnio-nav .icon {
  flex-shrink: 0;
  min-width: 20px;
}

.synnio-user {
  padding: 16px;
  border-top: 1px solid rgba(148, 163, 184, 0.2);
  display: flex;
  align-items: center;
  gap: 12px;
  transition: background 0.2s ease;
  text-decoration: none;
  color: #fff;
  flex-shrink: 0;
}

.synnio-user:hover {
  background: rgba(51, 65, 85, 0.5);
}

.synnio-user .user-avatar {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #2563eb 0%, #06b6d4 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.synnio-user .user-avatar svg {
  color: #ffffff;
  fill: #ffffff;
}

.synnio-user .user-info {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.synnio-user .user-name {
  font-size: 14px;
  font-weight: 500;
  margin: 0;
  color: #f1f5f9;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.synnio-user .user-role {
  font-size: 12px;
  color: #94a3b8;
  margin: 2px 0 0 0;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ===================================
   OVERLAY FÜR MOBILE MENU
   =================================== */
.synnio-sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 9998;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.synnio-sidebar-overlay.is-visible {
  display: block !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

/* ===================================
   RESPONSIVE DESIGN - TABLET
   =================================== */
@media (max-width: 1024px) {
  .synnio-sidebar {
    min-width: 180px;
  }
  
  .synnio-brand {
    padding: 20px;
  }
  
  .synnio-brand .logo {
    font-size: 22px;
  }
  
  .synnio-nav {
    padding: 12px;
  }
  
  .synnio-nav .nav-item {
    font-size: 14px;
    padding: 10px 12px;
  }
}

/* ===================================
   RESPONSIVE DESIGN - MOBILE
   SLIDE-DOWN Menü von oben mit !important
   =================================== */
@media (max-width: 768px) {
  /* WICHTIG: Menü fährt VON OBEN NACH UNTEN */
  .synnio-sidebar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    max-width: 100vw !important;
    height: auto !important;
    min-height: auto !important;
    max-height: 90vh !important;
    
    display: flex !important;
    flex-direction: column !important;
    
    /* BACKGROUND - Blauer Gradient mit !important */
    background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%) !important;
    color: #ffffff !important;
    
    /* SLIDE DOWN Animation */
    transform: translateY(-100%) !important;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
    z-index: 9999 !important;
    
    border-radius: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3) !important;
  }
  
  /* Menü offen - Slide DOWN */
  .synnio-sidebar.is-open {
    transform: translateY(0) !important;
  }
  
  .synnio-brand {
    padding: 16px 20px !important;
    border-bottom: 1px solid rgba(148, 163, 184, 0.2) !important;
    flex-shrink: 0 !important;
  }
  
  .synnio-brand .logo {
    font-size: 22px !important;
    color: #ffffff !important;
  }
  
  .synnio-brand .subtitle {
    display: block !important;
    color: #cbd5e1 !important;
  }
  
  .synnio-nav {
    padding: 12px !important;
    gap: 6px !important;
    max-height: calc(90vh - 140px) !important;
    overflow-y: auto !important;
  }
  
  .synnio-nav .nav-item {
    justify-content: flex-start !important;
    padding: 12px 16px !important;
    font-size: 15px !important;
    border-radius: 8px !important;
    color: #ffffff !important;
  }
  
  .synnio-nav span {
    display: block !important;
  }
  
  .synnio-user {
    justify-content: flex-start !important;
    border-top: 1px solid rgba(148, 163, 184, 0.2) !important;
    flex-shrink: 0 !important;
    color: #ffffff !important;
  }
  
  .synnio-user .user-info {
    display: block !important;
  }
  
  .synnio-user .user-name {
    color: #ffffff !important;
  }
  
  .synnio-user .user-role {
    color: #cbd5e1 !important;
  }
}

/* ===================================
   HAMBURGER BUTTON - MOBILE ONLY
   =================================== */
.synnio-hamburger-btn {
  display: none !important;
}

@media (max-width: 768px) {
  .synnio-hamburger-btn {
    display: flex !important;
    position: fixed !important;
    top: 16px !important;
    right: 16px !important;
    z-index: 10000 !important;
    background: linear-gradient(135deg, #2563eb 0%, #06b6d4 100%) !important;
    color: #fff !important;
    border: none !important;
    width: 48px !important;
    height: 48px !important;
    padding: 0 !important;
    border-radius: 12px !important;
    cursor: pointer !important;
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.3) !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.2s ease !important;
    opacity: 1 !important;
  }
  
  /* Hamburger verstecken wenn Menü offen */
  .synnio-sidebar.is-open ~ .synnio-hamburger-btn,
  body.synnio-menu-open .synnio-hamburger-btn {
    opacity: 0 !important;
    pointer-events: none !important;
  }
  
  .synnio-hamburger-btn:active {
    transform: scale(0.95) !important;
  }
  
  .synnio-hamburger-btn svg {
    width: 24px !important;
    height: 24px !important;
    stroke: #fff !important;
  }
}

/* ===================================
   CLOSE BUTTON - MOBILE ONLY
   =================================== */
.synnio-close-btn {
  display: none !important;
}

@media (max-width: 768px) {
  .synnio-close-btn {
    position: absolute !important;
    top: 16px !important;
    right: 16px !important;
    z-index: 10001 !important;
    background: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    color: #fff !important;
    width: 40px !important;
    height: 40px !important;
    padding: 0 !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.2s ease !important;
    backdrop-filter: blur(4px) !important;
    display: none !important;
  }
  
  /* Close Button ONLY sichtbar wenn Menü offen */
  .synnio-sidebar.is-open .synnio-close-btn {
    display: flex !important;
  }
  
  .synnio-close-btn:hover {
    background: rgba(255, 255, 255, 0.15) !important;
  }
  
  .synnio-close-btn:active {
    transform: scale(0.95) !important;
  }
  
  .synnio-close-btn svg {
    width: 20px !important;
    height: 20px !important;
  }
}

/* ===================================
   VERY SMALL SCREENS
   =================================== */
@media (max-width: 480px) {
  .synnio-sidebar {
    width: 100vw !important;
    max-width: 100vw !important;
  }
  
  .synnio-hamburger-btn {
    width: 44px !important;
    height: 44px !important;
  }
}
