/* Add some custom CSS for the cards */
.card {
  margin-bottom: 20px;
  border-radius: 10px;
  box-shadow: 0 4px 6px 0 rgba(0, 0, 0, 0.2);
}

/* Position the avatar and username in the top left of the card */
.card-avatar {
  height: 50px;
  width: 50px;
  border-radius: 50%;
  position: absolute;
  top: 10px;
  left: 10px;
}

/* Settings icon styling entfernt - jetzt Teil der Button-Group */

.card-username {
  position: absolute;
  top: 10px;
  left: 70px;
}

.card-text.text-right {
    text-align: right;
    margin-top: -20px !important;
}

/* Add padding to the card body to prevent overlay with avatar and username */
.card-body {
  padding-top: 40px;
  padding-bottom: 10px;
}

/* Style the media image */
.card-img-top {
  width: 100%;
  height: auto;
}

/* Ensure carousel keeps constant height based on first slide */
.carousel {
  position: relative;
}

.carousel-inner {
  width: 100%;
}

.carousel-inner .carousel-item {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000; /* letterbox background */
  height: 100%;
}

.carousel-inner .carousel-item img {
  width: 100%;
  height: 100%;
  object-fit: contain; /* no cropping */
}

.card-title {
  font-weight: normal;
}

.card-text {
  margin-bottom: 1px !important;
}

.card {
  font-size: 0.9em;  /* adjust this value to get the desired text size */
}

/* Remove indent of URLs */
.invisible {
  font-size: 0 !important;
  line-height: 0 !important;
}

.hashtag {
  margin-right: 0px !important; 
  }

/* Custom navbar styles */
.navbar {
  background-color: rgb(255, 255, 255) !important;
  margin: -10px 0 10px 0 !important;
  border: 0 !important;
  padding: 15px !important;
  min-height: auto !important;
  height: 54px !important;
  border-radius: 10px;
  box-shadow: 0 4px 6px 0 rgba(0, 0, 0, 0.05);
  position: sticky !important;
  top: -10px !important;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  z-index: 1000 !important;
}

.navbar-brand {
  color: rgba(100, 100, 100, 0.9) !important;
  font-size: 0.9em;
  padding: 0 !important;
  margin: 0 !important;
  height: auto !important;
  line-height: 1 !important;
}

.navbar-brand-dark {
  color: rgba(30, 30, 30, 0.9) !important; /* 30% dunkler als der Rest */
}

.navbar-info {
  color: rgba(60, 60, 60, 0.9) !important;
  font-size: 1.2em;
  padding: 0 0.5rem !important;
  margin: 0 !important;
  height: auto !important;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.25 !important;
}

.hashtag {
  margin-right: 8px;
  display: inline-block;
}

.col-sm-3 {
  padding-left: 0px !important;
  padding-right: 0px !important;
}

/* Set the background color of the body */
body {
  background-color: #eeeeee;
  margin-top: 00px !important;
  margin-left: 20px !important;
  margin-right: 20px !important;
}

/* Zero State Modern Card Styles */
.zero-state-card {
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  padding: 24px 48px; /* 50% weniger oben/unten (24px statt 48px) */
  max-width: 600px;
  margin: 0 auto;
}

.zero-state-header {
  margin-bottom: 16px; /* 50% weniger (16px statt 32px) */
}

.zero-state-title {
  font-size: 2rem;
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 12px;
}

.zero-state-subtitle {
  font-size: 1.1rem;
  color: #7f8c8d;
  margin-bottom: 0;
}

.zero-state-form {
  text-align: left;
}

.zero-state-form .form-group {
  margin-bottom: 20px;
}

.zero-state-form label {
  font-weight: 500;
  color: #34495e;
  margin-bottom: 8px;
  font-size: 0.95rem;
}

.zero-state-form .form-control {
  border-radius: 8px;
  border: 2px solid #e0e0e0;
  padding: 12px 16px;
  font-size: 1rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.zero-state-form .form-control:focus {
  border-color: #007bff;
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
  outline: none;
}

.zero-state-form .btn-primary {
  width: 100%;
  border-radius: 8px;
  padding: 14px 32px;
  font-weight: 500;
  font-size: 1.05rem;
  background-color: #007bff;
  border: none;
  transition: background-color 0.2s ease, transform 0.1s ease;
}

.zero-state-form .btn-primary:hover {
  background-color: #0056b3;
  transform: translateY(-1px);
}

.zero-state-form .btn-primary:active {
  transform: translateY(0);
}

.zero-state-tip {
  font-size: 0.9rem;
  color: #95a5a6;
  margin-top: 16px;
}

.zero-state-tip a {
  color: #007bff;
  text-decoration: none;
  font-weight: 500;
}

.zero-state-tip a:hover {
  text-decoration: underline;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .zero-state-card {
    padding: 32px 24px;
  }
  
  .zero-state-title {
    font-size: 1.5rem;
  }
  
  .zero-state-subtitle {
    font-size: 1rem;
  }
}

@media (max-width: 1000px) {
  .col-sm-3 {
    flex: 0 0 50%;
    max-width: 50%;
  }
  .navbar-brand {
    display: none;
  }
}

@media (max-width: 600px) {
  .col-sm-3 {
    flex: 0 0 100%;
    max-width: 100%;
  }
  .navbar-brand {
    display: none;
  }
}

.avatar-img {
  width: 50px;
  height: 50px;
}

.avatar-link {
  display: inline-block;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.avatar-link:hover {
  opacity: 0.8;
}

.container {
  max-width: 2000px !important;
  }

.footer {
    background-color: rgb(200, 200, 200);
    color: #f2f2f2;
    position: fixed;
    left: 0;
    bottom: 0;
    width: 100%;
    padding-top: 2px !important; /* reduce padding-top to half */
    padding-bottom: 2px !important; /* reduce padding-bottom to half */
    font-size: 0.9em;
}

/* Overlay for enlarged media */
#media-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 1050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

#overlay-content img,
#overlay-content video {
  max-width: 95vw;
  max-height: 90vh;
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

#overlay-close {
  position: absolute;
  top: 12px;
  right: 16px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 22px;
  line-height: 1;
  text-align: center;
  padding: 0;
  cursor: pointer;
}

#overlay-close:hover {
  background: rgba(0, 0, 0, 0.8);
}

/* View toggle styles */
#view-toggle {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 0 !important;
  margin: 0 !important;
  height: auto !important;
}

/* Connect Status Icon */
#connect-status-icon {
  font-size: 0.9em;
  color: rgba(100, 100, 100, 0.6);
  cursor: pointer;
  transition: all 0.2s ease;
  margin: 0 0 0 12px !important;
  padding: 0 !important;
  line-height: 1 !important;
}

#connect-status-icon:hover {
  color: rgba(255, 255, 255, 0.9);
  transform: scale(1.1);
}

#connect-status-icon.connected {
  color: rgba(100, 100, 100, 0.9);
}

#view-toggle .btn {
  min-width: 80px;
  font-size: 0.85em;
  padding: 4px 12px;
}

/* Modern Button Group Styles */
#view-toggle .btn-group {
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  height: 32px; /* Feste Höhe für konsistente Darstellung */
}

#view-toggle .btn-group .btn {
  border: none;
  border-radius: 0;
  min-width: 40px;
  padding: 6px 10px;
  font-size: 0.85em;
  transition: all 0.15s ease;
  position: relative;
  height: 32px; /* Gleiche Höhe wie Container */
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(248, 249, 250, 0.8); /* Leichte Transparenz */
  color: rgba(108, 117, 125, 0.9); /* Leichte Transparenz */
}

#view-toggle .btn-group .btn:first-child {
  border-top-left-radius: 6px;
  border-bottom-left-radius: 6px;
}

#view-toggle .btn-group .btn:last-child {
  border-top-right-radius: 6px;
  border-bottom-right-radius: 6px;
}

/* Entferne Trennlinien zwischen Buttons für nahtlose Verbindung */
#view-toggle .btn-group .btn:not(:last-child) {
  border-right: none;
}

/* Aktiver Button - dezentere Farbe passend zum Header */
#view-toggle .btn-group .btn.btn-primary {
  background-color: rgba(52, 58, 84, 0.7); /* Dunkelblau-grau passend zum Header-Hintergrund */
  color: rgba(255, 255, 255, 0.95);
  border-color: rgba(52, 58, 84, 0.7);
}

/* Hover-Effekt für gesamte Gruppe */
#view-toggle .btn-group .btn:hover {
  background-color: rgba(233, 236, 239, 0.9);
  color: #495057;
}

#view-toggle .btn-group .btn.btn-primary:hover {
  background-color: rgba(52, 58, 84, 0.85); /* Etwas dunkler beim Hover */
  color: white;
}

/* Icon-Styling */
#view-toggle .btn-group .btn i {
  font-size: 1em;
  line-height: 1;
}

/* Verbundener Button - einheitliche Farbe */
#view-toggle .btn-group .btn.btn-success {
  background-color: #28a745;
  color: white;
  border-color: #28a745;
}

#view-toggle .btn-group .btn.btn-success:hover {
  background-color: #1e7e34;
  color: white;
}

/* People list styles */
.people-list {
  max-width: 800px;
  margin: 0 auto;
}

.people-item {
  display: flex;
  align-items: flex-start;
  padding: 12px 20px;
  background: #fff;
  margin-bottom: 10px;
  border-radius: 10px;
  box-shadow: 0 4px 6px 0 rgba(0, 0, 0, 0.2);
  transition: opacity 400ms ease, transform 400ms ease;
  will-change: opacity, transform;
}

.people-item:hover {
  background: #f5f5f5;
}

.people-item.is-hidden {
  opacity: 0;
  transform: translateY(8px);
}

.people-item .people-avatar {
  visibility: hidden;
}

.people-avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  margin-right: 15px;
  flex-shrink: 0;
}

.people-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  margin-right: 15px;
}

.people-name-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.people-name {
  font-weight: 500;
  font-size: 1.1em;
}

.people-profile-link {
  opacity: 0;
  color: rgba(108, 117, 125, 0.8);
  font-size: 0.9em;
  transition: opacity 0.2s ease, color 0.2s ease;
  text-decoration: none;
}

.people-item:hover .people-profile-link {
  opacity: 1;
}

.people-profile-link:hover {
  color: #007bff;
}

.people-profile-link i {
  font-size: 0.85em;
}

.people-bio {
  font-size: 0.85em;
  color: #666;
  line-height: 1.4;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  text-overflow: ellipsis;
  transition: all 0.3s ease;
  margin-bottom: 0;
}

.people-item.expanded .people-bio {
  -webkit-line-clamp: unset;
  display: block;
  margin-bottom: 12px;
}

.people-posts {
  display: none;
  margin-top: 12px;
  padding-top: 12px;
}

.people-item.expanded .people-posts {
  display: block;
}

.people-post {
  margin-bottom: 12px;
  padding: 10px;
  background: #f8f9fa;
  border-radius: 10px;
  box-shadow: 0 4px 6px 0 rgba(0, 0, 0, 0.2);
  font-size: 0.85em;
}

.people-post:last-child {
  margin-bottom: 0;
}

.people-post-content {
  color: #333;
  line-height: 1.5;
  margin-bottom: 6px;
}

.people-post-content p {
  margin: 0;
}

.people-post-meta {
  font-size: 0.9em;
  color: #999;
}

.people-post-meta a {
  color: #999;
  text-decoration: none;
}

.people-post-meta a:hover {
  color: #666;
  text-decoration: underline;
}

.people-item {
  cursor: pointer;
}

.people-actions {
  display: flex;
  align-items: center;
  gap: 0;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  height: 32px;
  flex-shrink: 0;
  align-self: flex-start;
  margin-top: 19px !important;
}

.people-count {
  background: rgba(248, 249, 250, 0.8);
  color: rgba(108, 117, 125, 0.9);
  padding: 6px 12px;
  font-size: 0.85em;
  font-weight: normal;
  min-width: 45px;
  text-align: center;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-right: none;
}

.people-actions .follow-btn {
  border: none;
  border-radius: 0;
  height: 32px;
  padding: 6px 12px;
  font-size: 0.85em;
  margin: 0;
  background-color: rgba(248, 249, 250, 0.8);
  color: rgba(108, 117, 125, 0.9);
  transition: all 0.15s ease;
}

.people-actions .follow-btn:hover {
  background-color: rgba(233, 236, 239, 0.9);
  color: #495057;
}

.people-actions .follow-btn.btn-success {
  background-color: #28a745;
  color: white;
}

.people-actions .follow-btn.btn-success:hover {
  background-color: #1e7e34;
}

.people-actions .follow-btn.btn-warning {
  background-color: #ffc107;
  color: #212529;
}

.people-actions .follow-btn.btn-warning:hover {
  background-color: #e0a800;
}

.people-actions .follow-btn.btn-secondary {
  background-color: #6c757d;
  color: white;
}

.people-actions .follow-btn.btn-outline-danger {
  background-color: rgba(220, 53, 69, 0.1);
  color: #dc3545;
}

/* Animation layer */
#animation-layer {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2000; /* Höher als navbar (1000) */
  pointer-events: none;
  display: none;
}

#animation-layer.active {
  display: block;
}

.fly-avatar {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  will-change: transform, opacity;
  z-index: 2001 !important; /* Über animation-layer */
  display: block !important;
  visibility: visible !important;
}

/* Connect overlay */
#connect-overlay,
#disconnect-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 2100;
  display: flex;
  align-items: center;
  justify-content: center;
}

.connect-modal {
  width: 90%;
  max-width: 480px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  padding: 32px;
}

.connect-modal-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 24px;
}

.connect-modal-label {
  font-weight: 500;
  color: #34495e;
  margin-bottom: 8px;
  font-size: 0.95rem;
  display: block;
}

.connect-modal-text {
  color: #7f8c8d;
  font-size: 1rem;
  line-height: 1.5;
  margin-bottom: 24px;
}

.connect-input-wrapper {
  display: flex;
  align-items: center;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  overflow: hidden;
  transition: border-color 0.2s ease;
}

.connect-input-wrapper:focus-within {
  border-color: #007bff;
}

.connect-input-prefix {
  padding: 10px 0 10px 14px;
  background: #f8f9fa;
  color: #6c757d;
  font-size: 1rem;
  font-weight: 500;
  white-space: nowrap;
}

.connect-input {
  border: none !important;
  padding: 10px 14px 10px 8px !important;
  font-size: 1rem;
  flex: 1;
  box-shadow: none !important;
}

.connect-input:focus {
  outline: none;
}

.zero-state-form .form-group { margin-bottom: 10px; }
.connect-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 18px;
}

.connect-modal-actions .btn {
  border-radius: 8px;
  padding: 10px 24px;
  font-weight: 500;
}

/* Modern Toast Notification */
.notification-toast {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(-100px);
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  padding: 16px 24px;
  z-index: 3000;
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}

.notification-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.notification-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.notification-content i {
  font-size: 1.2rem;
}

.notification-success .notification-content i {
  color: #28a745;
}

.notification-error .notification-content i {
  color: #dc3545;
}

.notification-content span {
  font-size: 1rem;
  color: #2c3e50;
  font-weight: 500;
}

/* Mobile Burger Menu */
.mobile-burger {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #333;
  padding: 0.5rem;
  cursor: pointer;
  margin-left: auto;
  align-self: center;
}

/* Show burger on mobile, hide desktop nav */
@media (max-width: 767px) {
  .desktop-nav {
    display: none !important;
  }
  /* Hide desktop icons group on mobile */
  #view-toggle {
    display: none !important;
  }
  
  .mobile-burger.d-none {
    display: flex !important;
  }
  
  .navbar {
    display: flex;
    align-items: center;
    padding: 15px 5px !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
  
  .navbar-info {
    display: block !important;
    font-size: 0.9em !important;
    max-width: calc(100% - 140px);
  }
  
  /* Unified padding for all containers on mobile - same as posts */
  .container,
  #app-content,
  #people-container,
  #zero-state .container {
    padding-left: 3.75px !important;
    padding-right: 3.75px !important;
  }
  
  /* Zero-state card same spacing */
  .zero-state-card {
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
  
  /* Column padding unified */
  .col-sm-3,
  .col-md-4,
  .col-lg-3,
  .col-md-8,
  .col-lg-6 {
    padding-left: 3.75px !important;
    padding-right: 3.75px !important;
  }
  
  /* People container cards */
  #people-container .card {
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
  
  /* People cards layout - count top right, avatar with button below */
  .people-item {
    display: grid !important;
    grid-template-columns: 60px 1fr !important; /* free the right side for content */
    grid-template-rows: auto auto !important;
    gap: 0.5rem !important;
    align-items: start !important;
    position: relative !important;
    padding-right: 12px !important; /* reduce right inner padding on mobile */
    padding-left: 10px !important; /* as requested for mobile */
  }
  
  .people-avatar {
    width: 60px !important;
    height: 60px !important;
    grid-row: 1 / 2 !important;
    grid-column: 1 / 2 !important;
  }
  
  .people-info {
    grid-row: 1 / 2 !important;
    grid-column: 2 / 3 !important; /* spans full right content area */
    min-width: 0;
    margin-right: 0 !important; /* remove extra right gap */
    padding-right: 1.5rem !important; /* just enough for top-right count */
  }
  
  .people-count {
    position: absolute !important;
    top: 8px !important;
    right: 12px !important;
    margin: 0 !important;
    padding: 0 !important;
    min-width: 0 !important;
    height: auto !important;
    line-height: 1 !important;
    font-size: 0.95rem !important;
    font-weight: 400 !important;
    background: transparent !important;
    color: #666 !important;
  }
  
  .people-actions {
    grid-row: 2 / 3 !important;
    grid-column: 1 / 2 !important;
    display: flex !important;
    width: 100% !important;
  }
  
  .people-actions .follow-btn {
    width: 100% !important;
    padding: 0.4rem 0.3rem !important;
    font-size: 0.75rem !important;
    line-height: 1.2 !important;
    white-space: nowrap !important;
  }
}

/* Mobile Menu Overlay */
.mobile-menu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 3000;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  padding-top: 60px;
}

.mobile-menu-content {
  background: white;
  width: 280px;
  max-width: 85vw;
  height: calc(100vh - 60px);
  box-shadow: -4px 0 12px rgba(0,0,0,0.2);
  display: flex;
  flex-direction: column;
  animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
  }
  to {
    transform: translateX(0);
  }
}

.mobile-menu-close {
  align-self: flex-end;
  background: none;
  border: none;
  font-size: 1.8rem;
  padding: 1rem;
  color: #666;
  cursor: pointer;
}

.mobile-menu-items {
  display: flex;
  flex-direction: column;
  padding: 1rem 0;
}

.mobile-menu-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.5rem;
  background: none;
  border: none;
  border-bottom: 1px solid #f0f0f0;
  text-align: left;
  cursor: pointer;
  transition: background 0.2s ease;
}

.mobile-menu-item:hover,
.mobile-menu-item:active {
  background: #f8f9fa;
}

.mobile-menu-item.active {
  background: #e3f2fd;
  border-left: 4px solid #007bff;
}

.mobile-menu-item i {
  font-size: 1.2rem;
  color: #666;
  width: 24px;
  text-align: center;
}

.mobile-menu-item.active i {
  color: #007bff;
}

.mobile-menu-item span {
  font-size: 1rem;
  color: #333;
  font-weight: 500;
}

.mobile-menu-item.active span {
  color: #007bff;
}
