/* <!-- -------------------------
  STYLES (scope: user-*)
--------------------------- --> */

/* Light Theme */
:root[data-theme="light"] {
  --bg: var(--bg-light);
  --bg-secondary: #f9fafb;
  --bg-hover: #f3f4f6;
  --bg-card: #ffffff;

  --text: var(--text-light);
  --text-secondary: #4b5563;
  --text-muted: #6b7280;

  --border-color: var(--border);
  --accent-color: #2563eb;
  --accent-hover: #1d4ed8;
}

/* Dark Theme */
:root[data-theme="dark"] {
  --bg: var(--bg-dark);
  --bg-secondary: #252525;
  --bg-hover: #2e2e2e;
  --bg-card: #1e1e1e;

  --text: var(--text-dark);
  --text-secondary: #d1d5db;
  --text-muted: #9ca3af;

  --border-color: #374151;
  --accent-color: #3b82f6;
  --accent-hover: #60a5fa;
}

[data-theme="dark"] .user-menu-close {
  color: var(--bg-light);
} 

 /* -------------------------
  STYLES (scope: user-*)
--------------------------- */

.hidden { display: none !important; }

.user-overlay {
  position: fixed; inset: 0;
  background: var(--bg-darktr);
  display: none; justify-content: center; align-items: center;
  z-index: 9999;
  padding: 20px;
}
.user-overlay.active { display:flex; }

.user-menu-box {
  display: flex;
  background: var(--bg-card);
  border-radius: 10px;
  width: 95%;
  max-width: 1000px;
  height: 80%;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,0.35);
  position: relative;
  -webkit-user-select: none;
  -ms-user-select: none;
  user-select: none;
}
.user-menu-close {
  position: absolute; right: 12px; top: 8px;
  background: transparent; border: none; font-size: 28px; cursor: pointer;
}

/* Ring-Animation */
@keyframes pulseRing {
  0% {
    box-shadow: 0 0 0 0 #12bc7b99;
  }
  70% {
    box-shadow: 0 0 0 12px #12bc8c00;
  }
  100% {
    box-shadow: 0 0 0 0 #12bca500;
  }
}

.avatar-circle.has-new-message {
  position: relative;
  animation: pulseRing 1.5s infinite;
  border-radius: 50%;
}

.update-el {
  background: var(--bg-hover);
}

/* Sidebar */
.user-sidebar {
  width: 220px;
  background: var(--accent);
  color: var(--text-dark);
  padding: 20px 10px;
  flex-shrink: 0;
  border-right: 1px solid var(--border-color);
}
.user-sidebar h3 { margin: 0 0 12px 0; font-size: 16px; }
.user-sidebar ul { list-style: none; padding: 0; margin: 0; }
.user-sidebar li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  cursor: pointer;
  border-radius: 8px;
  transition: ease-out 0.2s;
  color: var(--text-dark);
}
.user-sidebar li.active,
.user-sidebar li:hover { background: var(--bg-hover); color: var(--text-light);}
.user-sidebar i { font-size: 20px; }

/* Content */
.user-content {
  flex: 1;
  padding: 22px;
  overflow-y: auto;
  box-sizing: border-box;
  background: var(--bg);
  color: var(--text);
}
.user-section {
  padding: 1rem;
  max-width: 900px;
  margin: 0 auto;
  font-family: 'Inter', sans-serif;
  color: var(--text);
  background: var(--bg);
}
.user-section h2 {
  font-size: 1.8rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.user-section p {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.user-section.hidden { display: none; }

.profile-avatar{
  display: flex;
  position: relative;
}

/* === Grid Layout === */
.profile-grid {
  display: flex;
  gap: 3rem;
  flex-wrap: wrap;
  align-items: flex-start;
}
/* === Profilbild & Uploader === */
.profile-uploader {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1 1 250px;
}
.profile-image-wrapper {
  position: relative;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 4px 10px rgba(0,0,0,0.08);
  transition: transform 0.3s ease;
  background: var(--bg-card);
}

.profile-image-wrapper:hover {
  transform: scale(1.02);
}
.profile-preview { width: 160px; text-align: center; }
.avatar-large {
  width: 120px; height: 120px; border-radius: 999px;
  background: var(--bg-secondary);
  display:flex; align-items:center; justify-content:center;
  font-size: 40px; color: var(--text);
  margin: 0 auto 8px auto; overflow: hidden;
}
.avatar-large img { width:100%; height:100%; object-fit:cover; display:block; }

.file-label input[type="file"] { display: block; margin-top: 6px; }

.profile-form label { display: block; margin-bottom: 8px; }
.profile-form input[type="text"],
.profile-form input[type="email"],
.profile-form textarea,
.profile-form input[type="tel"],
.profile-form input[type="number"] {
  width: 100%; padding: 8px; margin-top: 6px; box-sizing: border-box;
  border: 1px solid var(--border-color); border-radius: 6px;
  background: var(--bg-card); color: var(--text);
}

.profile-actions { margin-top: 12px; display:flex; gap: 8px; }
button { padding: 8px 12px; border-radius: 6px; border: none; cursor: pointer; }
#saveProfileBtn, #saveContactsBtn, #addSavedEventBtn, #addReviewBtn, #confirmLogoutBtn {
  background: var(--accent-color); color: white;
}
#cancelProfileBtn { background: #ef4444; color: white; }

ul { padding-left: 16px; }
.events-block ul { margin-bottom: 12px; }
.add-event { display:flex; gap:8px; margin-top: 8px; }
.checkboxes label { display:inline-block; margin-right:10px; }
.trustscore { margin-bottom: 12px; font-size: 18px; }

.uploader-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 1rem;
}
.uploader-preview {
  width: 140px; height: 140px;
  border-radius: 50%;
  background: var(--bg-secondary);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  position: relative;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  cursor: pointer;
  transition: transform 0.2s ease;
}
.uploader-preview:hover { transform: scale(1.03); }
.uploader-initials {
  font-size: 40px; font-weight: bold;
  color: var(--text);
}
.uploader-preview img {
  width: 100%; height: 100%; object-fit: cover;
  display: block;
}
.uploader-btn {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 1rem;
  font-size: 0.95rem;
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  background: var(--bg-secondary);
  color: var(--text);
  cursor: pointer;
  transition: all 0.3s ease;
}
.uploader-btn:hover { background: var(--accent-hover); }
.uploader-btn.remove { background: #ef4444;}
.uploader-btn.remove:hover { background: #dc2626;}

.uploader-btn.primary {
  background: var(--accent-color);
  color: #fff;
  border: none;
}

.uploader-btn.primary:hover {
  background: var(--accent-hover);
}

.edit-icon {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0,0,0,0.6);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.3s ease;
}

.edit-icon:hover {
  background: var(--accent-color);
}

.crop-container {
  position: relative;
  width: 200px; height: 200px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--bg-secondary);
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  margin-bottom: 10px;
  cursor: grab;
}
.crop-container:active { cursor: grabbing; }
.crop-container img {
  position: absolute;
  top: 0; left: 0;
  transform-origin: center;
  -webkit-user-select: none;
  -ms-user-select: none;
  user-select: none;
  -webkit-user-drag: none;
}
.crop-mask {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  box-shadow: 0 0 0 9999px rgba(0,0,0,0.5);
  pointer-events: none;
}

.user-sidebar {
  background: var(--accent);
  color: var(--text-dark);
}

.user-sidebar li {
  color: var(--text-dark);
}

.user-content {
  background: var(--bg);
  color: var(--text);
}

/* Messages List */
.messages-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.message-item {
  padding: 12px 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s ease;
}
.message-item:hover {
  background: var(--bg-hover);
}
.message-item.unread {
  border-left: 4px solid var(--accent-color);
  background: var(--bg-hover);
}

.message-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
  font-size: 14px;
  color: var(--text-muted);
}
.message-header .sender {
  font-weight: bold;
  color: var(--text);
}
.message-preview {
  font-size: 15px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.eventname{
  font-weight: bold;
  color: var(--accent-color);
  margin-right: 10px;
  min-width: 5rem;
  text-align: left;
}

/* Detail */
.message-detail {
  margin-top: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}
.message-detail-header h3 {
  flex: 1;
  margin: 0;
  font-size: 16px;
  color: var(--text);
}
.message-detail-header span {
  font-size: 13px;
  color: var(--text-muted);
}
.message-body {
  font-size: 15px;
  color: var(--text-secondary);
  margin-bottom: 14px;
  line-height: 1.5;
}

/* Reply */

.message-reply {
  display: flex;
  gap: 10px;
  align-items: stretch;
  flex-direction: column;
}

.message-reply textarea {
  flex: 1;
  resize: none;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  font-size: 14px;
  background: var(--bg-secondary);
  color: var(--text);
}
.message-reply button {
  background: var(--accent-color);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 10px 14px;
  cursor: pointer;
  transition: background 0.2s ease;
}
.message-reply button:hover {
  background: var(--accent-hover);
}

.rating-user {
  cursor: pointer;
  font-weight: 600;
  color: #2c3e50;
  position: relative;
}

.user-dropdown-prev {
  display: none;
  position: absolute;
  top: 28px;
  left: 0;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 10px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.12);
  padding: 14px;
  width: 280px;
  z-index: 100;
  font-size: 14px;
}

.user-dropdown-prev.active {
  display: block;
  animation: fadeIn 0.2s ease;
}

.user-card {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.user-card img {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #eee;
}

.user-info h4 {
  margin: 0;
  font-size: 16px;
  color: #34495e;
}

.user-info p {
  margin: 0;
  font-size: 13px;
  color: #666;
}

.user-contacts {
  margin: 10px 0;
  font-size: 13px;
  color: #444;
}

.user-actions button {
  padding: 8px 14px;
  border: none;
  border-radius: 6px;
  background: #3498db;
  color: white;
  cursor: pointer;
  transition: background 0.2s;
}

.user-actions button:hover {
  background: #2980b9;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Message User */

/* Modal Hintergrund */
.modal {
  display: none;
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(3px);
}

/* Modal-Box */
.modal-content {
  background: #fff;
  margin: 10% auto;
  display: flex;
  padding: 20px;
  border-radius: 12px;
  width: 90%;
  max-width: 420px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  animation: fadeInScale 0.25s ease;
  flex-direction: column;
  flex-wrap: wrap;
  align-content: center;
  align-items: flex-end;
}

div#msg-to {
    width: 104%;
    text-align: left;
    font-weight: 600;
    font-size: 1.2rem;
}

/* Close Button */
.close {
  float: right;
  font-size: 22px;
  font-weight: bold;
  cursor: pointer;
  color: #666;
}

.close:hover {
  color: #000;
}

.modal h3 {
  margin-top: 0;
  font-size: 18px;
  color: #2c3e50;
}

.modal textarea {
  width: 100%;
  margin: 12px 0;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 8px;
  resize: none;
  font-size: 14px;
}

.modal-actions {
  text-align: right;
}

.modal-actions button {
  padding: 10px 16px;
  border: none;
  border-radius: 8px;
  background: #3498db;
  color: #fff;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}

.modal-actions button:hover {
  background: #2980b9;
}

@keyframes fadeInScale {
  from { opacity: 0; transform: scale(0.9); }
  to   { opacity: 1; transform: scale(1); }
}


/* Mobile Anpassungen */
@media (max-width: 768px) {
  .user-sidebar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: auto;
    padding: 0;
    background: var(--bg-hover);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-around;
    z-index: 1000;
  }

  .user-sidebar ul {
    display: flex;
    width: 100%;
    justify-content: space-around;
    margin: 0;
    padding: 0;
  }

  .user-sidebar li {
    color: var(--bg-dark);
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 8px 0;
  }

  .user-sidebar li.active {
    color: var(--accent-color);
  }

  .user-sidebar li span { display: none; }

  .user-sidebar i {
    font-size: 24px;
    line-height: 1;
  }

  .user-content { margin-bottom: 60px; }

  .profile-grid { flex-direction: column; align-items: center; }

  .profile-uploader { margin-bottom: 20px; }

  .profile-form {
  flex: 2 1 400px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background: var(--bg-card);
  padding: 1.5rem;
  border-radius: 1rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

  .profile-form input,
  .profile-form textarea {
    width: 100%;
    font-size: 16px;
    padding: 10px;
  }

  .uploader-actions {
    flex: 1 1 200px;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
  }

  .uploader-btn {
    flex: 1 1 auto;
    min-width: 100px;
    padding: 10px;
    font-size: 14px;
  }

  .profile-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .profile-actions button {
    padding: 12px;
    font-size: 16px;
  }
}
