* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --discord-blurple: #7289da;
  --discord-dark: #424549;
  --discord-darker: #36393e;
  --discord-darkest: #282b30;
  --discord-black: #1e2124;
  --discord-white: #ffffff;
  --discord-gray: #b9bbbe;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background-color: var(--discord-darkest);
  color: var(--discord-white);
  line-height: 1.6;
}

a {
  color: var(--discord-blurple);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: #5b6eae;
}

.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
}

.navbar {
  background-color: var(--discord-black);
  padding: 15px 0;
  margin-bottom: 30px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.site-logo {
  max-height: 32px;
  max-width: 32px;
  object-fit: contain;
  vertical-align: middle;
}

.navbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
}

.navbar h1 {
  font-size: 24px;
  font-weight: 600;
}

.navbar h1 a {
  color: var(--discord-white);
}

.navbar nav {
  display: flex;
  gap: 20px;
  align-items: center;
}

.navbar nav a {
  padding: 8px 12px;
  border-radius: 4px;
  transition: background-color 0.2s;
}

.navbar nav a:hover {
  background-color: var(--discord-darker);
}

.navbar .user-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.navbar .avatar-small {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}

.btn {
  display: inline-block;
  padding: 10px 20px;
  background-color: var(--discord-blurple);
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: background-color 0.2s;
}

.btn:hover {
  background-color: #5b6eae;
  color: white;
}

.btn-secondary {
  background-color: var(--discord-dark);
}

.btn-secondary:hover {
  background-color: var(--discord-darker);
}

.btn-danger {
  background-color: #ed4245;
}

.btn-danger:hover {
  background-color: #c03537;
}

.btn-small {
  padding: 6px 12px;
  font-size: 13px;
}

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

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: var(--discord-gray);
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 10px;
  background-color: var(--discord-black);
  border: 1px solid var(--discord-dark);
  border-radius: 4px;
  color: var(--discord-white);
  font-size: 14px;
  font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--discord-blurple);
}

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

.card {
  background-color: var(--discord-darker);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.post {
  background-color: var(--discord-darker);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 15px;
  transition: background-color 0.2s;
}

.post:hover {
  background-color: #3a3d42;
}

.post-header {
  display: flex;
  align-items: center;
  margin-bottom: 12px;
}

.post-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  margin-right: 12px;
  background-color: var(--discord-dark);
  cursor: pointer;
  transition: opacity 0.2s;
}

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

.post-info {
  flex: 1;
}

.post-author {
  font-weight: 600;
  color: var(--discord-white);
  margin-right: 8px;
  text-decoration: none;
  transition: color 0.2s;
}

a.post-author:hover {
  color: var(--discord-blurple);
  text-decoration: none;
}

.post-username {
  color: var(--discord-gray);
  font-size: 14px;
}

.post-timestamp {
  color: var(--discord-gray);
  font-size: 13px;
}

.post-content {
  margin-bottom: 12px;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.post-content p {
  margin-bottom: 10px;
}

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

.post-content a {
  color: var(--discord-blurple);
  text-decoration: underline;
}

.post-content code {
  background-color: var(--discord-black);
  padding: 2px 6px;
  border-radius: 3px;
  font-family: 'Courier New', monospace;
  font-size: 0.9em;
}

.post-content pre {
  background-color: var(--discord-black);
  padding: 12px;
  border-radius: 4px;
  overflow-x: auto;
  margin: 10px 0;
}

.post-content pre code {
  padding: 0;
  background: none;
}

.post-content blockquote {
  border-left: 3px solid var(--discord-dark);
  padding-left: 15px;
  margin: 10px 0;
  color: var(--discord-gray);
}

.post-content ul, .post-content ol {
  margin-left: 20px;
  margin-bottom: 10px;
}

.post-image {
  margin: 15px 0;
  border-radius: 8px;
  overflow: hidden;
  text-align: center;
}

.post-image img {
  width: 100%;
  max-width: 600px;
  height: auto;
  display: block;
  border-radius: 8px;
  margin: 0 auto;
}

/* Limit image height on timeline for better UX */
.timeline .post-image img {
  max-height: 500px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
}

.post-gif img {
  max-width: 480px;
}

.post-gif iframe {
  border-radius: 8px;
  max-width: 480px;
  margin: 0 auto;
  display: block;
}

.post-giphy {
  margin: 15px 0;
  max-width: 480px;
}

.post-giphy iframe {
  border-radius: 8px;
  width: 100%;
  max-width: 480px;
  height: auto;
  aspect-ratio: 16/9;
}

.btn-like {
  background: none;
  border: none;
  color: var(--discord-gray);
  cursor: pointer;
  font-size: 14px;
  padding: 6px 12px;
  border-radius: 4px;
  transition: all 0.2s;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.like-icon {
  width: 18px;
  height: 18px;
  object-fit: contain;
  vertical-align: middle;
  filter: grayscale(100%);
  transition: filter 0.2s;
}

.btn-like:hover {
  background-color: rgba(114, 137, 218, 0.1);
  color: var(--discord-blurple);
}

.btn-like:hover .like-icon {
  filter: grayscale(0%);
}

.btn-like.liked {
  color: var(--discord-blurple);
  font-weight: 600;
}

.btn-like.liked .like-icon {
  filter: grayscale(0%);
}

.giphy-results {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
  margin-top: 10px;
  max-height: 400px;
  overflow-y: auto;
  padding: 10px 0;
}

.giphy-result {
  cursor: pointer;
  border-radius: 4px;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
  background-color: var(--discord-black);
}

.giphy-result:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 8px rgba(114, 137, 218, 0.3);
}

.giphy-result img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  display: block;
}

.giphy-no-results,
.giphy-error {
  text-align: center;
  padding: 20px;
  color: var(--discord-gray);
  font-size: 14px;
}

.selected-gif {
  margin-top: 10px;
}

.selected-gif-preview {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 10px;
  background-color: var(--discord-black);
  border-radius: 4px;
}

.selected-gif-preview img {
  width: 120px;
  height: auto;
  border-radius: 4px;
}

.selected-gif-preview button {
  margin-left: auto;
}

.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 30px 0;
  padding: 20px;
  background-color: var(--discord-darker);
  border-radius: 8px;
}

.pagination-info {
  color: var(--discord-gray);
  font-size: 14px;
}

.post-actions {
  display: flex;
  gap: 15px;
  align-items: center;
  color: var(--discord-gray);
  font-size: 13px;
}

.post-actions a {
  color: var(--discord-gray);
  transition: color 0.2s;
}

.post-actions a:hover {
  color: var(--discord-white);
}

.comment {
  background-color: var(--discord-darkest);
  border-left: 3px solid var(--discord-dark);
  padding: 15px;
  margin-bottom: 10px;
  border-radius: 4px;
}

.comment-header {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
}

.comment-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  margin-right: 10px;
  background-color: var(--discord-dark);
  cursor: pointer;
  transition: opacity 0.2s;
}

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

.comment-content {
  margin-top: 8px;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.comment-content p {
  margin-bottom: 8px;
}

.comment-content p:last-child {
  margin-bottom: 0;
}

.comment-content a {
  color: var(--discord-blurple);
  text-decoration: underline;
}

.comment-image {
  margin-top: 10px;
  text-align: center;
}

.comment-image img {
  max-width: 400px;
  border-radius: 4px;
  display: block;
  margin: 0 auto;
}

.comment-gif {
  margin-top: 10px;
  text-align: center;
}

.comment-gif img {
  max-width: 320px;
  border-radius: 4px;
  display: block;
  margin: 0 auto;
}

.comment-gif iframe {
  border-radius: 4px;
  margin: 0 auto;
  display: block;
}

.profile-header {
  background-color: var(--discord-darker);
  border-radius: 8px;
  padding: 30px;
  margin-bottom: 30px;
  text-align: center;
}

.profile-avatar {
  width: 128px;
  height: 128px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 20px;
  display: block;
  background-color: var(--discord-dark);
}
.profile-bio {
  max-width: 100%;
  object-fit: cover;
  margin: 0 auto 20px;
  display: block;
}
.profile-nickname {
  font-size: 28px;
  font-weight: 600;
  margin-bottom: 5px;
}

.profile-username {
  color: var(--discord-gray);
  font-size: 18px;
  margin-bottom: 15px;
}

.profile-stats {
  display: flex;
  gap: 30px;
  justify-content: center;
  margin-top: 20px;
}

.profile-stat {
  text-align: center;
}

.profile-stat-value {
  font-size: 24px;
  font-weight: 600;
  display: block;
}

.profile-stat-label {
  color: var(--discord-gray);
  font-size: 14px;
}

.tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  border-bottom: 2px solid var(--discord-dark);
}

.tab {
  padding: 10px 20px;
  background: none;
  border: none;
  color: var(--discord-gray);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s;
}

.tab:hover {
  color: var(--discord-white);
}

.tab.active {
  color: var(--discord-blurple);
  border-bottom-color: var(--discord-blurple);
}

.alert {
  padding: 12px 16px;
  border-radius: 4px;
  margin-bottom: 20px;
}

.alert-success {
  background-color: #43b581;
  color: white;
}

.alert-error {
  background-color: #ed4245;
  color: white;
}

.alert-success {
  background-color: #3ba55c;
  color: white;
}

.auth-container {
  max-width: 400px;
  margin: 100px auto;
}

.auth-card {
  background-color: var(--discord-darker);
  border-radius: 8px;
  padding: 40px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.auth-card h2 {
  text-align: center;
  margin-bottom: 30px;
  font-size: 24px;
}

.divider {
  text-align: center;
  margin: 20px 0;
  color: var(--discord-gray);
  position: relative;
}

.divider::before,
.divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 40%;
  height: 1px;
  background-color: var(--discord-dark);
}

.divider::before {
  left: 0;
}

.divider::after {
  right: 0;
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--discord-gray);
}

.empty-state-icon {
  font-size: 48px;
  margin-bottom: 15px;
}

.settings-section {
  margin-bottom: 30px;
}

.settings-section h3 {
  margin-bottom: 15px;
  font-size: 18px;
  color: var(--discord-white);
}

/* Notifications */
.notification-link {
  font-size: large;
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.notification-badge {
  background-color: #ed4245;
  color: white;
  border-radius: 10px;
  padding: 2px 6px;
  font-size: 11px;
  font-weight: bold;
  min-width: 18px;
  text-align: center;
}

.notification-item {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 15px;
  background-color: var(--discord-darker);
  border-radius: 8px;
  margin-bottom: 10px;
  border-left: 3px solid transparent;
  position: relative;
}

.notification-item.unread {
  background-color: var(--discord-dark);
  border-left-color: var(--discord-blurple);
}

.notification-link-wrapper {
  flex: 1;
  text-decoration: none;
  color: inherit;
  display: block;
}

.notification-item:hover {
  background-color: var(--discord-dark);
  cursor: pointer;
}

.notification-delete-form {
  position: relative;
  z-index: 10;
}

.notification-content {
  flex: 1;
}

.notification-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.notification-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: var(--discord-dark);
}

.notification-user {
  font-weight: bold;
  color: var(--discord-white);
}

.notification-time {
  color: var(--discord-gray);
  font-size: 12px;
}

.notification-preview {
  margin-top: 8px;
  padding: 10px;
  background-color: var(--discord-darkest);
  border-radius: 4px;
  font-size: 14px;
  color: var(--discord-gray);
}

.notification-badge-new {
  background-color: var(--discord-blurple);
  color: white;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: bold;
  margin-left: 8px;
}

/* Mention autocomplete */
.mention-autocomplete {
  position: absolute;
  background-color: var(--discord-darker);
  border: 1px solid var(--discord-dark);
  border-radius: 4px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  max-height: 200px;
  overflow-y: auto;
  z-index: 1000;
  min-width: 200px;
}

.mention-item {
  padding: 8px 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background-color 0.2s;
}

.mention-item:hover,
.mention-item.selected {
  background-color: var(--discord-blurple);
}

.mention-item img {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
}

.mention-item .mention-avatar-placeholder {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background-color: var(--discord-gray);
}

.mention-item .mention-info {
  display: flex;
  flex-direction: column;
}

.mention-item .mention-nickname {
  font-weight: 500;
  font-size: 14px;
}

.mention-item .mention-username {
  font-size: 12px;
  color: var(--discord-gray);
}

/* Mention styling in content */
.mention {
  color: var(--discord-blurple);
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.2s;
}

.mention:hover {
  color: #5b6eae;
  text-decoration: underline;
}

/* Users list page */
.users-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.user-card {
  display: flex;
  gap: 15px;
  padding: 20px;
  background-color: var(--discord-darker);
  border-radius: 8px;
  text-decoration: none;
  color: var(--discord-white);
  transition: background-color 0.2s, transform 0.2s;
}

.user-card:hover {
  background-color: var(--discord-dark);
  transform: translateY(-2px);
}

.user-card-avatar {
  flex-shrink: 0;
}

.user-card-avatar img,
.user-card-avatar .avatar-placeholder {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
}

.user-card-avatar .avatar-placeholder {
  background-color: var(--discord-gray);
}

.user-card-info {
  flex: 1;
  min-width: 0;
}

.user-card-nickname {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-card-username {
  font-size: 14px;
  color: var(--discord-gray);
  margin-bottom: 8px;
}

.user-card-bio {
  font-size: 14px;
  color: var(--discord-gray);
  margin-bottom: 8px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.user-card-stats {
  font-size: 13px;
  color: var(--discord-gray);
  display: flex;
  gap: 8px;
}

@media (max-width: 768px) {
  .container {
    padding: 10px;
  }

  .navbar .container {
    flex-direction: column;
    gap: 15px;
  }

  .profile-stats {
    gap: 15px;
  }

  .tabs {
    overflow-x: visible;
    flex-wrap: wrap;
  }

  .users-grid {
    grid-template-columns: 1fr;
  }
}
