body {
  margin: 0;
  background-color: #f7f4ef;
  min-height: 1080px;
  display: flex;
  flex-direction: column;
}

[hidden] {
  display: none !important;
}

/* Header */
.row {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  box-sizing: border-box;
}

#header {
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
}

.col-8 {
  flex: 1 1 auto;
  min-width: 0;
  text-align: center;
}

.col-2 {
  display: flex;
  flex: 0 1 auto;
  min-width: 0;
  align-items: center;
}

/* Username (replacing total img) */
.total-num-p {
  border-radius: 15px;
  padding: 8px 10px;
  font-family: monospace;
  font-size: 11px;
  background-color: #36322f;
  color: #e2ddd5;
  white-space: nowrap;
  margin-left: 12px;
}

/* title */
.title {
  font-family: cursive;
  color: #2c2825;
}

/* Left side */
.header-side-left {
  justify-content: flex-start;
  padding-left: 16px;
}

/* Right side */
.header-side-right {
  justify-content: flex-end;
  padding-right: 16px;
}

#nav-auth {
  flex-direction: row;
  gap: 8px;
  flex-wrap: nowrap;
}

.option-btn {
  border: 0px;
  border-radius: 15px;
  padding: 8px;
  font-family: monospace;
  background-color: #36322f;
  color: #e2ddd5;
  cursor: pointer;
  transition:
    transform 0.2s ease,
    background-color 0.2s ease,
    box-shadow 0.2s ease;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  white-space: nowrap;
}
.option-btn:hover {
  background-color: #413d39;
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
}
.option-btn:active {
  transform: translateY(1px);
  box-shadow: 0 2px 4px -1px rgba(0, 0, 0, 0.2);
  background-color: #2e2b28;
}

.nav-option {
  font-size: 11px;
  padding: 5px 10px;
}

hr {
  margin-top: 0;
  border: none;
  border-top: 2px solid #c8c4be;
  margin-bottom: 25px;
}

/*  Main area */
#home-view {
  padding: 0 50px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

#galleries-pagination {
  margin-top: auto;
  padding-bottom: 10px;
}

#gallery-view {
  flex: 1;
  padding: 20px 50px 0;
  box-sizing: border-box;
}

#gallery-header-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 4px 0;
}

.update-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  background-color: #36322f;
  color: #e2ddd5;
  padding: 10px 18px;
  border-radius: 8px;
  margin-bottom: 20px;
  font-family: monospace;
  font-size: 13px;
}

.update-banner button {
  font-family: monospace;
  font-size: 11px;
  padding: 4px 12px;
  border: 1px solid #c8c4be;
  border-radius: 20px;
  background: transparent;
  color: #e2ddd5;
  cursor: pointer;
  transition: background-color 0.2s;
}

.update-banner button:hover {
  background-color: rgba(255, 255, 255, 0.15);
}


#galleries-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

.gallery-card {
  background-color: #fff;
  border-radius: 12px;
  padding: 22px 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.07);
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition:
    transform 0.2s,
    box-shadow 0.2s;
}

.gallery-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.gallery-card-name {
  font-family: cursive;
  font-size: 17.6px;
  color: #2c2825;
  margin: 0;
}

.gallery-card-meta {
  font-family: monospace;
  font-size: 11px;
  color: #a09b94;
  margin: 0;
}

.view-gallery-btn {
  font-family: monospace;
  font-size: 11px;
  padding: 6px 14px;
  border: none;
  border-radius: 15px;
  background-color: #36322f;
  color: #e2ddd5;
  cursor: pointer;
  align-self: flex-start;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition:
    background-color 0.2s,
    transform 0.15s;
}

.view-gallery-btn:hover {
  background-color: #413d39;
  transform: translateY(-1px);
}

/* paginatin  */
.pagination-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-bottom: 5px;
  font-family: monospace;
  font-size: 13px;
  color: #7a7a72;
}

.pagination-row button {
  font-family: monospace;
  font-size: 11px;
  padding: 6px 14px;
  border: none;
  border-radius: 15px;
  background-color: #36322f;
  color: #e2ddd5;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: background-color 0.2s;
}

.pagination-row button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.pagination-row button:not(:disabled):hover {
  background-color: #413d39;
}

.gallery-nav-row {
  align-items: center;
  gap: 16px;
  padding: 12px 0 8px;
}

.gallery-view-title {
  font-family: cursive;
  color: #2c2825;
  margin: 0;
  font-size: 22.4px;
}


#upload-toggle-bar {
  display: flex;
  justify-content: flex-end;
  padding: 0 0 14px;
}

.image-preview {
  display: flex;
  flex-basis: 33.33%;
  max-width: 800px;
  max-height: 400px;
  min-height: 200px;
  background-color: #e2ddd5;
  border-radius: 8px;
  margin-left: 8.33%;
  align-items: center;
  justify-content: center;
  font-family: serif;
  font-size: 18px;
  margin-bottom: 25px;
  overflow: hidden;
}

.image-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
}

.image-info {
  display: flex;
  flex-direction: column;
  flex-basis: 41.67%;
  margin-left: 8.33%;
  margin-right: 8.33%;
  gap: 12px;
  background-color: transparent;
}

.img-input {
  border: none;
  border-bottom: 1px solid #c8c4be;
  background-color: transparent;
  font-family: serif;
  font-size: 18px;
  color: #2c2825;
  width: 100%;
  padding-bottom: 6px;
  outline: none;
}

.img-input::placeholder {
  color: #a09b94;
}

.labels-img {
  font-family: monospace;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.88px;
  color: #7a7a72;
  margin: 0;
}

.img-btn {
  margin-top: 15px;
}

.discard-btn {
  border: 0px;
  padding: 8px;
  margin-left: 15px;
  border-radius: 15px;
  font-family: monospace;
  cursor: pointer;
  transition:
    transform 0.2s ease,
    background-color 0.2s ease,
    box-shadow 0.2s ease;
  box-shadow: 0 3px 4px -1px rgba(0, 0, 0, 0.1);
}

.discard-btn:hover {
  background-color: #e2ddd5;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
}

input.img-input[type="file"] {
  display: none;
}

.file-input-label {
  display: inline-block;
  padding: 7px 16px;
  background-color: #e2ddd5;
  color: #2c2825;
  font-family: monospace;
  font-size: 12px;
  border-radius: 20px;
  cursor: pointer;
  transition:
    background-color 0.2s ease,
    box-shadow 0.2s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  margin-top: 4px;
}

.file-input-label:hover {
  background-color: #d6d1cb;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.file-name-display {
  font-family: monospace;
  font-size: 12px;
  color: #a09b94;
  margin-top: 6px;
  font-style: italic;
}


.image-card {
  display: flex;
  margin-top: 50px;
  margin-left: 8.33%;
  margin-right: 8.33%;
}

.image-card-photo-wrap {
  position: relative;
  display: flex;
  flex: 0 0 40%;
  height: 340px;
  background-color: #e2ddd5;
  border-radius: 12px;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.image-card-photo {
  width: 100%;
  height: 100%;
  border-radius: 12px;
  object-fit: cover;
  transition: transform 0.4s ease;
  cursor: pointer;
}

.image-card-photo-wrap:hover .image-card-photo {
  transform: scale(1.03);
}

.img-delete-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background-color: #c0392b;
  color: #fff;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  z-index: 10;
}

.image-card-photo-wrap:hover .img-delete-btn {
  opacity: 1;
}

.img-delete-btn:hover {
  transform: scale(1.1);
  background-color: #a93226;
}

.image-card-info {
  display: flex;
  flex-direction: column;
  flex: 1;
  margin-left: 5%;
  gap: 8px;
  background-color: transparent;
}

.image-card-title {
  font-family: cursive;
  font-size: 20.8px;
  color: #2c2825;
  margin: 0 0 4px;
}

.image-card-author {
  font-family: monospace;
  font-size: 11px;
  color: #a09b94;
  margin: 0 0 8px;
}

/* comments section header */
.comments-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.comments-label {
  font-family: monospace;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.1px;
  color: #a09b94;
  margin: 0;
}

.more-btn {
  font-family: monospace;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.66px;
  color: #7a7a72;
  background: transparent;
  border: 1px solid #c8c4be;
  border-radius: 20px;
  padding: 3px 10px;
  cursor: pointer;
  transition:
    background 0.15s,
    color 0.15s;
}

.more-btn:hover {
  background: #36322f;
  color: #e2ddd5;
  border-color: #36322f;
}

.comments-list {
  flex: 1;
  overflow-y: auto;
  margin-bottom: 10px;
}

.comment-item {
  display: flex;
  flex-direction: column;
  padding: 12px 0;
  border-bottom: 1px dashed #d6d1cb;
  background: transparent;
  margin-bottom: 0;
}

.comment-item:first-child {
  border-top: 1px dashed #d6d1cb;
}

.comment-meta {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 5px;
}

.comment-author {
  font-family: serif;
  font-size: 14px;
  font-weight: 700;
  color: #2c2825;
}

.comment-date {
  font-family: monospace;
  font-size: 11px;
  color: #a09b94;
  font-weight: 400;
}

.comment-text {
  font-family: serif;
  font-size: 14px;
  color: #3a3531;
  margin: 0 0 6px 0;
  line-height: 1.5;
}

.comment-del-btn {
  font-family: monospace;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  background: transparent;
  border: none;
  color: #c8c4be;
  cursor: pointer;
  padding: 0;
  align-self: flex-end;
  transition: color 0.15s;
}

.comment-del-btn:hover {
  color: #c0392b;
}

.comments-empty {
  font-family: serif;
  font-size: 14px;
  color: #a09b94;
  margin: 0 0 8px 0;
  font-style: italic;
}

.comments-auth-note {
  font-family: monospace;
  font-size: 12px;
  color: #a09b94;
  margin: 8px 0;
}

.comment-input-row {
  display: flex;
  align-items: center;
  background-color: #e2ddd5;
  border-radius: 35px;
  padding: 8px 8px 8px 18px;
  margin-top: 18px;
  margin-bottom: 18px;
}

.comment-text-input {
  flex: 1;
  border: none;
  background-color: transparent;
  font-family: serif;
  font-size: 16px;
  color: #2c2825;
  outline: none;
}

.comment-text-input::placeholder {
  color: #a09b94;
}

.send-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background-color: #36322f;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
  color: #e2ddd5;
  font-size: 14px;
  transition:
    transform 0.2s ease,
    background-color 0.2s ease;
}

.send-btn:hover {
  background-color: #413d39;
  transform: scale(1.05);
}

.send-btn:active {
  transform: scale(0.97);
  background-color: #2e2b28;
}

#comment-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(44, 40, 37, 0.55);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

/* Full-size image lightbox, shown when you click an image thumbnail. */
#image-lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(44, 40, 37, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

#image-lightbox {
  position: relative;
  max-width: 1728px;
  max-height: 972px;
}

#image-lightbox-photo {
  display: block;
  max-width: 1728px;
  max-height: 972px;
  border-radius: 8px;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.35);
}

#image-lightbox-close {
  position: absolute;
  top: -14px;
  right: -14px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: #f7f4ef;
  color: #2c2825;
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
}

#comment-modal {
  background: #f7f4ef;
  border-radius: 12px;
  width: min(560px, 1766.4px);
  max-height: 864px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.25);
  overflow: hidden;
}

#comment-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px 14px;
  border-bottom: 1px solid #e2ddd5;
}

#comment-modal-title {
  font-family: monospace;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.91px;
  color: #2c2825;
  text-transform: uppercase;
}

#comment-modal-close {
  background: transparent;
  border: none;
  font-size: 18px;
  color: #7a7a72;
  cursor: pointer;
  line-height: 1;
  padding: 0 2px;
  transition: color 0.15s;
}

#comment-modal-close:hover {
  color: #2c2825;
}

#comment-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 22px;
}

#comment-modal-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 22px;
  border-top: 1px solid #e2ddd5;
}

#comment-modal-pagination button {
  font-family: monospace;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.6px;
  background: #36322f;
  color: #e2ddd5;
  border: none;
  border-radius: 20px;
  padding: 6px 14px;
  cursor: pointer;
  transition:
    background 0.15s,
    opacity 0.15s;
}

#comment-modal-pagination button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

#comment-modal-pagination button:not(:disabled):hover {
  background-color: #413d39;
}

#modal-page-info {
  font-family: monospace;
  font-size: 11px;
  color: #7a7a72;
  letter-spacing: 0.55px;
}

/*  Auth Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(44, 40, 37, 0.55);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-box {
  background: #f7f4ef;
  border-radius: 12px;
  width: min(400px, 1766.4px);
  padding: 36px 28px 28px;
  position: relative;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.modal-x-btn {
  position: absolute;
  top: 12px;
  right: 14px;
  background: transparent;
  border: none;
  font-size: 22px;
  color: #7a7a72;
  cursor: pointer;
  line-height: 1;
  padding: 0;
  transition: color 0.15s;
}

.modal-x-btn:hover {
  color: #2c2825;
}

.modal-title-h {
  font-size: 22.4px;
  margin: 0 0 6px;
}

#signin-panel,
#signup-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.form-error {
  font-family: monospace;
  font-size: 12px;
  color: #c0392b;
  margin: 0;
}

.btn-full {
  width: 100%;
  margin-top: 4px;
  padding: 10px;
  font-size: 14px;
}

.modal-switch-p {
  font-family: monospace;
  font-size: 12px;
  color: #7a7a72;
  text-align: center;
  margin: 4px 0 0;
}

.link-btn {
  background: transparent;
  border: none;
  color: #36322f;
  font-family: monospace;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}

.empty-state {
  text-align: center;
  color: #7a7a72;
  font-family: serif;
  font-size: 16px;
  padding: 48px 0;
  font-style: italic;
}

#footer {
  text-align: center;
  padding: 0 0 20px 0;
  font-family: monospace;
  font-size: 12px;
  color: #a09b94;
}

#footer a {
  color: #a09b94;
  text-decoration: none;
}

#footer a:hover {
  color: #2c2825;
}

/* phone view */
@media (max-width: 600px) {
  #header {
    gap: 6px;
  }
  .col-8 {
    text-align: left;
  }
  .col-8 .title {
    font-size: 20px;
  }
  .header-side-left {
    padding-left: 6px;
  }
  .header-side-right {
    padding-right: 6px;
  }
  #nav-username {
    display: none !important;
  }
  #back-btn {
    font-size: 10px;
    padding: 6px 8px;
  }
  #nav-auth {
    flex-wrap: nowrap;
    gap: 4px;
  }
  #nav-auth .option-btn {
    font-size: 10px;
    padding: 6px 8px;
  }

  .image-preview {
    flex-basis: 100%;
    margin-left: 16px;
    margin-right: 16px;
    max-height: 220px;
    width: calc(100% - 32px);
  }
  .image-info {
    flex-basis: 100%;
    margin-left: 16px;
    margin-right: 16px;
  }

  .image-card {
    flex-direction: column;
    margin-left: 16px;
    margin-right: 16px;
  }
  .image-card-photo-wrap {
    flex: none;
    width: 100%;
    height: 240px;
  }
  .image-card-info {
    margin-left: 0;
    margin-top: 16px;
  }

  .img-delete-btn {
    opacity: 1;
  }

  #comment-modal {
    width: 1920px;
    max-height: 972px;
    border-radius: 12px 12px 0 0;
  }
  #comment-modal-overlay {
    align-items: flex-end;
  }
}
