/* MEDIA QUERY: MOBILOS MEGJELENÍTÉS */
---
### Reszponzív Dizájn Szabályok

/* Közepes képernyőkre (tabletek) */
@media (max-width: 1024px) {
  #galleryContainer {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
  }

  .image-item {
    max-width: 350px;
  }

  .image-frame {
    height: 220px;
  }
  
    .cardPic {
    height: 300px;  
    border-radius: 12px;
    aspect-ratio: auto; 
  }

  #globalCommentPopup {
    width: 80%;
    max-height: 70vh;
  }

  .link-bubble,
  .link-bubble2 {
    max-width: 400px;
    height: 180px;
  }

  .bubble-title,
  .bubble-title2 {
    font-size: 1.1em;
  }
}

/* Kisebb képernyőkre (mobilok) */
@media (max-width: 768px) {
  p[style*="text-align: justify"] {
    text-align: left !important;
  }

  /* Globális beállítások */
  h1, h2 {
    font-size: 1.8em;
  }

  #meoo { 
    padding: 0 10px;
  }

  .maincontainer,
  .video-display-container {
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 10px;
  }

  .texcontainer,
  .container, 
  .video-display,
  .video-chat,
  .collcard,
  .link-bubble,
  .link-bubble2,
  #ship-info,
  .ship-select,
  #uploadedImages, 
  .cardText,
  .transpcardText {
    width: 95% !important;
    max-width: 100% !important;
    box-sizing: border-box;
    margin: 10px auto;
    padding: 12px;
  }

  .video-display iframe {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
  }

  .video-thumb {
    width: 45vw;
  }

  /* Képgaléria konténer */
  #galleryContainer {
    grid-template-columns: 1fr;
    gap: 25px;
    padding: 0 10px;
  }

  .image-item {
    max-width: 100%;
    padding: 15px;
  }

  .image-frame {
    height: 200px;
  }

  .image-item h3 {
    font-size: 1em;
    max-height: none;
    white-space: normal;
  }

  .upload-time {
    font-size: 0.8em;
  }

  /* Komment szekció */
  .comments-section {
    width: 100%;
    padding: 0;
  }

  .comments-list {
    max-height: 120px;
    font-size: 13px;
    width: 100%;
    padding-right: 0;
  }

  .comments-list p {
    min-width: 0;
    overflow-wrap: break-word;
    word-break: break-word;
    max-width: 100%;
  }

  .comment-form,
  .chat-input {
    flex-direction: column;
    width: 100%;
  }

  .comment-form input,
  .comment-form button,
  .chat-input input,
  .chat-input button {
    width: 100%;
  }

  .comment-form input[type="text"],
  .comment-form textarea {
    font-size: 13px;
    padding: 7px 10px;
  }

  /* Admin vezérlők */
  .admin-controls {
    width: 100%;
    flex-wrap: wrap;
    justify-content: center;
  }

  .admin-controls button {
    width: auto;
    margin: 5px;
    white-space: nowrap;
  }

  .comment-admin-controls {
    display: block;
    margin-top: 5px;
    text-align: center;
  }

  .comment-admin-controls button {
    margin: 3px 5px;
    width: auto;
  }

  /* Feltöltési szekció */
  #uploadSection {
    margin: 30px auto 20px auto;
    padding: 20px;
    max-width: 95%;
  }

  #toggleUploadBtn {
    font-size: 14px;
    padding: 8px 15px;
  }

  #imageSearch { /* Ennek a szelektorra nem volt definíció fent, feltételezem, hogy egy input mező */
    width: calc(100% - 20px);
    margin-left: 10px;
    margin-right: 10px;
  }

  /* Lightbox */
  #lightbox-img {
    max-width: 95vw;
    max-height: 80vh;
  }

  /* Globális komment popup */
  #globalCommentPopup {
    width: 95%;
    top: 30px;
    max-height: 85vh;
    padding: 15px;
  }

  /* Kiemelt link buborékok */
  .featured-link-section {
    flex-direction: column;
    gap: 15px;
  }

  /* Itt a .link-bubble és .link-bubble2 stílusát együttesen kezeljük a mobilos reszponzivitáshoz */
  .link-bubble,
  .link-bubble2 {
    height: 150px; /* Az eredeti 200px-ról 150px-re csökkentve, ahogy a régebbi mobiloknál is volt */
  }

  .bubble-title,
  .bubble-title2 {
    font-size: 1em;
    padding: 10px;
  }

  .bubble-desc {
    font-size: 0.75em;
    margin: 3px auto 5px auto;
  }

  /* Szűrő gombok */
  .filter-btn-container {
    flex-direction: column;
    gap: 8px;
    align-items: center;
    padding: 0 10px;
  }

  .filter-btn {
    width: 80%;
    max-width: 250px;
    font-size: 14px;
    padding: 10px;
  }

  /* A maincontainer mobilon való viselkedését is itt kezeljük, az ismétlődés elkerülése végett */
  .column-box-wrapper {
    flex: 1 1 100%;
    max-width: 90%;
  }

  .counter-item { /* Ennek a szelektorra nem volt definíció fent, feltételezem, hogy egy elem */
    min-width: unset;
    flex: 1 1 100%;
  }

  .video-chat {
    margin-top: 20px;
    padding: 10px;
    max-height: none;
  }
}

/* Extra kicsi képernyőkre (régebbi/kisebb mobilok) */
@media (max-width: 480px) {
  h1 {
    font-size: 20px;
  }

  h2 {
    font-size: 18px;
    padding: 6px;
  }

  h3 {
    font-size: 16px;
  }

  .video-thumb {
    width: 100px;
  }
  
    .cardPic {
    height: 150px;       /* kb. fele akkora */
    border-radius: 8px;
    aspect-ratio: auto;  /* ne kényszerítse az arányt */
  }

  .bubble-title,
  .bubble-title2 {
    font-size: 0.9em;
    padding: 8px;
  }

  .link-bubble,
  .link-bubble2 {
    height: 150px;
  }

  .cardText,
  .transpcardText {
    font-size: 15px;
    padding: 10px;
  }

  .collcard-title {
    font-size: 20px;
  }

  .collcard-img {
    width: 60px;
    height: 60px;
    margin-right: 10px;
  }

  .comment-form input[type="text"],
  .chat-input input {
    font-size: 13px;
    padding: 6px 8px;
  }

  .comment-form button,
  .chat-input button {
    font-size: 13px;
    padding: 6px 10px;
  }

  .playlist-selector select,
  .ship-select select {
    font-size: 14px;
    padding: 8px 10px;
    width: 160px;
  }

  .video-chat {
    font-size: 13px;
    padding: 8px;
  }

  .image-item {
    padding: 12px;
  }

  .image-frame {
    height: 200px;
  }

  #welcomeCard {
    min-height: 450px;
    height: auto;
    padding: 15px;
  }
}