body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: #f5f5f5;
}

/* Header layout */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #2c3e50;
  color: white;
  padding: 1rem 2rem;
  flex-wrap: wrap;
}

header h1 {
  margin: 0;
  font-size: 1.5rem;
}

/* Nav area */
nav {
  display: flex;
  align-items: center;
  position: relative;
}

/* Nav links */
.nav-links {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links li {
  position: relative;
}

/* Dropdown menu */
.dropdown-content {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: #34495e;
  min-width: 150px;
  border-radius: 5px;
  z-index: 1000;
  flex-direction: column;
}

.dropdown-content li a {
  color: white;
  padding: 0.5rem 1rem;
  display: block;
  text-decoration: none;
}

.dropdown-content li a:hover {
  background: #3e5871;
}

/* Show dropdown on hover (desktop) */
.dropdown:hover .dropdown-content {
  display: flex;
}

/* Dropdown parent link */
.dropdown > a {
  text-decoration: none;
  color: white;
  padding: 0.5rem 1rem;
  display: block;
  cursor: pointer;
  border-radius: 5px;
}

.dropdown > a:hover {
  background: #34495e;
}

/* Hamburger button (hidden on desktop) */
.hamburger {
  display: none;
  font-size: 1.5rem;
  background: none;
  border: none;
  color: white;
  cursor: pointer;
}

/* Login button */
.login-btn {
  background: #3498db;
  border: none;
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 5px;
  cursor: pointer;
  font-size: 1rem;
}
.login-btn:hover {
  background: #2980b9;
}

/* Create Post */
.create-post-btn {
  display: inline-block;
  background-color: #007bff;
  color: white;
  text-decoration: none;
  padding: 0.8rem 1.2rem;
  border-radius: 8px;
  font-size: 1rem;
  transition: background-color 0.2s ease;
}

.create-post-btn:hover {
  background-color: #0056b3;
}


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

h1 {
    text-align: center;
    margin-bottom: 20px;
}

.post {
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    padding: 15px;
    margin-bottom: 20px;
}

.post h3 {
    margin: 0 0 10px;
}

.post p {
    margin: 5px 0;
}

.post img {
    max-width: 100%;
    border-radius: 8px;
    margin-top: 10px;
}

#loadMoreBtn {
    display: block;
    margin: 20px auto;
    padding: 10px 20px;
    font-size: 16px;
    cursor: pointer;
    border: none;
    background-color: #007bff;
    color: white;
    border-radius: 5px;
}

#loadMoreBtn:hover {
    background-color: #0056b3;
}
/* Responsive tweaks */
@media (max-width: 700px) {
  .nav-links {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 60px;
    right: 0;
    background: #2c3e50;
    width: 200px;
    border-radius: 5px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
  }

  .nav-links.show {
    display: flex;
  }

  /* Dropdown content always visible in mobile when menu is toggled */
  .dropdown-content {
    position: static;
    display: none;
    background: #2c3e50;
    box-shadow: none;
  }

  .dropdown.show .dropdown-content {
    display: flex;
  }

  header {
    flex-direction: column;
    align-items: flex-start;
  }

  header h1 {
    margin-bottom: 0.5rem;
  }

  .hamburger {
    display: block;
  }

  .nav-links li a {
    padding: 0.75rem 1rem;
  }

  .dropdown > a::after {
    content: " ▼";
  }
}

#loginForm {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  
  background: #fff;
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.15);
  width: 300px;
  text-align: center;
}

#loginForm h2 {
  margin-bottom: 1.5rem;
  color: #333;
  font-size: 1.5rem;
}

/* Input styling */
#loginForm input {
  width: 90%;
  padding: 0.75rem;
  margin: 0.5rem 0;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 1rem;
  transition: border-color 0.3s;
}

#loginForm input:focus {
  border-color: #4a90e2;
  outline: none;
  box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.2);
}

/* Button styling */
#loginForm button {
  width: 100%;
  padding: 0.75rem;
  margin-top: 1rem;
  margin-bottom: 1rem;
  background: #4a90e2;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.3s;
}

#loginForm button:hover {
  background: #357ABD;
}

/* Error popup */
#loginpopup {
  margin-top: 1rem;
  padding: 0.5rem;
  border-radius: 6px;
  background: #ffe0e0;
  color: #d8000c;
  font-size: 0.9rem;
  display: none; /* shown only on login failure */
}

#headerlogo{
  text-align: center;
                    
  line-height: 50px;
  position: relative;
  text-decoration: none;
  color: white;
  font-size: 30px;}




/* ===== Create Post Page ===== */
.create-post-page {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: 100vh;
  background: #f7f8fa;
  padding: 2rem 1rem;
}

.create-post-container {
  background: #fff;
  border-radius: 16px;
  padding: 2rem 2.5rem;
  width: 100%;
  max-width: 700px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.create-post-container h2 {
  text-align: center;
  margin-bottom: 2rem;
  color: #333;
  font-size: 1.75rem;
}

#createPostForm {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

#createPostForm label {
  font-weight: 600;
  color: #444;
}

#createPostForm input[type="text"],
#createPostForm textarea {
  width: 100%;
  padding: 0.9rem;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 1rem;
  resize: vertical;
}

#createPostForm input[type="file"] {
  font-size: 0.95rem;
}

.submit-post-btn {
  background-color: #007bff;
  color: #fff;
  border: none;
  padding: 0.9rem 1.2rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  transition: background-color 0.2s ease;
}

.submit-post-btn:hover {
  background-color: #0056b3;
}

/* Responsive tweaks */
@media (max-width: 600px) {
  .create-post-container {
    padding: 1.5rem;
  }

  .create-post-container h2 {
    font-size: 1.4rem;
  }
}
