* {
    font-family: sans-serif;
    box-sizing: border-box;
}

body{
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    line-height: 1.6;
    margin: 0;
}

.header {
    padding: .5em;
    background-color: darkgray;
    border-radius: 7px;
    position: sticky;
    top: 0;
}

.header .nav {
    display: flex;
    gap: 10px;
}

.nav > a {
    padding: 10px 15px;
    text-decoration: none;
    text-align: center;
    display: block;
    color: black;
    font-size: .99em;
}

.nav a:hover {
    background-color: #7ebeb6;
    border-radius: 5px;
    color: white;
}

.nav ~ .pfp {
    margin-left: auto;
}

.pfp{
    max-height: 40px;
    height: 40px;
    width: 40px;
    border-radius: 50%;
}   

.pfp:hover{
    opacity: 80%;
    transform: scale(1.1);
}

.main{
    flex:1;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-y: auto;
    gap: 1em;
    
}

.post{
    display: flex;
    flex-direction: column;
    gap: 0.25em;
    width: 50%;
    max-width: 500px;
    background-color: rgb(234, 232, 232);
    border-radius: 5px;
    padding: 10px;
    margin: 1em auto;
}

.post-header{
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.post-header + .post-image {
    margin-top: 10px;
}

.post-image{
    width: 100%;
    height: auto;
}

.like-button{
    font-size: 2em;
    border: none;
    background: none;
    cursor: pointer;
    align-self: flex-start;
}

.like-button:hover {
    transform: scale(1.2);
}

#login-box {
  text-align: center;
  background-color: #eae8e8;
  border-radius: 10px;
  padding: 20px;
  max-width: 300px;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 1em auto;
}

.login-header{
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.login-btn {
  display: block;
  background: #2f5ea8;
  color: white;
  border: none;
  padding: 5px 15px;
  margin: 12px auto 0;
}

.login-btn:hover {
  background-color: #1c3f7a;
}

.login-text {
  margin: 4px 0;
}

/* a {
  color: #007bff;
  text-decoration: none;
} */
.login-link {
  color: #007bff;
  text-decoration: none;
}

.login-link:hover {
  text-decoration: underline;
}

.footer {
    text-align: center;
    background-color: darkgray;
    border-radius: 7px;
    position: sticky;
    bottom: 0;
    padding: .5em;
}

@media (min-width: 800px) {
    .header,
    .nav {
        display: flex;
    }
    .header {
        flex-direction: column;
        align-items: center;
    }
}

@media (min-width: 1000px) {
    .header {
        flex-direction: row;
        justify-content: space-between;
    }
}

.profile-menu {
  position: relative;
  display: inline-block;
}

.dropdown {
  display: none;
  position: absolute;
  right: 0;
  top: 50px;
  background-color: #f1f1f1;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  border-radius: 8px;
  padding: 10px 15px;
  z-index: 1000;
  min-width: 150px;
}

.dropdown.show {
  display: block;
}

.dropdown p {
  margin: 5px 0;
  color: #333;
}

.dropdown .logout {
  display: block;
  margin-top: 8px;
  color: #333;
  text-decoration: none;
}

.dropdown .logout:hover {
  text-decoration: underline;
}

/* ===== add-post page styles (scoped) - moved from res/css/addPost.css ===== */

.add-post {
  --header: #d9d9d9;
  --panel: #e9e9e9;
  --ink: #222;
  --muted: #666;
  --btn: #1e4d8a;
  --btn-ink: #fff;
  --hover: #cfcfcf;
}

.add-post * {
  box-sizing: border-box;
  font-family: system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
}

.add-post {
  margin: 0;
  color: var(--ink);
  background: #fff;
}

.add-post .header {
  margin: 16px;
  background: var(--header);
  border-radius: 14px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.add-post .nav {
  display: flex;
  gap: 8px;
}

.add-post .nav a {
  padding: 6px 10px;
  border-radius: 6px;
  text-decoration: none;
  color: #000;
}

.add-post .nav a:hover {
  background: var(--hover);
}

.add-post .nav a.active {
  background: #cfcfcf;
}

.add-post .nav a.active:hover {
  background: var(--hover);
}

.add-post .pfp {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
}

.add-post .main {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 20px;
}

.add-post .post {
  width: min(460px, 92vw);
  background: var(--panel);
  border-radius: 16px;
  padding: 18px 18px 20px;
}

.add-post .post-header {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: .5rem;
}

.add-post .post-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.add-post .post-form label {
  font-weight: 600;
}

.add-post #createForm {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.add-post .row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.add-post .row>label {
  width: 110px;
  color: var(--muted);
  font-weight: 600;
  line-height: 1.2;
}

.add-post textarea,
.add-post input[type="file"] {
  font: inherit;
  color: inherit;
}

.add-post textarea {
  height: 120px;
  resize: vertical;
  width: 100%;
  border: 1px solid #cfcfcf;
  border-radius: 6px;
  padding: 8px;
  background: #fff;
}

.add-post textarea::placeholder {
  opacity: .6;
}

.add-post .filewrap {
  width: 100%;
}

.add-post input[type="file"] {
  width: 100%;
  padding: 6px;
  border: 1px solid #a7a7a7;
  background: #d0d0d0;
  border-radius: 4px;
}

.add-post .filewrap+small {
  color: #777;
}

.add-post .row~.actions {
  margin-top: 4px;
}

.add-post .actions {
  display: flex;
  justify-content: center;
  gap: .5rem;
}

.add-post .btn {
  background: var(--btn);
  color: var(--btn-ink);
  border: none;
  border-radius: 6px;
  padding: 10px 16px;
  font-weight: 700;
  cursor: pointer;
}

.add-post .btn.ghost {
  background: transparent;
  color: #111;
  border: 1px solid #ccc;
}

.add-post .btn:focus {
  outline: 2px solid #000;
  outline-offset: 2px;
}

.add-post .note {
  margin: 4px 0 0 122px;
  color: #777;
  font-size: 12px;
}

@media (max-width:520px) {
  .add-post .row {
    flex-direction: column;
  }

  .add-post .row>label {
    width: auto;
  }

  .add-post .note {
    margin-left: 0;
  }
}

/* End add-post scoped styles */
