/* Hearttwin Style Sheet
 *
 * A simple colour palette of reds, whites and pinks is used throughout
 * the site to create a friendly and warm atmosphere.  Headings are bold
 * and forms are centred with generous spacing for readability.  Buttons
 * adopt the primary colour and invert on hover.  Lists such as the
 * interest collection are styled with pills that can be removed via
 * icons.
 */

:root {
  /* Updated modern colour palette inspired by contemporary UI themes */
  --primary-color: #6f2dbd; /* rich purple as primary colour */
  --secondary-color: #f5f5f5; /* light gray background */
  --accent-color: #e0c3fc; /* soft lavender accent */
  --text-color: #1a1a1a; /* dark charcoal for high contrast */
  --warning-color: #f4a261; /* muted orange for warnings */
}

body {
  margin: 0;
  padding: 0;
  font-family: Arial, Helvetica, sans-serif;
  background-color: var(--secondary-color);
  color: var(--text-color);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

header {
  background-color: var(--primary-color);
  color: #fff;
  padding: 1rem;
  text-align: center;
}

header img {
  max-height: 60px;
  vertical-align: middle;
  margin-right: 10px;
}

nav {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  white-space: nowrap;
  gap: 0.5rem;
  background-color: var(--accent-color);
  padding: 0.5rem 1rem;
}

nav a {
  color: var(--text-color);
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  background-color: var(--secondary-color);
  transition: background-color 0.2s, color 0.2s;
  display: inline-block;
  min-width: max-content;
}

nav a:hover {
  background-color: var(--primary-color);
  color: #fff;
}

/* Responsive Design Anpassungen für kleine Bildschirme */
@media (max-width: 600px) {
  /* Navigation horizontal scrollen oder umbrechen */
  nav {
    flex-wrap: wrap;
    overflow-x: auto;
    justify-content: flex-start;
  }
  nav a {
    margin-bottom: 0.5rem;
  }
  /* Chat-Layout untereinander statt nebeneinander */
  .chat-container {
    flex-direction: column;
  }
  .chat-list {
    width: 100%;
    max-height: 30vh;
    border-right: none;
    border-bottom: 1px solid #ccc;
  }
  .chat-window {
    width: 100%;
    max-height: 60vh;
  }
  /* Größeres Eingabefeld im Chat */
  .chat-container input[type="text"] {
    font-size: 1.1rem;
    padding: 0.8rem;
  }
}

main {
  flex: 1;
  padding: 2rem;
  max-width: 800px;
  margin: 0 auto;
}

footer {
  background-color: var(--accent-color);
  color: var(--text-color);
  text-align: center;
  padding: 1rem;
  font-size: 0.9rem;
}

/* Forms */
form {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  margin-top: 1rem;
}

label {
  font-weight: bold;
}

input[type="text"],
input[type="password"],
input[type="date"],
select,
textarea {
  padding: 0.5rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 1rem;
  width: 100%;
  box-sizing: border-box;
}

textarea {
  resize: vertical;
  min-height: 100px;
}

button {
  padding: 0.6rem 1.2rem;
  border: none;
  border-radius: 4px;
  background-color: var(--primary-color);
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
  transition: background-color 0.2s;
}

button:disabled {
  background-color: #ccc;
  cursor: not-allowed;
}

button:hover:not(:disabled) {
  background-color: #d62839;
}

.error {
  color: #d62839;
  font-weight: bold;
  margin-top: 0.5rem;
}

.success {
  color: green;
  font-weight: bold;
  margin-top: 0.5rem;
}

/* Sprache-Umschalter: richtet kleine Flaggen-Buttons aus */
.language-switcher {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
}
.language-switcher button {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.2rem;
}
.language-switcher button:hover {
  opacity: 0.7;
}

/* Interest pills */
.interests {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.interest {
  display: flex;
  align-items: center;
  background-color: var(--accent-color);
  border-radius: 20px;
  padding: 0.3rem 0.7rem;
  font-size: 0.9rem;
}

.interest span {
  margin-right: 0.5rem;
}

.interest button {
  background: none;
  border: none;
  color: var(--primary-color);
  cursor: pointer;
  font-size: 0.9rem;
  padding: 0;
}

/* Chat */
/* Chat */
.chat-container {
  display: flex;
  gap: 1rem;
}

/* Sidebar list of chats */
.chat-list {
  /* Breitere Leiste, damit Chat‑Vorschauen großzügiger erscheinen */
  width: 50%;
  max-height: 70vh;
  overflow-y: auto;
  border-right: 1px solid #ccc;
  padding: 0.8rem;
  box-sizing: border-box;
}

/* Individual chat preview card */
.chat-list-item {
  background-color: var(--secondary-color);
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 1.2rem;
  margin-bottom: 1rem;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  transition: background-color 0.2s, box-shadow 0.2s;
  white-space: normal;
  word-wrap: break-word;
}

.chat-list-item:hover {
  background-color: var(--accent-color);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

/* Bold title for unread chats */
.chat-list-item.unread .chat-title {
  font-weight: bold;
}

/* Title and last message within chat list items */
.chat-list-item .chat-title {
  font-weight: bold;
  margin-bottom: 0.2rem;
}
.chat-list-item .chat-last {
  font-size: 0.95rem;
  color: #555;
  line-height: 1.3;
}

.chat-window {
  flex: 1;
  display: flex;
  flex-direction: column;
  max-height: 70vh;
}

.messages {
  flex: 1;
  overflow-y: auto;
  margin-bottom: 0.5rem;
  padding-right: 0.5rem;
}

.message {
  margin: 0.3rem 0;
  padding: 0.5rem;
  border-radius: 8px;
  max-width: 70%;
}

.message.sent {
  align-self: flex-end;
  background-color: var(--primary-color);
  color: #fff;
}

.message.received {
  align-self: flex-start;
  background-color: var(--accent-color);
  color: var(--text-color);
}

.message-time {
  font-size: 0.7rem;
  text-align: right;
  margin-top: 0.1rem;
}

.warning {
  background-color: var(--warning-color);
  color: #000;
  padding: 0.5rem;
  border-radius: 4px;
  margin-bottom: 0.5rem;
}

/* Admin */
.admin-section {
  margin-bottom: 2rem;
  padding: 1rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  background-color: #fff;
}

.admin-section h3 {
  margin-top: 0;
}