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

body {
  font-family:
    -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue',
    Arial, sans-serif;
  background-color: #f5f5f5;
  color: #1a1a1a;
  line-height: 1.5;
}

.container {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 16px;
}

/* Header */
.header {
  background-color: #ffffff;
  border-bottom: 1px solid #e1e8ed;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 12px;
  padding-bottom: 12px;
}

.header-title {
  font-size: 20px;
  font-weight: 700;
  color: #1a1a1a;
}

/* Header Controls */
.header-controls {
  display: flex;
  align-items: center;
  gap: 16px;
}

.sound-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #657786;
  cursor: pointer;
  user-select: none;
}

/* Connection Status */
.connection-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #657786;
}

.status-indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: #657786;
}

.status-indicator.connected {
  background-color: #17bf63;
}

.status-indicator.disconnected {
  background-color: #e0245e;
}

.status-text {
  font-size: 13px;
}

/* Main Content */
.main-content {
  padding-top: 20px;
  padding-bottom: 40px;
}

/* Posts Container */
.posts-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.posts-empty {
  padding: 40px 20px;
  text-align: center;
  color: #657786;
  font-size: 15px;
  background-color: #ffffff;
  border: 1px solid #e1e8ed;
  border-radius: 8px;
}

/* Post Item */
.post-item {
  padding: 16px 20px;
  background-color: #ffffff;
  border: 1px solid #e1e8ed;
  border-radius: 8px;
  transition: all 0.2s;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.post-item:hover {
  background-color: #f7f9fa;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.post-item.new-post {
  animation: highlightPost 2s ease-in-out;
}

@keyframes highlightPost {
  0% {
    background-color: #e8f5e9;
  }
  100% {
    background-color: transparent;
  }
}

.post-item.deleted-post {
  background-color: #f7f7f7;
  opacity: 0.7;
}

.post-item.deleted-post:hover {
  background-color: #f7f7f7;
}

/* Post Header */
.post-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}

.post-author {
  font-weight: 600;
  font-size: 15px;
  color: #1a1a1a;
}

.post-id {
  font-size: 13px;
  color: #657786;
  font-weight: 400;
}

.post-timestamp {
  font-size: 13px;
  color: #657786;
}

/* Post Content */
.post-content {
  font-size: 15px;
  color: #1a1a1a;
  white-space: pre-wrap;
  word-wrap: break-word;
  line-height: 1.5;
}

.post-content code {
  background-color: #f0f0f0;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'SF Mono', 'Consolas', 'Liberation Mono', 'Menlo', monospace;
  font-size: 0.9em;
}

.post-deleted-content {
  color: #657786;
  font-style: italic;
}

/* Post Meta */
.post-meta {
  margin-top: 8px;
  font-size: 13px;
  color: #657786;
}

.post-edited {
  font-style: italic;
}

/* Notification */
.notification {
  padding: 12px 20px;
  background-color: #e8f5e9;
  border-left: 4px solid #17bf63;
  border-radius: 8px;
  margin-bottom: 12px;
  font-size: 14px;
  color: #1a1a1a;
  animation: slideIn 0.3s ease-out;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.notification.user-joined {
  background-color: #e3f2fd;
  border-left-color: #1976d2;
}

.notification.user-left {
  background-color: #fce4ec;
  border-left-color: #c2185b;
}

.notification.fade-out {
  animation: fadeOut 0.5s ease-out forwards;
}

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

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

/* Responsive */
@media (max-width: 600px) {
  .container {
    padding: 0 12px;
  }

  .header-title {
    font-size: 18px;
  }

  .post-item {
    padding: 12px 16px;
  }

  .post-item {
    border-radius: 0;
    border-left: none;
    border-right: none;
  }
}
