/* ==============================================
   Frontend Responsive Enhancements
   Mobile-first approach for all screen sizes
   ============================================== */

/* ---- Base Mobile Resets ---- */
*, *::before, *::after {
  box-sizing: border-box;
}

img, video, iframe, embed, object {
  max-width: 100%;
  height: auto;
}

/* Prevent horizontal overflow */
html {
  overflow-x: hidden;
}

/* ---- Touch-friendly tap targets (min 44px per WCAG) ---- */
@media (max-width: 991px) {
  a, button, .btn, input[type="submit"], input[type="button"],
  .nav-link, .dropdown-toggle, .menu-item a {
    min-height: 44px;
    min-width: 44px;
  }
}

/* =============================================
   NAVIGATION — Mobile & Tablet
   ============================================= */

/* Tablet: ≤991px */
@media (max-width: 991px) {
  .navigation .nav-container,
  .site-nav .site-nav__inner {
    flex-wrap: wrap;
  }

  .site-nav__menu {
    order: 3;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .site-nav__menu ul {
    white-space: nowrap;
    padding-bottom: 5px;
  }

  .site-nav__actions {
    gap: 8px;
  }

  .site-nav__actions .btn {
    padding: 6px 12px;
    font-size: 13px;
  }

  /* Search bar fullwidth on tablet */
  .site-nav .search-bar,
  .navigation .search-bar {
    width: 100%;
    max-width: 100%;
  }
}

/* Mobile: ≤767px */
@media (max-width: 767px) {
  body {
    padding-top: 60px !important;
  }

  .navigation,
  .site-nav,
  header.site-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1050;
  }

  .nav-logo img,
  .site-nav__logo img {
    max-height: 40px;
    width: auto;
  }

  /* Hide desktop nav items, show hamburger */
  .nav-hide-mobile {
    display: none !important;
  }

  .mobile-menu-toggle,
  .hamburger-menu,
  .side-bar {
    display: block !important;
  }

  /* Mobile sidenav overlay */
  #mySidenav {
    width: 280px !important;
    max-width: 85vw;
    z-index: 1100 !important;
  }

  /* Full-width search on mobile */
  .search-bar,
  .search-form,
  .header-search {
    width: 100% !important;
    max-width: 100% !important;
  }

  .search-bar input,
  .search-form input {
    width: 100% !important;
    font-size: 16px; /* prevents iOS zoom */
  }

  /* Dropdown menus on mobile */
  .dropdown-menu {
    position: fixed !important;
    left: 5% !important;
    right: 5% !important;
    width: 90% !important;
    max-height: 70vh;
    overflow-y: auto;
  }
}

/* Small phones: ≤480px */
@media (max-width: 480px) {
  body {
    padding-top: 55px !important;
  }

  .nav-logo img,
  .site-nav__logo img {
    max-height: 32px;
  }

  .site-nav__actions > *:not(.mobile-menu-toggle) {
    display: none;
  }
}

/* =============================================
   HERO / SLIDER SECTIONS
   ============================================= */
@media (max-width: 991px) {
  .hero-area,
  .main-slider,
  .slider-area,
  .home-slider {
    min-height: 300px;
    max-height: 50vh;
  }

  .hero-area .hero-content h1,
  .slider-content h1 {
    font-size: 28px;
    line-height: 1.3;
  }

  .hero-area .hero-content p,
  .slider-content p {
    font-size: 14px;
  }
}

@media (max-width: 767px) {
  .hero-area,
  .main-slider,
  .slider-area,
  .home-slider {
    min-height: 200px;
    max-height: 40vh;
  }

  .hero-area .hero-content h1,
  .slider-content h1 {
    font-size: 22px;
  }
}

@media (max-width: 480px) {
  .hero-area .hero-content h1,
  .slider-content h1 {
    font-size: 18px;
  }

  .hero-area .btn,
  .slider-content .btn {
    padding: 8px 16px;
    font-size: 13px;
  }
}

/* =============================================
   CONTENT GRIDS & CARDS — Movie/Show/Audio
   ============================================= */

/* General card grid responsive */
@media (max-width: 1199px) {
  .main-wrapper .row > [class*="col-lg-2"] {
    flex: 0 0 25%;
    max-width: 25%;
  }
}

@media (max-width: 991px) {
  .main-wrapper .row > [class*="col-lg-2"],
  .main-wrapper .row > [class*="col-md-3"] {
    flex: 0 0 33.333%;
    max-width: 33.333%;
  }

  /* Movie/show cards */
  .movie-card,
  .video-card,
  .show-card,
  .audio-card {
    margin-bottom: 15px;
  }

  .movie-card img,
  .video-card img,
  .show-card img {
    border-radius: 6px;
  }
}

@media (max-width: 767px) {
  .main-wrapper .row > [class*="col-lg-2"],
  .main-wrapper .row > [class*="col-md-3"],
  .main-wrapper .row > [class*="col-sm-4"] {
    flex: 0 0 50%;
    max-width: 50%;
  }

  .section-heading h2,
  .block-title h2,
  .genre-title h2 {
    font-size: 20px;
  }

  .section-heading,
  .block-title {
    margin-bottom: 15px;
  }
}

@media (max-width: 480px) {
  .main-wrapper .row > [class*="col-lg-2"],
  .main-wrapper .row > [class*="col-md-3"],
  .main-wrapper .row > [class*="col-sm-4"],
  .main-wrapper .row > [class*="col-sm-6"] {
    flex: 0 0 50%;
    max-width: 50%;
    padding-left: 5px;
    padding-right: 5px;
  }

  .container,
  .container-fluid {
    padding-left: 10px;
    padding-right: 10px;
  }
}

/* =============================================
   SLICK SLIDER / OWL CAROUSEL Responsive
   ============================================= */
@media (max-width: 767px) {
  .slick-prev,
  .slick-next,
  .owl-prev,
  .owl-next {
    width: 30px !important;
    height: 30px !important;
    font-size: 14px !important;
  }

  .slick-prev {
    left: 5px !important;
  }

  .slick-next {
    right: 5px !important;
  }
}

/* =============================================
   MOVIE SINGLE / DETAIL PAGE
   ============================================= */
@media (max-width: 991px) {
  .movie-single-ct,
  .movie-detail,
  .single-movie-info {
    padding: 20px 15px;
  }

  .movie-detail .row {
    flex-direction: column;
  }

  .movie-poster-area {
    text-align: center;
    margin-bottom: 20px;
  }

  .movie-poster-area img {
    max-width: 300px;
    margin: 0 auto;
  }
}

@media (max-width: 767px) {
  .movie-info-table td,
  .movie-info-table th {
    display: block;
    width: 100%;
    padding: 5px 0;
  }

  .movie-info-table tr {
    display: block;
    margin-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 10px;
  }

  .movie-buttons .btn {
    display: block;
    width: 100%;
    margin-bottom: 8px;
  }

  .rating-area {
    flex-wrap: wrap;
    gap: 10px;
  }
}

/* =============================================
   VIDEO PLAYER
   ============================================= */
@media (max-width: 767px) {
  .video-container,
  .player-container,
  #video-player-wrapper {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 16 / 9;
  }

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

  .vjs-control-bar {
    font-size: 12px;
  }

  /* Hide less important controls on mobile */
  .vjs-playback-rate,
  .vjs-picture-in-picture-control {
    display: none !important;
  }
}

/* =============================================
   SUBSCRIPTION / PRICING CARDS
   ============================================= */
@media (max-width: 991px) {
  .pricing-table .row > [class*="col-"] {
    flex: 0 0 50%;
    max-width: 50%;
    margin-bottom: 20px;
  }
}

@media (max-width: 575px) {
  .pricing-table .row > [class*="col-"] {
    flex: 0 0 100%;
    max-width: 100%;
  }

  .pricing-card,
  .plan-card {
    max-width: 350px;
    margin: 0 auto 20px;
  }
}

/* =============================================
   FORMS — Login, Register, Subscribe
   ============================================= */
@media (max-width: 767px) {
  .login-form,
  .register-form,
  .subscribe-form,
  .auth-form {
    padding: 20px 15px;
    max-width: 100%;
  }

  .form-group label {
    font-size: 13px;
    margin-bottom: 5px;
  }

  .form-control {
    font-size: 16px !important; /* prevents iOS zoom on focus */
    padding: 10px 12px;
  }

  select.form-control {
    font-size: 16px !important;
  }

  .btn-submit,
  .form-submit .btn {
    width: 100%;
    padding: 12px;
    font-size: 16px;
  }
}

/* =============================================
   FOOTER
   ============================================= */
@media (max-width: 991px) {
  .footer-area .row > [class*="col-"] {
    margin-bottom: 30px;
  }

  .footer-widget {
    text-align: center;
  }

  .footer-social {
    justify-content: center;
  }
}

@media (max-width: 575px) {
  .footer-area {
    padding: 30px 10px;
  }

  .footer-bottom {
    flex-direction: column;
    text-align: center;
    gap: 10px;
  }

  .footer-area .row > [class*="col-"] {
    flex: 0 0 100%;
    max-width: 100%;
  }
}

/* =============================================
   MODALS — Responsive
   ============================================= */
@media (max-width: 767px) {
  .modal-dialog {
    margin: 10px !important;
    max-width: calc(100% - 20px) !important;
  }

  .modal-content {
    border-radius: 8px;
  }

  .modal-header {
    padding: 12px 15px;
  }

  .modal-body {
    padding: 15px;
    max-height: 65vh;
    overflow-y: auto;
  }

  .modal-footer {
    padding: 10px 15px;
    flex-wrap: wrap;
    gap: 8px;
  }

  .modal-footer .btn {
    flex: 1 1 auto;
    min-width: 100px;
  }
}

/* =============================================
   TABLES — Responsive Scroll
   ============================================= */
@media (max-width: 767px) {
  .table-responsive {
    border: 0;
  }

  table:not(.dataTable) {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .table td, .table th {
    white-space: nowrap;
    padding: 8px 10px;
    font-size: 13px;
  }
}

/* =============================================
   COMMENTS / REVIEWS
   ============================================= */
@media (max-width: 767px) {
  .comment-area,
  .review-area {
    padding: 15px 10px;
  }

  .comment-item {
    flex-direction: column;
  }

  .comment-avatar {
    margin-bottom: 10px;
  }

  .comment-content {
    width: 100%;
  }
}

/* =============================================
   BREADCRUMBS
   ============================================= */
@media (max-width: 575px) {
  .breadcrumb {
    font-size: 12px;
    padding: 8px 10px;
    flex-wrap: wrap;
  }

  .breadcrumb-item + .breadcrumb-item::before {
    padding: 0 4px;
  }
}

/* =============================================
   GENRE / CATEGORY PAGES
   ============================================= */
@media (max-width: 767px) {
  .genre-list,
  .category-tabs {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 8px;
    padding-bottom: 10px;
  }

  .genre-list .genre-item,
  .category-tabs .tab-item {
    flex-shrink: 0;
    white-space: nowrap;
    padding: 8px 16px;
    font-size: 13px;
  }
}

/* =============================================
   USER PROFILE / WATCHLIST / HISTORY
   ============================================= */
@media (max-width: 767px) {
  .user-profile-area {
    flex-direction: column;
    text-align: center;
  }

  .user-avatar {
    margin-bottom: 15px;
  }

  .user-info {
    width: 100%;
  }

  .watchlist-grid,
  .history-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
}

@media (max-width: 480px) {
  .watchlist-grid,
  .history-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
}

/* =============================================
   BACK TO TOP BUTTON
   ============================================= */
@media (max-width: 767px) {
  .back-to-top,
  #back-to-top {
    bottom: 15px !important;
    right: 15px !important;
    width: 40px !important;
    height: 40px !important;
    font-size: 16px !important;
  }
}

/* =============================================
   COOKIE CONSENT BANNER
   ============================================= */
@media (max-width: 575px) {
  .cookie-consent,
  .cc-window {
    flex-direction: column !important;
    padding: 15px !important;
    text-align: center;
  }

  .cc-btn,
  .cookie-consent .btn {
    width: 100%;
    margin-top: 10px;
  }
}

/* =============================================
   PAGINATION
   ============================================= */
@media (max-width: 575px) {
  .pagination {
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px;
  }

  .pagination .page-link {
    padding: 6px 10px;
    font-size: 13px;
    min-width: 36px;
    text-align: center;
  }
}

/* =============================================
   LANDSCAPE ORIENTATION FIX
   ============================================= */
@media (max-height: 500px) and (orientation: landscape) {
  body {
    padding-top: 50px !important;
  }

  .navigation,
  .site-nav {
    height: 50px;
  }

  .hero-area,
  .main-slider {
    min-height: 200px;
    max-height: 60vh;
  }
}

/* =============================================
   TABLET PORTRAIT — iPad etc (768px-1024px)
   ============================================= */
@media (min-width: 768px) and (max-width: 1024px) {
  .container {
    max-width: 100%;
    padding-left: 20px;
    padding-right: 20px;
  }

  .main-wrapper .row > [class*="col-lg-2"] {
    flex: 0 0 25%;
    max-width: 25%;
  }

  .movie-single-ct .row > .col-lg-4 {
    flex: 0 0 35%;
    max-width: 35%;
  }

  .movie-single-ct .row > .col-lg-8 {
    flex: 0 0 65%;
    max-width: 65%;
  }
}

/* =============================================
   HIGH DPI / RETINA ADJUSTMENTS
   ============================================= */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .nav-logo img,
  .site-nav__logo img {
    image-rendering: -webkit-optimize-contrast;
  }
}

/* =============================================
   PRINT STYLES
   ============================================= */
@media print {
  .navigation, .site-nav, .footer-area, .back-to-top,
  #mySidenav, .cookie-consent, .modal, .side-bar {
    display: none !important;
  }

  body {
    padding-top: 0 !important;
    color: #000;
    background: #fff;
  }

  .main-wrapper {
    margin: 0;
    padding: 0;
  }
}

/* =============================================
   COMMENT SECTION — Mobile Responsive
   ============================================= */

/* Reduce nested comment indentation on small screens */
@media (max-width: 576px) {
  .comment[style*="margin-left:50px"],
  .comment[style*="margin-left: 50px"] {
    margin-left: 20px !important;
  }

  .comment-nav-tabs .author-image {
    width: 36px !important;
    height: 36px !important;
  }

  .comment-nav-tabs .author-name {
    margin-left: 8px !important;
  }

  .comment-nav-tabs .author-heading {
    font-size: 13px !important;
  }

  .comment-nav-tabs .comment-content {
    margin-left: 44px !important;
    font-size: 14px !important;
  }

  .comment-nav-tabs .btn {
    padding: 4px 8px !important;
    font-size: 12px !important;
  }

  .comment-nav-tabs .nav-tabs > li > a {
    padding: 8px 12px !important;
    font-size: 13px !important;
  }

  .container-fluid.movie-series-section.comment-nav-tabs {
    padding: 10px 5px !important;
  }

  .container-fluid .movie-series-section.comment-nav-tabs .tab-content .fade {
    padding: 0 10px 15px !important;
  }
}

/* =============================================
   TOAST NOTIFICATIONS — Mobile
   ============================================= */
@media (max-width: 480px) {
  .toast {
    width: 90vw !important;
    max-width: 300px !important;
    right: 5vw !important;
    left: 5vw !important;
  }
}

/* =============================================
   MOVIE DETAIL PAGE — Mobile Responsive
   ============================================= */
@media (max-width: 576px) {
  /* Movie series episode row */
  .movie-series-block .row {
    flex-direction: column;
  }

  .movie-series-block .col-lg-2 {
    width: 100% !important;
    max-width: 100% !important;
    margin-bottom: 10px;
  }

  .movie-series-block .col-lg-10 {
    width: 100% !important;
    max-width: 100% !important;
  }

  .movie-series-img {
    max-width: 150px;
  }

  /* Full movie detail block */
  .full-movie-dtl-main-block .col-lg-3,
  .full-movie-dtl-main-block .col-lg-9 {
    width: 100% !important;
    max-width: 100% !important;
  }

  /* Subscription modal */
  .comment-modal .modal-dialog {
    margin: 10px !important;
    width: auto !important;
  }

  /* Tab navigation scrollable */
  .comment-nav-tabs .nav-tabs {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .comment-nav-tabs .nav-tabs > li {
    flex-shrink: 0;
  }
}

/* =============================================
   SUBSCRIBE PAGE — Mobile
   ============================================= */
@media (max-width: 576px) {
  .purchase-plan-main-block .col-md-4,
  .purchase-plan-main-block .col-md-6,
  .purchase-plan-main-block .col-md-8 {
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 10px !important;
  }

  .plan-block {
    margin-bottom: 15px !important;
  }
}

/* =============================================
   SIDENAV OVERLAY — Mobile
   ============================================= */
@media (max-width: 768px) {
  .sidenav {
    max-width: 85vw !important;
  }
}

/* =============================================
   FORM ELEMENTS — Mobile
   ============================================= */
@media (max-width: 576px) {
  .form-control {
    font-size: 16px !important; /* Prevent iOS zoom on focus */
  }

  .modal-dialog {
    margin: 10px !important;
  }

  .modal-content {
    border-radius: 8px !important;
  }
}

/* =============================================
   TABLE — Mobile Responsive
   ============================================= */
@media (max-width: 576px) {
  .table-responsive {
    border: 0;
  }

  .user-account-section .table td,
  .user-account-section .table th {
    padding: 8px 6px !important;
    font-size: 13px !important;
  }
}
