/**
 * board_audio/css/view.css
 * View page styles + Comment styles merged
 * Mobile First, Single Breakpoint: 768px
 */

/* =========================================
   Base Styles (Mobile)
   ========================================= */
/* %%% Fix: Override container overflow for MP3 player clip-path %%% */
html body .container {
  overflow: visible !important;
}

.container {
  margin: 60px auto 0;
  padding: 10px;
  background: #f2f2f2;
}

/* Post Info Top */
.post-info-top {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 1rem;
  color: #555;
  font-weight: bold;
  padding-top: 0.5rem;
  margin-top: 0.5rem;
  margin-bottom: 1rem;
}

.post-info-top .board-type,
.post-info-top .board-category {
  font-size: inherit;
}

/* Title */
.title {
  font-size: 1.3rem;
  font-weight: bold;
  margin-bottom: 0.5rem;
  margin-top: 0;
}

/* Info */
.info {
  font-size: 0.85rem;
  color: #666;
  margin-bottom: 1rem;
}

/* Section Headers */
h2 {
  font-size: 1.2rem;
  margin-top: 2rem;
}

/* =========================================
   Content Area
   ========================================= */

.content {
  white-space: pre-wrap;
  margin-bottom: 1rem;
  line-height: 1.6;
}

/* Post Images */
.post-img {
  max-width: 100%;
  width: auto;
  max-height: 600px;
  height: auto;
  cursor: pointer;
  display: block;
  margin: 0 auto 1rem;
  border-radius: 5px;
}

/* Attachments */
.attachments ul {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem 0;
}

.attachments li {
  margin-bottom: 0.3rem;
}

.attachments a {
  color: #007bff;
  text-decoration: none;
}

.attachments a:hover {
  text-decoration: underline;
}

/* =========================================
   MP3 Player Area (Audio Specific)
   ========================================= */

.player-container {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  margin: 20px 0;
}

.player-wrapper {
  position: relative;
  width: 320px;
  height: 320px;
}

.player-album-art {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 60%;
  height: auto;
  border-radius: 50%;
  z-index: 1;
  pointer-events: none;
}

.timer-display {
  position: absolute;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  display: none;
  z-index: 10;
}

#currentTimer {
  top: 10px;
  left: 10px;
}

#totalTimer {
  top: 10px;
  right: 10px;
}

/* =========================================
   Media Wrappers (Audio/Video/YouTube)
   ========================================= */

.audio-wrapper {
  margin: 20px 0;
  text-align: center;
}

.audio-wrapper audio {
  width: 100%;
  max-width: 600px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.video-wrapper {
  margin: 20px 0;
  text-align: center;
}

.video-wrapper video {
  width: 100%;
  max-width: 800px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.youtube-wrapper {
  margin: 20px 0;
  text-align: center;
}

.youtube-wrapper iframe {
  width: 100%;
  max-width: 800px;
  height: 250px;
  border-radius: 8px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
}

.youtube-wrapper-inline {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  max-width: 800px;
  margin: 20px auto;
  border-radius: 8px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
}

.youtube-wrapper-inline iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 8px;
}

/* =========================================
   Action Buttons
   ========================================= */

.post-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin: 1.5rem 0;
  position: relative;
}

.post-actions .likes {
  margin: 0;
}

.download-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.3rem;
}

.btn-download {
  background: #28a745 !important;
}

.action-buttons {
  text-align: center;
  margin: 1rem 0;
}

/* Vote Button */
.vote-btn {
  padding: 0.2rem 0.5rem;
  margin-right: 0.5rem;
  background: #eee;
  border: none;
  border-radius: 4px;
  font-size: 0.85rem;
  cursor: pointer;
}

.vote-btn:hover {
  background: #ddd;
}

.vote-btn.active {
  background: #007bff;
  color: #fff;
}

.likes {
  margin: 1rem 0;
  text-align: center;
}

/* Share Toggle */
.share-toggle {
  background: #6c757d;
}

.share-toggle:hover {
  background: #5a6268;
}

/* =========================================
   Share Popup
   ========================================= */

.share-popup {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  justify-content: center;
  align-items: center;
}

.share-popup.active {
  display: flex;
}

.share-popup-content {
  background: white;
  border-radius: 12px;
  width: 90%;
  max-width: 320px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  animation: popupSlide 0.2s ease;
}

@keyframes popupSlide {
  from {
    transform: translateY(20px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.share-popup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  border-bottom: 1px solid #eee;
  font-weight: bold;
  font-size: 1.1rem;
}

.share-popup-close {
  background: none;
  border: none;
  font-size: 1.3rem;
  cursor: pointer;
  color: #999;
  padding: 0;
  line-height: 1;
}

.share-popup-close:hover {
  color: #333;
}

.share-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.share-list li {
  border-bottom: 1px solid #f0f0f0;
}

.share-list li:last-child {
  border-bottom: none;
}

.share-list button {
  width: 100%;
  padding: 15px 20px;
  background: none;
  border: none;
  text-align: left;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s;
}

.share-list button:hover {
  background: #f8f9fa;
}

/* =========================================
   Slideshow (Paper Slider)
   ========================================= */

.paper-slideshow-container,
.paper-slideshow-container * {
  box-sizing: border-box;
}

.paper-slideshow-container {
  max-width: 100%;
  width: 100%;
  position: relative;
  margin: 10px 0;
  overflow: hidden;
  touch-action: pan-y pinch-zoom;
}

.paper-slider-track {
  display: flex;
  transition: transform 0.3s ease-out;
  cursor: grab;
}

.paper-slider-track:active {
  cursor: grabbing;
}

.paper-slide {
  min-width: 100%;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  background: #000;
}

.paper-slide img {
  width: 100%;
  height: auto;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
  cursor: pointer;
}

.paper-slide img:active {
  cursor: grabbing;
}

.paper-slide-number {
  position: absolute;
  top: 10px;
  left: 10px;
  color: #f2f2f2;
  font-size: 10px;
  padding: 4px 8px;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 3px;
  z-index: 2;
}

.paper-slide-caption {
  position: absolute;
  bottom: 10px;
  left: 0;
  right: 0;
  color: #f2f2f2;
  font-size: 12px;
  padding: 6px 10px;
  text-align: center;
  background: rgba(0, 0, 0, 0.6);
}

.paper-slider-dots {
  text-align: center;
  padding: 15px 0;
}

.paper-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin: 0 3px;
  background-color: #bbb;
  border-radius: 50%;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.paper-dot.active {
  background-color: #007bff;
  transform: scale(1.2);
}

.paper-dot:hover {
  background-color: #717171;
}

/* =========================================
   Pagination
   ========================================= */

.pagination {
  text-align: center;
  margin: 1.5rem 0;
}

.pagination a,
.pagination span {
  display: inline-block;
  padding: 0.4rem 0.8rem;
  margin: 0 0.2rem;
  text-decoration: none;
  border: 1px solid #ccc;
  border-radius: 3px;
  font-size: 0.9rem;
  color: #333;
}

.pagination .active {
  background: #007bff;
  color: white;
  border-color: #007bff;
}

/* =========================================
   Comments Section (Merged from comment.css)
   ========================================= */

.comments {
  margin-top: 0.5rem;
  padding: 0;
  background-color: ghostwhite;
  width: 100%;
  max-width: 1200px;
}

.comment {
  padding: 0.8rem;
  border-bottom: 1px solid #eee;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.comment-author {
  font-weight: bold;
  font-size: 1rem;
  color: #333;
}

.comment .info {
  font-size: 0.85rem;
  color: #777;
}

.comments .text {
  font-size: 1rem;
  line-height: 1.4;
  white-space: pre-wrap;
  padding: 0.5rem;
  background-color: #E8E0E0;
}

.comment .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.comment .actions .vote-btn {
  background: #eee;
  border: none;
  border-radius: 4px;
  padding: 0.4rem 0.8rem;
  font-size: 0.9rem;
  cursor: pointer;
}

.comment .actions .vote-btn:hover {
  background: #ddd;
}

.comment .actions .vote-btn.active {
  background: #007bff;
  color: #fff;
}

/* Comment Form */
.comment-form {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.comment-form textarea {
  width: 100%;
  padding: 0.8rem;
  font-size: 1rem;
  line-height: 1.5;
  border: 1px solid #ccc;
  border-radius: 5px;
  resize: vertical;
  min-height: 100px;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}

.comment-form textarea:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.comment-form textarea::placeholder {
  color: #999;
}

.comment-form .btn {
  align-self: flex-end;
  background: #007bff;
  color: #fff;
  padding: 0.6rem 1.2rem;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9rem;
}

.comment-form .btn:hover {
  background: #0056b3;
}

/* =========================================
   Desktop Styles (768px+)
   ========================================= */

@media (min-width: 768px) {

  /* YouTube */
  .youtube-wrapper iframe {
    height: 480px;
  }

  /* Slideshow */
  .paper-slideshow-container {
    max-width: 1000px;
    margin: 20px auto;
  }

  .paper-slide-number {
    font-size: 12px;
    padding: 6px 10px;
  }

  .paper-slide-caption {
    font-size: 14px;
    padding: 8px 12px;
  }

  .paper-dot {
    width: 12px;
    height: 12px;
    margin: 0 4px;
  }

  /* Comments */
  .comment {
    padding: 1rem;
    flex-direction: row;
    align-items: flex-start;
  }

  .comment-author {
    flex: 0 0 120px;
  }

  .comment .info,
  .comment .text {
    flex: 1;
  }

  .comment .actions {
    flex: 0 0 auto;
    align-self: center;
    flex-wrap: nowrap;
  }

  .comment-form {
    flex-direction: row;
    align-items: flex-start;
  }

  .comment-form textarea {
    flex: 1;
  }

  .comment-form .btn {
    margin-left: 1rem;
    align-self: center;
  }
}