* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: #f0f2f5;
  color: #1a1a2e;
}
.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 20px;
}

/* Navbar */
.navbar {
  background: #1a1a2e;
  color: white;
  padding: 12px 0;
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}
.navbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.navbar .brand {
  font-size: 24px;
  font-weight: bold;
  color: #e94560;
  text-decoration: none;
}
.nav-right {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
}
.nav-link {
  color: white;
  text-decoration: none;
  font-size: 16px;
  padding: 5px 10px;
  border-radius: 5px;
  transition: background 0.3s;
}
.nav-link:hover {
  background: #16213e;
}
.admin-link {
  background: #e94560;
}
.logout-link {
  background: #533483;
}

/* Auth pages */
.auth-page {
  background: linear-gradient(135deg, #1a1a2e, #16213e);
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
}
.auth-container {
  width: 100%;
  max-width: 400px;
  padding: 20px;
}
.auth-box {
  background: white;
  padding: 40px 30px;
  border-radius: 15px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}
.auth-box h1 {
  text-align: center;
  color: #e94560;
  margin-bottom: 5px;
}
.auth-box h2 {
  text-align: center;
  margin-bottom: 20px;
  color: #1a1a2e;
}
.form-group {
  margin-bottom: 15px;
}
.form-group input {
  width: 100%;
  padding: 12px 15px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 16px;
}
.btn-primary {
  width: 100%;
  padding: 12px;
  background: #e94560;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.3s;
}
.btn-primary:hover {
  background: #c73652;
}
.alert {
  padding: 10px;
  border-radius: 5px;
  margin-bottom: 15px;
}
.alert-danger {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}
.alert-success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}
.auth-box a {
  color: #e94560;
  text-decoration: none;
}

/* Feed */
.feed-container {
  max-width: 650px;
  margin: 0 auto;
}
.create-post-box {
  background: white;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  margin-bottom: 25px;
}
.create-post-box textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 16px;
  resize: vertical;
  min-height: 80px;
}
.post-form-options {
  display: flex;
  gap: 10px;
  margin-top: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.post-form-options select {
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid #ddd;
}
.btn-image {
  background: #f0f2f5;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.3s;
}
.btn-image:hover {
  background: #e4e6eb;
}
.btn-post {
  background: #e94560;
  color: white;
  border: none;
  padding: 8px 24px;
  border-radius: 6px;
  font-weight: bold;
  cursor: pointer;
}
.btn-post:hover {
  background: #c73652;
}

/* Post card */
.post-card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
  padding: 18px;
  margin-bottom: 20px;
}
.post-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}
.post-user-info {
  flex: 1;
}
.post-privacy {
  margin-left: 8px;
  font-size: 14px;
  opacity: 0.7;
}
.post-time {
  font-size: 12px;
  color: #888;
  margin-left: 8px;
}
.post-content {
  font-size: 16px;
  line-height: 1.6;
  margin-bottom: 12px;
}
.post-image img {
  max-width: 100%;
  border-radius: 8px;
  margin: 10px 0;
}
.post-actions {
  display: flex;
  gap: 20px;
  padding-top: 10px;
  border-top: 1px solid #eee;
  margin-top: 10px;
}
.like-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  gap: 5px;
}
.like-btn:hover {
  opacity: 0.7;
}
.comment-count {
  color: #555;
}
.btn-delete {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 18px;
}
.btn-delete:hover {
  color: red;
}

/* Comments */
.comment-section {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #f0f0f0;
}
.comment-form {
  display: flex;
  gap: 8px;
}
.comment-form input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 20px;
  outline: none;
}
.comment-form button {
  background: #e94560;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 20px;
  cursor: pointer;
}

/* Profile */
.profile-container {
  max-width: 700px;
  margin: 0 auto;
}
.profile-card {
  background: white;
  border-radius: 12px;
  padding: 30px;
  display: flex;
  flex-wrap: wrap;
  gap: 30px;
  align-items: flex-start;
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}
.profile-avatar {
  position: relative;
  flex: 0 0 150px;
}
.profile-avatar img {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid #e94560;
}
.avatar-upload {
  margin-top: 10px;
  text-align: center;
}
.btn-upload {
  background: #1a1a2e;
  color: white;
  padding: 5px 15px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 14px;
  display: inline-block;
}
.profile-info {
  flex: 1;
}
.profile-info h2 {
  margin-bottom: 5px;
}
.bio {
  color: #555;
  margin: 8px 0;
}
.profile-stats {
  display: flex;
  gap: 20px;
  margin: 15px 0;
}
.profile-edit input, .profile-edit textarea {
  width: 100%;
  padding: 8px 12px;
  margin: 5px 0;
  border: 1px solid #ddd;
  border-radius: 6px;
}
.profile-actions {
  margin-top: 10px;
}
.btn-follow {
  background: #e94560;
  color: white;
  border: none;
  padding: 8px 20px;
  border-radius: 20px;
  cursor: pointer;
}
.btn-unfollow {
  background: #888;
  color: white;
  border: none;
  padding: 8px 20px;
  border-radius: 20px;
  cursor: pointer;
}

/* Friends */
.friends-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 15px;
  margin-top: 20px;
}
.friend-card {
  background: white;
  padding: 15px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 15px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.avatar-sm {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  object-fit: cover;
}
.btn-link {
  color: #e94560;
  text-decoration: none;
  font-size: 14px;
}

/* Chat */
.chat-container {
  display: flex;
  height: 70vh;
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 15px rgba(0,0,0,0.1);
}
.chat-sidebar {
  width: 30%;
  background: #f8f9fa;
  border-right: 1px solid #ddd;
  padding: 15px;
  overflow-y: auto;
}
.chat-sidebar h3 {
  margin-bottom: 15px;
}
.friend-list {
  list-style: none;
  padding: 0;
}
.chat-friend {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
}
.chat-friend:hover {
  background: #e9ecef;
}
.last-msg {
  font-size: 13px;
  color: #888;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 120px;
}
.chat-window {
  flex: 1;
  display: flex;
  flex-direction: column;
}
.chat-header {
  padding: 15px;
  border-bottom: 1px solid #ddd;
  background: #f8f9fa;
  font-weight: bold;
}
.chat-messages {
  flex: 1;
  padding: 15px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.msg-sent {
  align-self: flex-end;
  background: #e94560;
  color: white;
  padding: 8px 14px;
  border-radius: 18px 18px 0 18px;
  max-width: 70%;
}
.msg-received {
  align-self: flex-start;
  background: #f0f2f5;
  padding: 8px 14px;
  border-radius: 18px 18px 18px 0;
  max-width: 70%;
}
.chat-input {
  display: flex;
  gap: 10px;
  padding: 15px;
  border-top: 1px solid #ddd;
}
.chat-input input {
  flex: 1;
  padding: 10px 16px;
  border: 1px solid #ddd;
  border-radius: 25px;
  outline: none;
}
.chat-input button {
  background: #e94560;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 25px;
  cursor: pointer;
}
.chat-input button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Admin */
.admin-section {
  background: white;
  padding: 20px;
  border-radius: 10px;
  margin-bottom: 30px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.admin-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}
.admin-table th, .admin-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #eee;
  text-align: left;
}
.admin-table th {
  background: #f8f9fa;
}
.btn-sm {
  background: #1a1a2e;
  color: white;
  border: none;
  padding: 4px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
}
.btn-sm:hover {
  background: #16213e;
}
.btn-danger {
  background: #dc3545;
}
.btn-danger:hover {
  background: #c82333;
}

/* Responsive */
@media (max-width: 768px) {
  .navbar .container {
    flex-direction: column;
    gap: 10px;
  }
  .nav-right {
    justify-content: center;
  }
  .profile-card {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .chat-container {
    flex-direction: column;
    height: auto;
  }
  .chat-sidebar {
    width: 100%;
    height: 200px;
    border-right: none;
    border-bottom: 1px solid #ddd;
  }
  .chat-window {
    height: 400px;
  }
}