

.chat-card1 {
  width: AUTO;
  height: calc(100vh - 120px);

  box-sizing: border-box;

  padding: 35px;
  border-radius: 15px;

  background: var(--bg-primary);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow1);

  Margin: 15px;

  border: 1px solid var(--border-primary);
  display: flex;
  flex-direction: column;
}

.chat-card-header {
  width: auto;
  height: 40px;

  box-sizing: border-box;

  padding: 7px;
  margin: -35px;
  border-radius: 15px;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;

  background: var(--bg-secondary);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow1);

  /* 🔥 DAS FEHLT */
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.workspace {
  display: grid;
  grid-template-columns: 4fr 6fr 2fr;
  height: calc(100vh - 90px);
  width: 100%;
  transition: grid-template-columns 200ms ease;
}

.panel {
  overflow: hidden;
}

.workspace.chatlist-collapsed {
  grid-template-columns: 0fr 6fr 2fr;
}

.workspace.chat-collapsed {
  grid-template-columns: 4fr 0fr 2fr;
}

.workspace.settings-collapsed {
  grid-template-columns: 4fr 6fr 0fr;
}

.btn-settings-open {
  display: none;
}

.no-chat-wrapper {
  height: 100%;
  width: 100%;

  display: flex;
  flex-direction: column;

  justify-content: center;
  align-items: center;

  text-align: center;
}

.no-chat-img {
  width: 180px;
  height: auto;
  margin-bottom: 20px;
  opacity: 0.9;
}

.user-search {
  margin-top: 40px;
}

.search-bar {
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-close {
    flex: 0 0 auto;
}

.chat-search-input {
    flex: 1;
}

.user-card {
    width: 100%;
    padding: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.user-name {
    flex: 1;
    text-align: left;
    font-weight: 500;
}

.chat-back-btn {
  width: 34px;
  height: 34px;

  display: flex;
  align-items: center;
  justify-content: center;

  border: none;

  background: var(--bg-glass);
  color: var(--text-primary);

  border-radius: 8px;

  cursor: pointer;

  transition: all 150ms ease;

  flex-shrink: 0;
}

.chat-card {
    width: 100%;
    margin-top: 3px;

    background: var(--bg-glass);

    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);

    padding: 8px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;

  /* Abstand innen */
  padding: 40px 5px;

  /* wichtig für Bottom-up Layout */
  display: flex;
  flex-direction: column;

  justify-content: flex-end;
}

.chat-footer {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 5px;
    padding: 3px;

    width: auto;
    box-sizing: border-box;
}

.input-row {
    display: flex;
    width: 100%;
    align-items: center;
    gap: 8px;
}

#message-input {
    flex: 1;
    min-width: 0;
    padding: 12px;
    box-sizing: border-box;
}

#action-btn {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    border: none;
    cursor: pointer;
}

.chat-card:hover {
    border: 1px solid var(--border-primary);
}

.chat-btn {
    flex-shrink: 0;
}

.chat-item {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.chat-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.chat-name {
    flex: 1;
    font-weight: 500;
}

/* Mobile */
@media (max-width: 768px) {

  .btn-settings-toggle {
    display: none;
  }

  .btn-settings-open {
    display: inline-block;
  }
}

.message-card {
    padding: 8px 10px;
    margin: 6px;
    border-radius: 8px;
    max-width: 70%;
}

.message-card.own {
    margin-left: auto;
    background: #2b6cff;
    color: white;
}

.message-card.other {
    margin-right: auto;
    background: #2a2a2a;
    color: #fff;
}

.message-meta {
    font-size: 10px;
    opacity: 0.6;
    margin-top: 4px;
}