.body {
  background: #eadcc7;
}

.app-header {
  font-family: "Comic Sans MS", "Comic Sans", cursive;
  font-size: 32px;
  font-style: italic;
  text-align: center;
  padding: 20px;
  color: #6f5140;
  background: #f2e9d9;
  letter-spacing: 2px;
}

.header-p {
  font-family: "Comic Sans MS", "Comic Sans", cursive;
  font-size: 25px;
  font-weight: 600;
  font-style: italic;
  letter-spacing: 1px;
  color: #a26f5f;
}

.top-controls {
  padding-top: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.counter {
  font-size: 16px;
  font-weight: 600;
  color: #6f5140;
  border: 1px solid #b48a62;
  background: #fff3de;
  color: #6f5140;
  border-radius: 8px;
  padding: 8px 10px;
}

.form-toggle {
  font-size: 16px;
  font-weight: 600;
  padding: 10px 20px;
  border: 1px solid #b48a62;
  border-radius: 8px;
  background: #fff3de;
  color: #6f5140;
  cursor: pointer;
}

.form-toggle:hover {
  background: #d79366;
}

.form-container {
  max-height: 520px;
  overflow: hidden;
  display: flex;
  justify-content: center;
  margin-top: 20px;
  margin: 24px 0 28px;
  transform: translateY(0);
  transition:
    max-height 0.9s ease,
    opacity 0.9s ease,
    transform 0.9s ease,
    margin 0.9s ease;
  opacity: 1;
}

.form-container.collapsed {
  max-height: 0;
  opacity: 0;
  transform: translateY(-8px);
  margin: 0;
  pointer-events: none;
}

.upload-form {
  display: flex;
  flex-direction: column;
  padding: 20px;
  width: 75%;
  max-width: 760px;
  margin: 0 auto;
  background-color: #ffffff;
}

.form-title {
  margin-bottom: 10px;
}

.form-author {
  margin-bottom: 10px;
}

.form-image-url {
  margin-bottom: 10px;
}

.form-input {
  padding: 6px;
  font-size: 16px;
  width: 100%;
  border-radius: 16px;
}

.form-button {
  font-family: "Comic Sans MS", "Comic Sans", cursive;
  font-style: italic;
  padding: 10px;
  font-size: 16px;
  border-radius: 16px;
  cursor: pointer;
  width: 120px;
  margin-top: 10px;
  align-self: center;
  color: #fcfcfc;
  background-color: #6f5140;
  cursor: pointer;
}

.form-button:hover {
  background: #9d4408;
}

.footer {
  display: flex;
  justify-content: center;
  padding: 18px 0;
  margin-top: 24px;
}

.footer-child {
  font-family: "Comic Sans MS", "Comic Sans", cursive;
  font-style: italic;
  font-size: 16px;
  text-decoration: none;
  color: #fcfcfc;
  background-color: #6f5140;
  border-radius: 16px;
  padding: 10px 20px;
}

.gallery {
  max-width: 1500px;
  gap: 16px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  padding-top: 15px;
}

.polaroid {
  padding: 12px;
  border: none;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  background-color: #ffffff;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.polaroid:nth-child(odd) {
  transform: rotate(-1deg);
}

.polaroid:nth-child(even) {
  transform: rotate(1deg);
}

.polaroid:hover {
  transform: rotate(0deg) scale(1.05);
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.28);
  z-index: 5;
}

.polaroid-image-wrap {
  width: 100%;
  background: #f7f7f7;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

.polaroid-image {
  width: 100%;
  height: 100%;
  background: rgb(17, 16, 16);
}

.polaroid-outercard {
  display: flex;
  flex-direction: column;
  justify-content: center;
  margin-top: 0px;
  background: rgb(255, 255, 255);
  padding: 8px 10px;
  gap: 8px;
}

.polaroid-actions {
  display: flex;
  gap: 12px;
}

.polaroid-button {
  padding: 6px 12px;
  font-size: 13px;
  border-radius: 8px;
  border: 1px solid #d3d3d3;
  background: #fff;
  color: #4b4b4b;
  cursor: pointer;
  width: auto;
  transition: 0.2s ease;
}

.polaroid-button:hover {
  background: #9d4408;
}

.polaroid-title {
  font-size: 18px;
  font-weight: bold;
}

.polaroid-author {
  font-size: 15px;
  font-weight: bold;
  font-style: italic;
}

.comment-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 420px;
  background: #ffffff;
  border-radius: 12px;
  border: 2px solid #fbfafa;
  padding: 10px;
}

.comment-card-header {
  margin: 0%;
  font-size: 24px;
  font-weight: 700;
}

.comment-card-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 180px;
  overflow-y: auto;
}

.comment-card-comment {
  background: #f4f4f4;
  border-radius: 8px;
  padding: 8px;
  font-size: 14px;
}

.comment-card-comment-details {
  background: transparent;
  font-size: 23px;
  color: #333;
}

.comment-card-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0;
  background: transparent;
}

.comment-card-input {
  padding: 8px 10px;
  font-size: 14px;
  width: 100%;
  border: 1px solid #bbb;
  border-radius: 12px;
}

.comment-card-button {
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
  border-radius: 8px;
  border: none;
  background: #6f5140;
  color: #fff;
  cursor: pointer;
}

.comment-card-button:hover {
  background: #9d4408;
}

.empty-gallery-message {
  width: 100%;
  text-align: center;
  font-family: "Comic Sans MS", "Comic Sans";
  font-size: 28px;
  font-weight: 600;
  font-style: italic;
  color: #a26f5f;
  padding: 30px 10px;
}

.comment-page-prev,
.comment-page-next,
.comment-delete-btn {
  border: none;
  border-radius: 999px;
  width: 22px;
  height: 22px;
  background: #ececec;
  color: #666;
  cursor: pointer;
  line-height: 1;
  padding: 0;
}

.auth-section {
  width: min(92%, 980px);
  margin: 24px auto 12px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sign-in-form {
  display: flex;
  justify-content: center;
  width: 100%;
}

.sign-in {
  display: flex;
  flex-direction: column;
  padding: 20px;
  width: 75%;
  max-width: 760px;
  margin: 0 auto;
  background-color: #ffffff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  border-radius: 6px;
  gap: 8px;
}

.sign-in h2 {
  margin-top: 0;
  margin-bottom: 8px;
}

.form-username,
.form-password,
.form-pfp {
  margin-bottom: 10px;
}

.auth-section {
  width: min(92%, 980px);
  margin: 24px auto 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

#auth-form-btn {
  width: auto;
  min-width: 240px;
  padding: 10px 24px;
}

.session-controls {
  display: flex;
  justify-content: center;
  margin-top: 8px;
}

.gallery-home {
  width: min(94%, 1500px);
  margin: 20px auto 0;
}

.home-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
}

.gallery-directory {
  min-height: 40px;
  justify-content: center;
  gap: 16px;
}

.gallery-detail {
  width: min(94%, 1500px);
  margin: 12px auto 0;
}

.selected-gallery-header {
  text-align: center;
  color: #6f5140;
  margin: 18px 0 10px;
}

.selected-gallery-header h2 {
  margin: 0;
  font-size: 32px;
}

.hidden {
  display: none !important;
}

.gallery-polaroid .polaroid-actions {
  justify-content: center;
}

.gallery-polaroid .polaroid-button {
  min-width: 110px;
}

.app-message {
  width: fit-content;
  max-width: 420px;
  margin: 16px auto;
  padding: 10px 14px;
  border-radius: 10px;
  background: #fff3de;
  border: 1px solid #b48a62;
  color: #6f5140;
  font-size: 15px;
  font-weight: 600;
  text-align: center;
}

.sign-in-form {
  max-height: 520px;
  overflow: hidden;
  transition: max-height 0.5s ease;
}

.sign-in-form.collapsed {
  max-height: 0;
}

.home-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
}

.home-header h2 {
  font-size: 42px;
}

.gallery-home {
  margin-top: 28px;
}

.updates-indicator {
  margin-top: 8px;
  padding: 10px 16px;
  border: 1px solid #b48a62;
  border-radius: 10px;
  background: #d79366;
  color: white;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

.updates-indicator:hover {
  background: #9d4408;
}

@media (max-width: 640px) {
  .auth-section {
    width: 94%;
    margin-top: 16px;
  }

  .sign-in {
    width: 94%;
    padding: 14px;
  }

  .auth-actions {
    flex-direction: column;
    align-items: center;
  }

  .session-controls {
    margin-top: 4px;
  }

  .gallery-home,
  .gallery-detail {
    width: 96%;
  }

  .selected-gallery-header h2 {
    font-size: 26px;
  }
}

/* We are now makin it mobile friendlyv */
@media (max-width: 640px) {
  .app-header {
    font-size: 24px;
    padding: 14px;
    letter-spacing: 1px;
  }

  .app-header h1 {
    font-size: 32px;
    letter-spacing: 1px;
  }

  .header-p {
    font-size: 20px;
  }

  .top-controls {
    padding-top: 8px;
    gap: 6px;
    margin-bottom: 16px;
  }

  .counter,
  .form-toggle {
    font-size: 14px;
    padding: 8px 10px;
  }

  .upload-form {
    width: 94%;
    padding: 14px;
  }

  .form-input {
    width: 100%;
    font-size: 15px;
  }

  .form-button {
    width: 100%;
    max-width: 220px;
    align-self: center;
  }

  .gallery {
    justify-content: center;
    gap: 12px;
    padding: 0 8px;
  }

  .polaroid {
    width: 92%;
    max-width: 340px;
    margin: 0 auto;
    padding: 8px;
    transform: none;
    transition: none;
  }

  .polaroid:nth-child(odd),
  .polaroid:nth-child(even) {
    transform: none;
  }

  .polaroid:hover {
    transform: none;
  }

  .polaroid-image-wrap {
    max-height: 260px;
  }

  .polaroid-image {
    height: auto;
  }

  .polaroid-title,
  .polaroid-author {
    font-size: 16px;
  }

  .polaroid-actions {
    gap: 8px;
    flex-wrap: wrap;
  }

  .polaroid-button {
    width: auto;
    padding: 7px 10px;
    font-size: 13px;
  }

  .comment-card {
    max-width: 100%;
  }

  .comment-card-button {
    width: 100%;
  }
}
