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

body {
  font-family: 'Poppins', sans-serif;
  background: #f5f5f5;
}

.hidden {
  display: none !important;
}

/* Auth Split Screen */
.auth-screen {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

.auth-left {
  flex: 1;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  color: white;
  padding: 40px;
  text-align: center;
}

.auth-illustration {
  width: 80%;
  max-width: 500px;
  margin-bottom: 20px;
}

.auth-left h1 {
  font-size: 60px;
  font-weight: 700;
}

.auth-left p {
  font-size: 20px;
  opacity: 0.9;
}

.auth-right {
  flex: 1;
  background: white;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 40px;
}

.auth-box {
  width: 100%;
  max-width: 400px;
}

.auth-box input {
  width: 100%;
  padding: 15px;
  margin: 12px 0;
  border: 1px solid #ddd;
  border-radius: 12px;
  font-size: 16px;
}

.auth-box button {
  width: 100%;
  padding: 15px;
  background: #667eea;
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 18px;
  cursor: pointer;
}

.auth-box p{
  padding-top: 10px
}

.switch-link {
  color: #667eea;
  cursor: pointer;
  font-weight: 600;
}

/* Navbar */
.navbar {
  background: white;
  padding: 15px 40px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo {
  font-size: 28px;
  font-weight: 700;
  color: #667eea;
}

.nav-right a {
  margin-left: 25px;
  text-decoration: none;
  color: #333;
  font-weight: 500;
}

.nav-right a:hover {
  color: #667eea;
}

/* Container */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px;
}

/* Feed */
#feed {
  max-width: 680px;
  margin: 20px auto;
}

.feed-controls {
  max-width: 680px;
  margin: 20px auto;
  background: white;
  padding: 18px;
  border-radius: 20px;
  box-shadow: 0 8px 25px rgba(0,0,0,0.1);
  display: flex;
  align-items: center;
  gap: 15px;
  flex-wrap: wrap;
}

.control-group {
  flex: 1;
  display: flex;
  align-items: center;
  background: #f0f2f5;
  border-radius: 50px;
  padding: 0 15px;
  min-width: 250px;
}

.control-group i {
  color: #667eea;
  font-size: 18px;
}

.control-group input {
  border: none;
  background: transparent;
  padding: 12px;
  width: 100%;
  outline: none;
  font-size: 15px;
}

#sortSelect {
  padding: 12px 18px;
  border: 1px solid #ddd;
  border-radius: 50px;
  background: white;
  font-size: 14px;
  cursor: pointer;
}

.post-card {
  background: white;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
  margin-bottom: 25px;
  transition: transform 0.2s;
}

.post-card:hover {
  transform: translateY(-5px);
}

.post-header {
  padding: 16px 20px 0;
  display: flex;
  align-items: center;
  gap: 14px;
}

.follow-btn {
  background: #667eea;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 30px;
  font-size: 13px;
  cursor: pointer;
  margin-left: auto;
}

.follow-btn.following {
  background: #e0e0e0 !important;
  color: #333 !important;
}

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

.avatar-lg {
  width: 80px;
  height: 80px;
}

.avatar-xl {
  width: 150px;
  height: 150px;
  border: 6px solid white;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.post-content {
  padding: 10px 20px 16px;
  font-size: 15px;
  line-height: 1.6;
}

.post-image {
  width: 100%;
  max-height: 500px;
  object-fit: cover;
}

.post-actions {
  padding: 10px 20px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid #eee;
  margin-top: 10px;
}

.reactions {
  display: flex;
  gap: 18px;
  font-size: 26px;
}

.reaction-btn {
  cursor: pointer;
  transition: all 0.2s;
}

.reaction-btn:hover {
  transform: scale(1.3);
}

.reaction-btn.liked {
  filter: drop-shadow(0 0 8px #ff3040);
}

.likes-count {
  font-size: 14px;
  color: #555;
  font-weight: 500;
}

/* Dashboard */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 25px;
}

.profile-card,
.create-post-card,
.my-posts,
.settings-card {
  background: white;
  padding: 25px;
  border-radius: 16px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.stats {
  display: flex;
  justify-content: space-around;
  margin-top: 20px;
  font-size: 14px;
}

.create-post-card textarea {
  width: 100%;
  height: 100px;
  padding: 15px;
  border-radius: 12px;
  border: 1px solid #ddd;
  resize: none;
}

.create-post-card input {
  width: 100%;
  padding: 12px;
  margin: 10px 0;
  border-radius: 12px;
  border: 1px solid #ddd;
}

.post-btn {
  background: #667eea;
  color: white;
  padding: 12px 20px;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 600;
}


.my-posts {
  background: white;
  border-radius: 20px;
  padding: 28px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.1);
  margin-top: 20px;
}

.my-post-card {
  background: #f9f9ff;
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 18px;
  border-left: 5px solid #667eea;
  transition: all 0.3s ease;
}

.my-post-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 25px rgba(102,126,234,0.15);
}

.my-post-text {
  font-size: 16px;
  color: #333;
  margin-bottom: 12px;
  line-height: 1.6;
  white-space: pre-wrap;
}

.my-post-img {
  width: 100%;
  max-height: 300px;
  border-radius: 12px;
  margin: 10px 0;
  object-fit: cover;
}

.my-post-info {
  margin: 10px 0;
  color: #666;
  font-size: 14px;
}

.my-post-buttons {
  margin-top: 15px;
  display: flex;
  gap: 12px;
}

.btn-edit, .btn-delete {
  padding: 10px 20px;
  border: none;
  border-radius: 50px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-edit {
  background: #007bff;
  color: white;
}

.btn-edit:hover {
  background: #0056b3;
}

.btn-delete {
  background: #dc3545;
  color: white;
}

.btn-delete:hover {
  background: #c82333;
}

.settings-card {
  max-width: 500px;
  margin: 40px auto;
  background: white;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 15px 40px rgba(0,0,0,0.12);
}

.settings-header {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  text-align: center;
  padding: 30px 20px;
}

.settings-header h2 { font-size: 28px; margin-bottom: 8px; }
.settings-header p { opacity: 0.9; }

.setting-item {
  padding: 20px;
  border-bottom: 1px solid #eee;
}

.setting-item label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  margin-bottom: 10px;
  color: #333;
}

.setting-item input {
  width: 100%;
  padding: 14px;
  border: 1px solid #ddd;
  border-radius: 12px;
  font-size: 15px;
}

.setting-actions {
  padding: 25px;
  text-align: center;
  background: #f9f9f9;
}

.save-btn {
  background: #667eea;
  color: white;
  padding: 14px 32px;
  border: none;
  border-radius: 50px;
  font-size: 16px;
  cursor: pointer;
  margin: 0 10px;
}

.cancel-btn {
  background: #ddd;
  color: #333;
  padding: 14px 32px;
  border: none;
  border-radius: 50px;
  cursor: pointer;
}

.post-actions {
  padding: 12px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid #eee;
  font-size: 15px;
}

.left-actions {
  display: flex;
  gap: 20px;
  align-items: center;
}

.comment-btn {
  cursor: pointer;
  color: #666;
  font-weight: 600;
}

.comment-btn:hover {
  color: #1a77f2;
}

.post-comments {
  border-top: 1px solid #eee;
  padding: 15px 20px;
  background: #f8f9fa;
}

.comments-list {
  max-height: 200px;
  overflow-y: auto;
  margin-bottom: 12px;
}

.comment-item {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
  align-items: flex-start;
}

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

.comment-content {
  flex: 1;
  background: white;
  padding: 10px 14px;
  border-radius: 18px;
  font-size: 14px;
}

.comment-content strong {
  font-weight: 600;
  color: #1a77f2;
}

.comment-content p {
  margin: 4px 0;
  word-wrap: break-word;
}

.comment-content small {
  color: #888;
  font-size: 12px;
}

.add-comment {
  display: flex;
  gap: 10px;
  align-items: center;
}

.add-comment input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid #ddd;
  border-radius: 50px;
  font-size: 14px;
  outline: none;
}

.add-comment input:focus {
  border-color: #667eea;
}

.add-comment button {
  background: #667eea;
  color: white;
  border: none;
  padding: 10px 16px;
  border-radius: 50px;
  cursor: pointer;
  font-weight: 600;
}

/* Profile Page */
#profilePage {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  color: white;
  padding: 40px 20px;
}

.profile-header {
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
}

.profile-header h1 {
  font-size: 32px;
  margin: 20px 0 10px;
}

.stats {
  gap: 50px;
  font-size: 18px;
}

.stats strong {
  display: block;
  font-size: 24px;
  font-weight: 700;
}

.edit-profile-form {
  background: white;
  color: #333;
  padding: 30px;
  border-radius: 20px;
  max-width: 500px;
  margin: 30px auto;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
}

.edit-profile-form input,
.edit-profile-form textarea {
  width: 100%;
  padding: 14px;
  margin: 12px 0;
  border: 1px solid #ddd;
  border-radius: 12px;
}

.edit-profile-form button {
  background: #667eea;
  color: white;
  padding: 14px 30px;
  border: none;
  border-radius: 12px;
  cursor: pointer;
}

/* Settings */
#settingsPage {
  background: #f0f2f5;
  min-height: 100vh;
  padding: 50px 20px;
}

.settings-card {
  max-width: 500px;
  margin: 0 auto;
  text-align: center;
}

/* Responsive */
@media (max-width: 768px) {
  .auth-screen {
    flex-direction: column;
  }

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

  .nav-right a {
    font-size: 14px;
    margin-left: 15px;
  }
}

/* ================= RESPONSIVE NAVBAR WITH DROPDOWN ================= */

/* Desktop nav dikhaye, mobile pe hide */
.desktop-nav {
  display: flex;
}

.mobile-menu-btn {
  display: none;
  cursor: pointer;
}

.mobile-dropdown {
  position: absolute;
  top: 70px;
  right: 20px;
  background: white;
  width: 280px;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
  overflow: hidden;
  z-index: 999;
  animation: slideDown 0.3s ease;
}

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

.dropdown-user {
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
}

.dropdown-user img {
  width: 50px;
  height: 50px;
  border: 3px solid white;
}

.dropdown-user strong {
  font-size: 16px;
}

.dropdown-user small {
  opacity: 0.9;
  font-size: 13px;
}

.mobile-dropdown a {
  display: block;
  padding: 14px 20px;
  color: #333;
  text-decoration: none;
  font-weight: 500;
  transition: 0.2s;
}

.mobile-dropdown a:hover {
  background: #f0f2f5;
  padding-left: 28px;
}

.logout-link {
  color: #e74c3c !important;
  font-weight: 600;
}

.logout-link:hover {
  background: #fdf2f2 !important;
}

.dropdown-divider {
  height: 1px;
  background: #eee;
  margin: 8px 0;
}

/* Mobile View (768px se neeche) */
@media (max-width: 768px) {
  .desktop-nav {
    display: none !important;
  }

  .mobile-menu-btn {
    display: block !important;
  }

  .navbar {
    padding: 15px 20px;
  }

  .logo {
    font-size: 24px;
  }
}

/* ================= DARK / LIGHT THEME TOGGLE ================= */
body.light-mode {
  background: #f5f5f5;
  color: #1a1a1a;
}

body.dark-mode {
  background: #121212;
  color: #e0e0e0 !important;
}

/* Dark mode styles */
.dark-mode .post-card,
.dark-mode .create-post-card,
.dark-mode .profile-card,
.dark-mode .my-posts,
.dark-mode .feed-controls,
.dark-mode .mobile-dropdown {
  background: #1e1e1e !important;
  box-shadow: 0 8px 25px rgba(0,0,0,0.4) !important;
}


.dark-mode .navbar{
  background: #1e1e1e !important;
  color: white !important;
}

.dark-mode .post-card,
.dark-mode .my-post-card {
  background: #252525 !important;
  border-left-color: #667eea !important;
}

.dark-mode .post-content,
.dark-mode .my-post-text,
.dark-mode .comment-content {
  color: #e0e0e0 !important;
}

.dark-mode textarea,
.dark-mode select {
  background: #2d2d2d !important;
  border-color: #444 !important;
  color: #e0e0e0 !important;
}

.dark-mode input::placeholder,
.dark-mode textarea::placeholder {
  color: #888 !important;
}

.dark-mode .post-actions,
.dark-mode .my-post-info,
.dark-mode .comment-content small {
  color: #aaa !important;
  border-color: #444 !important;
}

.dark-mode .comment-content {
  background: #333 !important;
}

.dark-mode .add-comment input {
  background: #333 !important;
  border-color: #555 !important;
}

/* Theme Toggle Button */
.theme-toggle {
  cursor: pointer;
  padding: 10px;
  border-radius: 50%;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-toggle:hover {
  background: #f0f2f5;
}

.dark-mode .theme-toggle:hover {
  background: #333;
}

#themeIcon {
  font-size: 24px;
  color: #667eea;
  transition: all 0.4s ease;
}

.dark-mode #themeIcon {
  color: #ffd43b;
  transform: rotate(180deg);
}