/* ===================================
   MOBILE RESPONSIVE STYLES
   =================================== */

@media (max-width: 768px) {
  /* --- Global Resets & Adjustments --- */
  body {
    font-size: 14px; /* Base font size reduction */
  }

  /* --- Header --- */
  .header {
    padding: 10px 15px;
    justify-content: space-between;
    height: 60px;
  }

  .logo img {
    width: 8rem; /* Resize logo */
    padding: 0 5px;
  }

  .profile img {
    width: 2rem; /* Resize profile icon */
    height: 2rem;
    border-width: 1.5px;
  }

  .search {
    width: 32px;
    height: 32px;
  }

  .search .btn {
    width: 32px;
    height: 32px;
    font-size: 16px;
  }

  .search.active input {
    width: 180px; /* Adjust search bar width */
    padding-right: 35px;
    height: 32px;
    font-size: 14px;
  }

  /* --- Navigation --- */
  .bottom-nav {
    padding: 0.5rem 0;
    height: 55px;
  }

  .nav-item i {
    font-size: 1.1rem; /* Resize nav icons */
    margin-bottom: 2px;
  }

  .nav-item span {
    font-size: 0.65rem; /* Resize nav text */
  }

  /* --- Movie Grid (Home, Movies, TV Series, Watchlist) --- */
  #main,
  #watchlist-section {
    padding: 10px;
    padding-bottom: 70px; /* Space for bottom nav */
    justify-content: center;
    gap: 10px;
  }

  .movie {
    width: calc(50% - 15px); /* 2 items per row with gap */
    margin: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
  }

  .movie-info {
    padding: 8px;
  }

  .movie-info h3 {
    font-size: 0.85rem; /* Resize movie title */
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .movie-info span {
    font-size: 0.75rem; /* Resize rating */
    padding: 2px 6px;
  }

  /* Poster Actions (Mobile Touch Friendly) */
  .poster-action-btn {
    width: 32px;
    height: 32px;
    font-size: 14px;
  }

  /* --- Modal --- */
  .modal-content-wrapper {
    padding: 15px;
    margin-top: 20px; /* Space from top */
  }

  .modal-header-section {
    flex-direction: column;
    padding: 15px;
    gap: 20px;
    align-items: center;
  }

  .modal-poster-side {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .modal-poster-img {
    width: 160px; /* Resize modal poster */
    max-width: 60%;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5);
  }

  .modal-quick-actions {
    margin-top: 15px;
    gap: 15px;
  }

  .quick-action-btn {
    width: 40px;
    height: 40px;
    font-size: 18px;
  }

  .modal-info-side {
    width: 100%;
    align-items: center;
    text-align: center;
  }

  .modal-title-enhanced {
    font-size: 1.4rem; /* Resize modal title */
    line-height: 1.2;
  }

  .modal-meta-enhanced {
    justify-content: center;
    gap: 8px;
  }

  .meta-item {
    font-size: 0.75rem;
    padding: 4px 10px;
  }

  .modal-ratings-enhanced {
    justify-content: center;
    gap: 10px;
  }

  .rating-card {
    padding: 8px 12px;
    min-width: 50px;
  }

  .rating-source {
    font-size: 0.6rem;
  }

  .rating-score {
    font-size: 1.2rem;
  }

  .modal-genres {
    justify-content: center;
    gap: 6px;
  }

  .genre-tag {
    font-size: 0.7rem;
    padding: 4px 8px;
  }

  .modal-overview-enhanced {
    font-size: 0.85rem;
    line-height: 1.5;
    text-align: center;
    padding: 0 10px;
  }

  .modal-cast-enhanced {
    justify-content: center;
    font-size: 0.85rem;
  }

  .modal-actions-enhanced {
    flex-direction: column;
    width: 100%;
    gap: 10px;
  }

  .action-btn-enhanced {
    width: 100%;
    justify-content: center;
    padding: 12px;
    font-size: 0.9rem;
  }

  /* --- Video Section --- */
  .video-section-enhanced {
    margin: 20px 0;
  }

  .video-section-enhanced h3 {
    font-size: 1.1rem;
    justify-content: center;
  }

  .server-selector-enhanced {
    justify-content: center;
    gap: 6px;
    margin-bottom: 15px;
  }

  .server-btn {
    padding: 6px 12px;
    font-size: 0.75rem;
    flex: 1 1 auto;
    min-width: 80px;
  }

  .video-container-enhanced {
    border-radius: 8px;
  }

  /* --- Seasons & Episodes --- */
  .seasons-section-enhanced {
    padding: 15px;
    margin: 20px 0;
  }

  .seasons-section-enhanced h3 {
    font-size: 1.1rem;
    justify-content: center;
  }

  .seasons-list-enhanced {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .season-card {
    padding: 10px;
  }

  .season-number {
    font-size: 1.2rem;
    min-width: 30px;
  }

  .season-name {
    font-size: 0.9rem;
  }

  .episodes-list-enhanced {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .episode-card {
    padding: 10px;
  }

  .episode-number-badge {
    padding: 6px 10px;
    font-size: 0.8rem;
    min-width: 35px;
  }

  .episode-title {
    font-size: 0.85rem;
  }

  /* --- Recommendations --- */
  .recommendations-section {
    padding: 15px;
    margin-top: 20px;
  }

  .recommendations-section h3 {
    font-size: 1.1rem;
    justify-content: center;
  }

  .recommendations-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .recommendation-card img {
    height: 160px;
  }

  .recommendation-info h4 {
    font-size: 0.8rem;
  }

  /* --- Profile / More Tab --- */
  .profile-content {
    padding: 15px;
    padding-bottom: 70px;
  }

  .super-buttons-container {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .super-button {
    padding: 20px;
    border-radius: 15px;
  }

  .super-button h3 {
    font-size: 1.2rem;
    margin-bottom: 15px;
    text-align: center;
  }

  .profile-details-compact {
    flex-direction: column;
    text-align: center;
    gap: 20px;
  }

  .profile-photo {
    width: 90px;
    height: 90px;
    border-width: 3px;
  }

  .edit-photo-btn {
    width: 32px;
    height: 32px;
    font-size: 14px;
    bottom: 0;
    right: 0;
  }

  .profile-info-compact {
    width: 100%;
    gap: 10px;
  }

  .editable-field {
    padding: 10px;
    border-radius: 8px;
  }

  .editable-field input {
    font-size: 0.95rem;
  }

  .edit-btn {
    width: 30px;
    height: 30px;
    font-size: 14px;
  }

  .history-super-box {
    min-height: 150px;
  }

  .history-preview-icons {
    font-size: 3rem;
  }

  .sub-buttons-container {
    gap: 15px;
  }

  .sub-header {
    padding: 15px;
  }

  .sub-header h3 {
    font-size: 1rem;
  }

  .contact-links {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  .contact-link {
    padding: 15px;
    flex-direction: row;
    justify-content: flex-start;
    gap: 15px;
  }

  .contact-link i {
    font-size: 1.5rem;
  }

  .logout-btn-enhanced {
    width: 100%;
    padding: 12px;
    font-size: 1rem;
  }
}

/* Extra Small Devices (e.g., iPhone SE, Galaxy Fold) */
@media (max-width: 360px) {
  .logo img {
    width: 6.5rem;
  }

  .search.active input {
    width: 140px;
  }

  .movie {
    width: 100%; /* 1 item per row on very small screens */
  }

  .modal-poster-img {
    width: 140px;
  }
}
