/* Post details page styles */

:root {
  --vvw: 100vw;
  --vvh: 100vh;
  --keyboard-offset: 0px;
  --keyboard-nav-shift: 0px;
  --keyboard-info-shift: 0px;
}

html {
  -webkit-background-size: cover;
  -moz-background-size: cover;
  -o-background-size: cover;
  background-size: cover;
  background-color: #000000;
  overflow-x: hidden;
  width: 100%;
}

body {
  font: normal 1em 'Inter', Helvetica, Arial, sans-serif;
  color: #ffffff;
  background-color: #000000;
  overflow-x: hidden;
  width: 100%;
  max-width: 100%;
}

#bottom-nav-container {
  position: fixed;
  bottom: 18px;
  left: 18px;
  right: 18px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  z-index: 5;
  pointer-events: none;
  transform: translateY(calc(var(--keyboard-nav-shift) * -1));
}

#bottom-nav-container > * {
  pointer-events: auto;
}

/* Navigation Groups */
.nav-group-left,
.nav-group-center,
.nav-group-right {
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav-group-left {
  justify-content: flex-start;
}

.nav-group-center {
  justify-content: center;
}

.nav-group-right {
  justify-content: flex-end;
}

/* Navigation Icons */
.nav-icon {
  font-size: 24px;
  color: #fff;
  cursor: pointer;
}

.nav-icon:hover {
  opacity: 1;
}

.nav-disabled {
  opacity: 0.3;
  cursor: not-allowed;
  pointer-events: none;
}

#info-container {
  position: relative;
  display: flex;
  align-items: stretch;
}

/* Common modal box visual styles */
.modal-box {
  position: fixed;
  color: #fff;
  background-color: rgba(0,0,0, 0.9);
  outline: 8px solid rgba(0,0,0,0.4);
  border-radius: 8px;
  opacity: 1;
}

#info-box {
  display: none;
  bottom: calc(18px + 32px + 8px);
  right: 18px;
  width: calc(40vw - 36px);
  z-index: 4;
  max-height: calc(var(--vvh) - 120px);
  overflow-y: auto;
  overflow-x: hidden;
  max-width: 100%;
  box-sizing: border-box;
  transform: translateY(calc(var(--keyboard-info-shift) * -1));
}

#exif-process-box, #geolocation-box {
  display: none;
  bottom: calc(18px + 32px + 8px);
  right: 18px;
  width: calc(40vw - 36px);
  z-index: 4;
  max-height: calc(var(--vvh) - 120px);
  overflow-y: auto;
  overflow-x: hidden;
  max-width: 100%;
  box-sizing: border-box;
  transform: translateY(calc(var(--keyboard-info-shift) * -1));
}

.exif-process-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px;
  border-bottom: 1px solid rgba(255,255,255,0.2);
}

.exif-process-header h4 {
  margin: 0;
  font-weight: 500;
  color: #aaaaaa;
}

.close-btn {
  background: none;
  border: none;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  opacity: 0.6;
}

.close-btn:hover {
  opacity: 1;
}

.exif-process-content {
  padding: 10px;
}

.exif-section, .process-section, .geolocation-section {
  margin-bottom: 20px;
  font-weight: 300;
  color: #aaaaaa;
}

.geolocation-coordinates {
  margin-bottom: 15px;
}

.geolocation-coordinates p {
  margin: 8px 0;
  color: #aaaaaa;
  font-size: 0.9em;
}

.geolocation-coordinates strong {
  color: #ccc;
  font-weight: 500;
}

.geolocation-address {
  margin-top: 15px;
}

.geolocation-address p {
  margin: 8px 0;
  color: #aaaaaa;
  font-size: 0.9em;
}

.geolocation-address strong {
  color: #ccc;
  font-weight: 500;
}

.geolocation-loading {
  color: #888;
  font-style: italic;
}

/* Map specific styles */
#geolocation-map, #gps-edit-map {
  background: #e0e0e0;
  overflow: hidden;
  border: 1px solid #555;
}

.exif-section h5, .process-section h5 {
  margin: 0 0 10px 0;
  color: #aaaaaa;
  font-weight: 500;
}

.exif-display-table {
  width: 100%;
  border-collapse: collapse;
}

.exif-display-table td {
  padding: 4px 0;
  color: #aaaaaa;
  font-weight: 300;
  font-size: 0.8em;
}

.exif-display-table td:first-child {
  width: 40%;
  color: #ccc;
}

.exif-display-table td i {
  margin-right: 8px;
  width: 20px;
}

.process-description {
  color: #aaaaaa;
  font-weight: 300;
  white-space: pre-line;
  line-height: 1.6;
}

#info-box h4 {
  margin: 0;
  border-bottom: 1px solid rgba(255,255,255,0.2);
  padding: 10px;
  font-weight: 500;
  color: #aaaaaa;
  text-transform: capitalize;
}

#post-body {
  padding: 10px;
  color: #aaaaaa;
  font-weight: 300;
  white-space: pre-line;
}

#post-footer {
  font-size: 0.75rem;
  padding: 10px;
  display: flex;
  justify-content: flex-start;
  gap: 12px;
  align-items: center;
  color: #aaaaaa;
}

#post-footer-author a {
  font-weight: 500;
  color: #fff;
  text-decoration: none;
}

#post-footer-author a:hover {
  opacity: 1;
  text-decoration: underline;
}

/* Comments Section */
#comments-box {
  padding: 10px;
  border-top: 1px solid rgba(255,255,255,0.2);
  margin-top: 10px;
}

.comment-form {
  margin-bottom: 15px;
}

.comment-form-field {
  margin-bottom: 8px;
}

.comment-form-field textarea {
  width: 100%;
  padding: 8px;
  background-color: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 4px;
  color: #fff;
  font-family: 'Inter', Helvetica, Arial, sans-serif;
  font-size: 0.9em;
  resize: vertical;
  min-height: 60px;
  box-sizing: border-box;
}

.comment-form-field textarea:focus {
  outline: none;
  border-color: rgba(255,255,255,0.4);
  background-color: rgba(255,255,255,0.15);
}

.comment-form-error {
  color: #ff6b6b;
  font-size: 0.8em;
  margin-top: 4px;
}

.comment-form-actions {
  display: flex;
  justify-content: flex-end;
}

.comment-submit-btn {
  padding: 6px 16px;
  background-color: rgba(255,255,255,0.2);
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 4px;
  color: #fff;
  font-size: 0.85em;
  cursor: pointer;
  transition: all 0.2s;
}

.comment-submit-btn:hover {
  background-color: rgba(255,255,255,0.3);
  border-color: rgba(255,255,255,0.4);
}

.comments-loading {
  color: #aaaaaa;
  font-size: 0.85em;
  padding: 10px;
  text-align: center;
}

.comments-empty {
  color: #aaaaaa;
  font-size: 0.85em;
  padding: 10px;
  text-align: center;
  font-style: italic;
}

.comments-empty a {
  color: #5ddbf8;
  text-decoration: none;
}

.comment-item {
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.comment-item:last-child {
  border-bottom: none;
}

.comment-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.comment-author {
  font-size: 0.75em;
}

.comment-author a {
  color: #ccc;
  font-weight: 300;
  text-decoration: none;
}

.comment-author a:hover {
  text-decoration: underline;
}

.comment-meta {
  font-size: 0.75em;
  color: #aaaaaa;
}

.comment-time {
  color: #aaaaaa;
}

.comment-content {
  color: #aaaaaa;
  font-size: 0.9em;
  white-space: pre-line;
  word-wrap: break-word;
  margin-bottom: 6px;
}

.comment-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}

.comment-delete-btn {
  background: none;
  border: none;
  color: #aaaaaa;
  font-size: 0.75em;
  cursor: pointer;
  padding: 2px 6px;
  opacity: 0.6;
  transition: opacity 0.2s;
}

.comment-delete-btn:hover {
  opacity: 1;
  color: #ff6b6b;
}

.comment-delete-confirm {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75em;
  color: #aaaaaa;
}

.comment-delete-confirm span {
  margin-right: 4px;
}

.comment-delete-confirm-btn,
.comment-delete-cancel-btn {
  padding: 4px 10px;
  background-color: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 3px;
  color: #fff;
  font-size: 0.75em;
  cursor: pointer;
  transition: all 0.2s;
}

.comment-delete-confirm-btn {
  background-color: rgba(255,107,107,0.3);
  border-color: rgba(255,107,107,0.5);
}

.comment-delete-confirm-btn:hover {
  background-color: rgba(255,107,107,0.5);
}

.comment-delete-cancel-btn:hover {
  background-color: rgba(255,255,255,0.2);
}

.bottom-icons {
  opacity: 0.6;
  cursor: pointer;
}

.bottom-icons:hover {
  opacity: 1;
}

/* Zoom icon styles */
.zoom-icon {
  transition: color 0.2s, opacity 0.2s;
}

.zoom-icon.active {
  color: #ff0000 !important;
  opacity: 1 !important;
}

.zoom-icon:hover {
  opacity: 1;
}

/* Zoom cursor styles */
body.zoom-mode-active,
html.zoom-mode-active {
  cursor: zoom-in !important;
}

body.zoom-mode-zoomed,
html.zoom-mode-zoomed {
  cursor: zoom-out !important;
}

/* Zoomed image container */
#zoomed-image-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: none;
  overflow: hidden;
}

#zoomed-image-container img {
  position: absolute;
  width: auto;
  height: auto;
  max-width: none;
  max-height: none;
  pointer-events: auto;
}

#imgsize-switch-cont {
  display: flex;
  align-items: center;
}

.imgsize-contain {
  background: url('images/pb_contain.png') no-repeat;
}

.imgsize-cover {
  background: url('images/pb_cover.png') no-repeat;
}

.hidden {
  display: none;
}

#logo {
  background: url('/static/images/2d-slice.png') no-repeat;
  padding: 2px 6px 4px 6px;
  position: absolute;
  top: 0px;
  left: 18px;
  opacity: 0.4;
  width: 80px;
  height: 25px;
}

#logo:hover {
  opacity: 1;
}

#nav {
  font-size: 18px;
  display: flex;
  justify-content: center;
  flex: 1;
}

#nav-inner {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

#nav-inner a {
  text-decoration: none;
  color: #fff;
}

#nav-inner a:hover {
  opacity: 1;
  cursor: pointer;
}

#heart {
  position: absolute;
  bottom: 18px;
  right: 100px;
}

#background-image {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: -1;
  pointer-events: none;
  display: none;
}

#background-image.contain-mode {
  top: 50%;
  transform: translate(-50%, -50%);
}

#background-image.active {
  display: block;
}

html.has-panning-image {
  background: none !important;
}

#help-box {
  display: none;
  position: fixed;
  left: 50%;
  bottom: 50%;
  right: auto;
  transform: translate(-50%, -50%);
  background-color: rgba(0,0,0, 0.9);
  width: 500px;
  max-width: 90vw;
  max-height: 70vh;
  z-index: 10;
  padding: 20px;
  overflow-y: auto;
}

#help-box h3 {
  margin: 0 0 15px 0;
  color: #fff;
  font-weight: 500;
  border-bottom: 1px solid rgba(255,255,255,0.2);
  padding-bottom: 10px;
}

#help-box .help-item {
  margin-bottom: 12px;
  color: #ccc;
  font-weight: 300;
  font-size: 0.8em;
}

#help-box .help-key {
  display: inline-block;
  background-color: rgba(255,255,255,0.2);
  padding: 2px 8px;
  border-radius: 4px;
  font-family: monospace;
  font-weight: 500;
  margin-right: 8px;
  min-width: 20px;
  text-align: center;
}

#help-box .close-help {
  position: absolute;
  top: 10px;
  right: 10px;
  background: none;
  border: none;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  opacity: 0.6;
  padding: 0;
  width: 30px;
  height: 30px;
  line-height: 30px;
}

#help-box .close-help:hover {
  opacity: 1;
}

#photo-taken-date-display {
  font-size: 0.9em;
  color: #888;
   margin: 10px 0;
   padding-left: 10px;
}


/* Responsive Design */
@media (max-width: 768px) {
  #bottom-nav-container {
    left: 50%;
    right: auto;
    bottom: 12px;
    width: calc(var(--vvw) - 20px);
    max-width: calc(var(--vvw) - 20px);
    transform: translate(-50%, calc(var(--keyboard-nav-shift) * -1));
    padding: 0 4px;
    grid-template-columns: 1fr auto 1fr;
  }
  .modal-box {
    border-width: 1px;
  }

  #info-box, #exif-process-box, #geolocation-box {
    width: calc(var(--vvw) - 20px);
    max-width: calc(var(--vvw) - 20px);
    right: 10px;
    bottom: 50px;
    overflow-x: hidden;
    box-sizing: border-box;
    max-height: calc(var(--vvh) - 80px);
    padding-right: 12px;
    min-height: 180px;
    transform: translateY(calc(var(--keyboard-info-shift) * -1));
  }

  /* Ensure all content inside info box doesn't overflow */
  #info-box *,
  #exif-process-box *,
  #geolocation-box * {
    max-width: 100%;
    word-wrap: break-word;
    overflow-wrap: break-word;
    box-sizing: border-box;
  }

  /* Map on mobile */
  #geolocation-map {
    height: 250px !important; /* Slightly shorter on mobile */
    border-radius: 8px;
  }

  /* Ensure textarea and inputs fit */
  #info-box textarea,
  #info-box input,
  #exif-process-box textarea,
  #exif-process-box input,
  #geolocation-box textarea,
  #geolocation-box input {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  /* Prevent any table or pre elements from causing overflow */
  #info-box table,
  #info-box pre,
  #exif-process-box table,
  #exif-process-box pre,
  #geolocation-box table,
  #geolocation-box pre {
    max-width: 100%;
    overflow-x: auto;
    display: block;
    word-wrap: break-word;
  }
  #nav-inner {
    gap: 0.25rem;
  }

  .nav-group-left,
  .nav-group-right {
    gap: 16px;
  }

  .nav-icon {
    font-size: 20px;
  }
}

/* for extra large screens */
@media (min-width: 1800px) {
  #info-box, #exif-process-box, #geolocation-box {
    width: calc(30vw - 36px);
    max-width: calc(30vw - 36px);
  }
}