/* style.css */
body {
  margin: 0;
  background-color: #111;
  color: white;
  font-family: Arial, sans-serif;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 20px;
  background-color: #1c1c1c;
  border-bottom: 2px solid #ffa31a;
}

.logo {
  font-size: 24px;
  font-weight: bold;
}
.cold {
  color: #ffa31a;
}
.winter {
  color: white;
}

nav a {
  margin: 0 10px;
  color: white;
  text-decoration: none;
}
nav a:hover {
  color: #ffa31a;
}

main {
  display: flex;
  padding: 20px;
  gap: 20px;
}

.left {
  flex: 3;
}
.right {
  flex: 1;
}

.video-box {
  background-color: black;
  width: 100%;
  height: 480px;
  margin-bottom: 10px;
  border: none;
}

.video-title {
  color: #ffa31a;
}

.stats {
  margin: 5px 0;
}

.like-bar {
  display: flex;
  height: 10px;
  margin-bottom: 10px;
}
#bar-like {
  background-color: green;
  height: 100%;
  width: 50%;
}
#bar-dislike {
  background-color: red;
  height: 100%;
  width: 50%;
}

.actions button {
  margin: 5px;
  padding: 5px 10px;
  background-color: #222;
  border: 1px solid #aaa;
  color: white;
  cursor: pointer;
}
.actions i {
  margin-right: 5px;
}

.comments {
  margin-top: 20px;
}
.comment {
  margin-bottom: 15px;
}
.author {
  color: #ffa31a;
  font-weight: bold;
}
.timestamp {
  float: right;
  color: gray;
}
.comment-actions {
  margin-top: 5px;
}
.comment-actions span, .comment-actions button {
  margin-right: 10px;
  color: #ccc;
}

.ad {
  background-color: white;
  padding: 10px;
  position: relative;
}
.ad-label {
  background-color: yellow;
  color: black;
  font-size: 12px;
  padding: 2px 4px;
  position: absolute;
  top: 5px;
  left: 5px;
}
.ad img {
  width: 100%;
  border: none;
}

.suggested-video {
  background-color: #222;
  margin: 10px 0;
  padding: 10px;
  position: relative;
}
.thumb {
  width: 100%;
  height: 100px;
  background-color: gray;
  margin-bottom: 5px;
}
.meta .title {
  color: #ffa31a;
}
.meta .info {
  font-size: 12px;
  color: #bbb;
}
.duration {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background-color: black;
  padding: 2px 5px;
  font-size: 12px;
}

/* Fix reply button to match theme */
.comment-actions button {
  background-color: #1c1c1c;
  color: white;
  border: 1px solid #555;
  padding: 2px 6px;
  font-size: 12px;
  cursor: pointer;
}
.comment-actions button:hover {
  background-color: #ffa31a;
  color: black;
}

/* Remove white frame around ad */
.ad {
  background-color: transparent;
  padding: 0;
  position: relative;
  border: none;
}
.ad img {
  border: none;
}

/* Improve "Ad" overlay look */
.ad-label {
  position: absolute;
  top: 6px;
  left: 6px;
  background-color: yellow;
  color: black;
  font-weight: bold;
  font-size: 10px;
  padding: 2px 4px;
  z-index: 2;
  border-radius: 2px;
}


/* === Responsive Design for Mobile === */
@media (max-width: 768px) {
  main {
    flex-direction: column;
  }

  .left, .right {
    flex: 1 0 100%;
  }

  .video-box {
    height: auto;
    width: 100%;
    aspect-ratio: 16 / 9;
  }

  .actions button {
    display: block;
    width: 100%;
    margin: 5px 0;
  }

  .suggested-video {
    display: flex;
    flex-direction: row;
    align-items: center;
  }

  .suggested-video .thumb {
    width: 40%;
    height: auto;
    aspect-ratio: 16 / 9;
    margin-right: 10px;
  }

  .suggested-video .meta {
    flex: 1;
  }

  .ad {
    width: 100%;
  }

  .ad-label {
    font-size: 10px;
  }
}


/* Make sure ad label always shows */
.ad {
  position: relative;
  display: block;
  overflow: hidden;
}
.ad-label {
  position: absolute;
  top: 6px;
  left: 6px;
  background-color: yellow;
  color: black;
  font-weight: bold;
  font-size: 10px;
  padding: 2px 4px;
  z-index: 10;
  border-radius: 2px;
}

/* Fix .suggested-video structure */
.suggested-video {
  position: relative;
  background-color: #222;
  padding: 10px;
  margin-bottom: 10px;
}
.suggested-video .thumb {
  width: 100%;
  height: 100px;
  background-color: gray;
  margin-bottom: 5px;
}
.suggested-video .meta .title {
  color: #ffa31a;
}
.suggested-video .meta .info {
  font-size: 12px;
  color: #bbb;
}
.suggested-video .duration {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background-color: black;
  padding: 2px 5px;
  font-size: 12px;
  z-index: 2;
}


/* === Mobile-Only Enhancements === */
@media (max-width: 768px) {
  .like-bar {
    height: 10px;
    margin: 10px 0;
  }

  /* Suggested videos only visible, comments hidden */
  .comments { display: block; }
@media (max-width: 768px) { .comments { display: none; } }

  /* Optional: replace with a pull-up toggle later */
  .show-comments-button {
    display: block;
    background: #ffa31a;
    color: black;
    padding: 8px;
    text-align: center;
    font-weight: bold;
    cursor: pointer;
  }

  /* Popup ad style */
  .popup-ad {
    display: none;
    position: fixed;
    top: 20%;
    left: 10%;
    width: 80%;
    background: white;
    
    padding: 10px;
    z-index: 9999;
    text-align: center;
  }

  .popup-ad img {
    width: 100%;
    height: auto;
  }

  .popup-ad .close-btn {
    position: absolute;
    top: 5px;
    right: 10px;
    background: black;
    color: white;
    border: none;
    font-size: 14px;
    cursor: pointer;
    padding: 2px 6px;
  }
}


/* Device-specific display classes */
.desktop-only {
  display: block;
}
.mobile-only {
  display: none;
}

@media (max-width: 768px) {
  .desktop-only {
    display: none !important;
  }
  .mobile-only {
    display: block !important;
  }

  /* Horizontal layout for action buttons */
  .actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }
  .actions button {
    flex: 1 1 auto;
    min-width: 48%;
    margin: 0;
  }

  #comment-section {
    display: none;
    margin-top: 10px;
  }
}


/* Force buttons to wrap horizontally on mobile */
@media (max-width: 768px) {
  .actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: space-between;
  }

  .actions button {
    flex: 1 0 48%;
    margin: 5px 0;
    white-space: nowrap;
  }

  .suggested-video {
    display: block;
  }

  .suggested-video .thumb {
    width: 100%;
    height: 100px;
    background-color: gray;
    margin-bottom: 5px;
  }

  .suggested-video .duration {
    bottom: 5px;
    right: 5px;
  }
}


@media (max-width: 768px) {
  .actions button {
    font-size: 12px;
    padding: 6px;
    flex: 1 0 30%;
  }

  .actions i {
    font-size: 14px;
    margin-right: 4px;
  }

  .actions {
    gap: 6px;
    justify-content: center;
  }
}


@media (max-width: 768px) {
  .actions i {
    font-size: 12px !important;
  }

  .actions button {
    font-size: 11px !important;
    padding: 5px 6px;
    flex: 1 0 30%;
  }

  .close-btn {
    font-size: 14px;
    padding: 2px 6px;
    background: black;
    color: white;
    border: none;
    position: absolute;
    right: 6px;
    top: 6px;
    z-index: 999;
  }
}


/* Force uniform layout and avoid overflow glitch at the bottom */
.suggested-video {
  position: relative;
  background-color: #222;
  padding: 10px;
  margin-bottom: 12px;
  border-bottom: 1px solid #333;
  overflow: hidden;
}

.suggested-video .duration {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background-color: black;
  padding: 2px 5px;
  font-size: 12px;
  z-index: 2;
  line-height: 1;
  border-radius: 2px;
}

.suggested-video .meta {
  padding-bottom: 18px; /* ensure space for duration */
}


@media screen and (max-width: 768px) {
  .actions button {
    font-size: 12px;
    padding: 6px;
    margin: 4px;
    flex: 1 1 45%;
  }

  .actions {
    flex-wrap: wrap;
    justify-content: space-between;
  }

  .actions i {
    font-size: 14px;
  }
}


/* 👇 Mobile-specific sizing for action icons */
@media (max-width: 768px) {
  .actions button {
    font-size: 10px !important;
    padding: 4px 6px !important;
    flex: 1 0 45% !important;
  }
  .actions i {
    font-size: 12px !important;
  }
}


/* Unified mobile action button layout */

@media (max-width: 768px) {
  .actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px;
  }

  .actions button {
    flex: 1 0 45%;
    font-size: 11px;
    padding: 6px 8px;
    margin: 4px 0;
    white-space: nowrap;
  }

  .actions i {
    font-size: 13px;
    margin-right: 4px;
  }
}

/* Mobile Static Ad */
.mobile-static-ad {
  position: relative;
  width: 100%;
  margin: 20px 0;
  text-align: center;
}
.mobile-static-ad img {
  width: 90%;
  max-width: 300px;
  height: auto;
}
.mobile-static-ad .ad-label {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 10px;
  padding: 2px 4px;
  position: absolute;
  top: 8px;
  right: 12px;
  background: yellow;
  color: black;
  font-size: 12px;
  font-weight: bold;
  padding: 2px 5px;
  border-radius: 3px;
}
@media (min-width: 769px) {
  .mobile-static-ad {
    display: none;
  }
}

/* Like/Dislike Bar Fix */
.like-bar {
  display: flex;
  height: 10px;
  width: 100%;
  background: #333;
  margin-top: 10px;
  overflow: hidden;
  border-radius: 5px;
}
#bar-like {
  height: 100%;
  background-color: #4caf50;
  width: 50%;
  transition: width 0.3s ease;
}
#bar-dislike {
  height: 100%;
  background-color: #f44336;
  width: 50%;
  transition: width 0.3s ease;
}

/* FINAL GIF AD SIZING + AD LABEL FIX */
.mobile-static-ad {
  position: relative;
  width: 100%;
  max-width: 300px;
  margin: 20px auto;
}

.mobile-static-ad img {
  width: 100%;
  height: auto;
  display: block;
}

.mobile-static-ad .ad-label {
  position: absolute;
  top: 6px;
  right: 6px;
  background: yellow;
  color: black;
  font-size: 10px;
  font-weight: bold;
  padding: 2px 4px;
  border-radius: 3px;
  z-index: 10;
}

/* Ensure comment section is always visible on desktop */
@media (min-width: 769px) {
  #comment-section {
    display: block !important;
  }
}
