/* ========================================
   MOTCHILL RESPONSIVE CSS - CLEAN & LOGICAL
   ======================================== */

/* ========================================
   RESPONSIVE CSS - MOBILE & TABLET ONLY
   ======================================== */

/* Global box-sizing - Only for mobile/tablet */
@media (max-width: 1024px) {
    * {
        box-sizing: border-box !important;
    }
}

/* ========================================
   RESPONSIVE HEADER LAYOUT - CLEAN LOGIC
   ======================================== */

/* iPhone XR & Small Mobile (≤414px) - Hamburger trái - Logo giữa - Search phải */
@media (max-width: 414px) {
  /* Prevent overflow */
  html, body {
    overflow-x: hidden !important;
    max-width: 100vw !important;
  }
  
  /* Mobile Header Layout - Space Between */
  .motchill-top-bar {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
    padding: 10px 15px !important;
    gap: 0 !important;
  }
  
  /* Mobile Buttons Container - Bên trái */
  .mobile-buttons {
    display: flex !important;
    align-items: center !important;
    order: 1 !important; /* Bên trái */
  }
  
  /* Logo positioning - Ở giữa */
  .motchill-logo {
    order: 2 !important; /* Ở giữa */
    flex: 1 !important; /* Chiếm không gian còn lại */
    text-align: center !important;
    margin: 0 auto !important;
    min-width: auto !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
  }
  
  /* Mobile Search Button - Bên phải */
  .mobile-search-button {
    order: 3 !important; /* Bên phải */
    display: block !important;
  }
  
  /* Hide desktop elements on mobile */
  .motchill-search-section,
  .motchill-user-actions {
    display: none !important;
  }
  
  /* Mobile Search Buttons */
  .mobile-hamburger,
  .mobile-search {
    width: 40px !important;
    height: 40px !important;
    background: transparent !important;
    border: none !important;
    color: #fff !important;
    font-size: 18px !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    border-radius: 6px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  .mobile-hamburger:hover,
  .mobile-search:hover {
    background: rgba(221, 0, 63, 0.2) !important;
    color: #DD003F !important;
  }
  
  /* Fix header z-index to prevent covering content */
  .motchill-header {
    position: relative !important;
    z-index: 100 !important;
  }
  
  /* Ensure content is not covered by header */
  .container {
    margin-top: 0 !important;
    padding-top: 0 !important;
  }
  
  /* iPad Mini and iPad Air specific styles */
  @media (min-width: 768px) and (max-width: 1024px) {
    /* iPad Header Layout - Space Between */
    .motchill-top-bar {
      display: flex !important;
      align-items: center !important;
      justify-content: space-between !important;
      width: 100% !important;
      padding: 15px 20px !important;
      gap: 0 !important;
    }
    
    /* Logo positioning for iPad */
    .motchill-logo {
      order: 2 !important; /* Ở giữa */
      flex: 1 !important; /* Chiếm không gian còn lại */
      text-align: center !important;
      margin: 0 auto !important;
      min-width: auto !important;
      display: flex !important;
      justify-content: center !important;
      align-items: center !important;
    }
    
    /* Show hamburger menu for iPad */
    .mobile-buttons {
      display: flex !important;
      align-items: center !important;
      order: 1 !important; /* Bên trái */
    }
    
    /* Show mobile search button for iPad */
    .mobile-search-button {
      display: block !important;
      order: 3 !important; /* Bên phải */
    }
    
    .mobile-hamburger,
    .mobile-search {
      display: flex !important;
      width: 45px !important;
      height: 45px !important;
      background: rgba(221, 0, 63, 0.1) !important;
      border: 1px solid rgba(221, 0, 63, 0.3) !important;
      color: #fff !important;
      font-size: 20px !important;
      cursor: pointer !important;
      transition: all 0.3s ease !important;
      border-radius: 8px !important;
      align-items: center !important;
      justify-content: center !important;
    }
    
    .mobile-hamburger:hover,
    .mobile-search:hover {
      background: rgba(221, 0, 63, 0.2) !important;
      color: #DD003F !important;
    }
    
    /* Hide desktop elements on iPad - REMOVED (handled by new responsive flow) */
  }
  
  /* iPad Pro specific styles */
  @media (min-width: 1024px) and (max-width: 1366px) {
    /* iPad Pro Header Layout - Space Between */
    .motchill-top-bar {
      display: flex !important;
      align-items: center !important;
      justify-content: space-between !important;
      width: 100% !important;
      padding: 15px 25px !important;
      gap: 0 !important;
    }
    
    /* Logo positioning for iPad Pro */
    .motchill-logo {
      order: 2 !important; /* Ở giữa */
      flex: 1 !important; /* Chiếm không gian còn lại */
      text-align: center !important;
      margin: 0 auto !important;
      min-width: auto !important;
      display: flex !important;
      justify-content: center !important;
      align-items: center !important;
    }
    
    /* Show hamburger menu for iPad Pro */
    .mobile-buttons {
      display: flex !important;
      align-items: center !important;
      order: 1 !important; /* Bên trái */
    }
    
    /* Show mobile search button for iPad Pro */
    .mobile-search-button {
      display: block !important;
      order: 3 !important; /* Bên phải */
    }
    
    .mobile-hamburger,
    .mobile-search {
      display: flex !important;
      width: 45px !important;
      height: 45px !important;
      background: rgba(221, 0, 63, 0.1) !important;
      border: 1px solid rgba(221, 0, 63, 0.3) !important;
      color: #fff !important;
      font-size: 20px !important;
      cursor: pointer !important;
      transition: all 0.3s ease !important;
      border-radius: 8px !important;
      align-items: center !important;
      justify-content: center !important;
    }
    
    .mobile-hamburger:hover,
    .mobile-search:hover {
      background: rgba(221, 0, 63, 0.2) !important;
      color: #DD003F !important;
    }
    
    /* Hide desktop elements on iPad Pro - REMOVED (handled by new responsive flow) */
    
    /* Fix search results z-index for iPad Pro */
    .desktop-search-results {
      z-index: 10001 !important;
      position: absolute !important;
      top: 100% !important;
      left: 0 !important;
      right: 0 !important;
    }
  }

  /* Mobile Search Container */
  .mobile-search-container {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(0, 0, 0, 0.9) !important;
    z-index: 10000 !important;
    display: none !important;
    align-items: center !important;
    justify-content: center !important;
    backdrop-filter: blur(10px) !important;
    opacity: 0 !important;
    transition: all 0.3s ease !important;
    align-items: flex-start !important;
    justify-content: center !important;
    padding-top: 150px !important; /* Tăng padding để khung search thấp xuống hơn */
  }
  
  .mobile-search-container.active {
    display: flex !important;
    opacity: 1 !important;
  }

  /* Mobile Search Dropdown */
  .mobile-search-dropdown {
    position: relative !important;
    width: 90% !important;
    max-width: 400px !important;
    background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%) !important;
    border: 1px solid #333 !important;
    border-radius: 12px !important;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3) !important;
    z-index: 10001 !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
    transition: all 0.3s ease !important;
    padding: 20px !important;
    margin: 0 !important;
    display: block !important;
    margin-top: 30px !important; /* Tăng margin để khung search thấp xuống hơn */
  }
  
  /* Mobile Search Input */
  .mobile-search-input {
    width: 100% !important;
    padding: 12px 15px !important;
    background: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid #333 !important;
    border-radius: 8px !important;
    color: #fff !important;
    font-size: 16px !important;
    margin-bottom: 15px !important;
  }
  
  .mobile-search-input::placeholder {
    color: #999 !important;
  }
  
  .mobile-search-input:focus {
    outline: none !important;
    border-color: #DD003F !important;
    background: rgba(255, 255, 255, 0.15) !important;
  }
  
  /* Mobile Search Results */
  .mobile-search-results {
    max-height: 300px !important;
    overflow-y: auto !important;
    margin-top: 15px !important;
  }
  
  .mobile-search-result-item {
    display: flex !important;
    align-items: center !important;
    padding: 10px !important;
    border-bottom: 1px solid #333 !important;
    cursor: pointer !important;
    transition: background 0.3s ease !important;
  }
  
  .mobile-search-result-item:hover {
    background: rgba(221, 0, 63, 0.1) !important;
  }
  
  .mobile-search-result-item img {
    width: 40px !important;
    height: 60px !important;
    object-fit: cover !important;
    border-radius: 4px !important;
    margin-right: 10px !important;
  }
  
  .mobile-search-result-item .info {
    flex: 1 !important;
  }
  
  .mobile-search-result-item .title {
    color: #fff !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    margin-bottom: 4px !important;
  }
  
  .mobile-search-result-item .meta {
    color: #999 !important;
    font-size: 12px !important;
  }
  
  /* Mobile Search Close Button */
  .mobile-search-close {
    position: absolute !important;
    top: 15px !important;
    right: 15px !important;
    background: transparent !important;
    border: none !important;
    color: #fff !important;
    font-size: 20px !important;
    cursor: pointer !important;
    z-index: 10002 !important;
  }
  
  .mobile-search-close:hover {
    color: #DD003F !important;
  }
  

  .mobile-search-dropdown.active {
    display: block !important;
  }

  .mobile-search-input-group {
    display: flex !important;
    gap: 8px !important;
    margin-bottom: 10px !important;
  }

  .mobile-search-input {
    flex: 1 !important;
    padding: 12px !important;
    border: 1px solid #444 !important;
    border-radius: 6px !important;
    background: rgba(0,0,0,0.3) !important;
    color: #fff !important;
    font-size: 14px !important;
    transition: all 0.3s ease !important;
  }

  .mobile-search-input:focus {
    outline: none !important;
    border-color: #DD003F !important;
    box-shadow: 0 0 5px rgba(221, 0, 63, 0.3) !important;
  }

  .mobile-search-input::placeholder {
    color: #888 !important;
  }

  .mobile-search-submit {
    padding: 12px 16px !important;
    background: linear-gradient(135deg, #DD003F 0%, #FF1744 100%) !important;
    border: none !important;
    border-radius: 6px !important;
    color: #fff !important;
    font-size: 14px !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
  }

  .mobile-search-submit:hover {
    transform: scale(1.05) !important;
  }
  
  .container {
    max-width: 100vw !important;
    padding: 0 5px !important;
  }
  
  /* Header Layout */
  html body .motchill-top-bar {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 10px 0 !important;
    gap: 5px !important;
    position: relative !important;
    max-width: 100% !important;
    flex-wrap: nowrap !important;
  }
  
  /* Mobile Buttons Container - Left */
  html body .mobile-buttons {
    display: flex !important;
    order: 1 !important;
    flex: 0 0 auto !important;
    gap: 8px !important;
    align-items: center !important;
  }
  
  /* Logo - Center */
  html body .motchill-logo {
    flex: 1 !important;
    text-align: center !important;
    order: 2 !important;
    margin: 0 !important;
  }
  
  /* Hide Desktop Elements */
  html body .motchill-user-actions {
    display: none !important;
  }
  
  html body .motchill-search-section {
    display: none !important;
  }
  
  html body .motchill-nav {
    display: none !important;
  }
  
  /* Mobile Search Container - Toggle */
  html body .mobile-search-container {
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    right: 0 !important;
    background: rgba(0,0,0,0.95) !important;
    backdrop-filter: blur(10px) !important;
    border-radius: 0 0 15px 15px !important;
    z-index: 9999 !important;
    transform: translateY(-100%) !important;
    transition: all 0.3s ease !important;
  }
  
  html body .mobile-search-container.active {
    transform: translateY(0) !important;
  }
  
  /* Content responsive - Mobile only - FULL WIDTH */
  #content, .main-content {
    max-width: 100% !important;
    width: 100% !important;
    overflow-x: hidden !important;
    padding: 0 !important;
    margin: 0 !important;
  }
  
  /* Homepage responsive - Mobile only - FULL WIDTH */
  .motchill-homepage {
    max-width: 100% !important;
    width: 100% !important;
    overflow-x: hidden !important;
    padding: 0 !important;
  }
  
  /* Homepage sections responsive - Mobile only - FULL WIDTH */
  .homepage-section {
    max-width: 100% !important;
    width: 100% !important;
    overflow-x: hidden !important;
    padding: 10px 0 !important;
    margin: 0 !important;
  }
  
  /* Movie grids responsive - Mobile only */
  .movie-grid, .movie-item {
    max-width: 100% !important;
    overflow-x: hidden !important;
  }
}

/* iPad Mini (768px-820px) - Hamburger trái - Logo giữa - Search phải */
@media (min-width: 768px) and (max-width: 820px) {
  /* Prevent overflow */
  html, body {
    overflow-x: hidden !important;
    max-width: 100vw !important;
  }
  
  .container {
    max-width: 100vw !important;
    padding: 0 10px !important;
  }
  
  /* Header Layout */
  html body .motchill-top-bar {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 12px 0 !important;
    gap: 10px !important;
    position: relative !important;
    max-width: 100% !important;
    flex-wrap: nowrap !important;
  }
  
  /* Hamburger Button - Left */
  html body .mobile-hamburger {
    display: flex !important;
    order: 1 !important;
    flex: 0 0 auto !important;
    align-items: center !important;
    justify-content: center !important;
    width: 40px !important;
    height: 40px !important;
    background: rgba(221, 0, 63, 0.8) !important;
    border: none !important;
    color: #fff !important;
    font-size: 16px !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    border-radius: 6px !important;
  }
  
  html body .mobile-hamburger:hover {
    background: rgba(221, 0, 63, 1) !important;
    transform: scale(1.05) !important;
  }
  
  /* Logo - Center */
  html body .motchill-logo {
    flex: 1 !important;
    text-align: center !important;
    order: 2 !important;
    margin: 0 !important;
  }
  
  /* Search Button - Right */
  html body .mobile-search {
    display: flex !important;
    order: 3 !important;
    flex: 0 0 auto !important;
    align-items: center !important;
    justify-content: center !important;
    width: 40px !important;
    height: 40px !important;
    background: rgba(221, 0, 63, 0.8) !important;
    border: none !important;
    color: #fff !important;
    font-size: 16px !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    border-radius: 6px !important;
  }
  
  html body .mobile-search:hover {
    background: rgba(221, 0, 63, 1) !important;
    transform: scale(1.05) !important;
  }
  
  /* Hide Mobile Buttons Container */
  html body .mobile-buttons {
    display: none !important;
  }
  
  /* Hide Desktop Elements */
  html body .motchill-user-actions {
    display: none !important;
  }
  
  html body .motchill-search-section {
    display: none !important;
  }
  
  html body .motchill-nav {
    display: none !important;
  }
  
  /* Mobile Search Container - Toggle */
  html body .mobile-search-container {
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    right: 0 !important;
    background: rgba(0,0,0,0.95) !important;
    backdrop-filter: blur(10px) !important;
    border-radius: 0 0 15px 15px !important;
    z-index: 9999 !important;
    transform: translateY(-100%) !important;
    transition: all 0.3s ease !important;
  }
  
  html body .mobile-search-container.active {
    transform: translateY(0) !important;
  }
  
  /* Content responsive - iPad Mini only - FULL WIDTH */
  #content, .main-content {
    max-width: 100% !important;
    width: 100% !important;
    overflow-x: hidden !important;
    padding: 0 !important;
    margin: 0 !important;
  }
  
  /* Homepage responsive - iPad Mini only - FULL WIDTH */
  .motchill-homepage {
    max-width: 100% !important;
    width: 100% !important;
    overflow-x: hidden !important;
    padding: 0 !important;
  }
  
  /* Homepage sections responsive - iPad Mini only - FULL WIDTH */
  .homepage-section {
    max-width: 100% !important;
    width: 100% !important;
    overflow-x: hidden !important;
    padding: 15px 0 !important;
    margin: 0 !important;
  }
  
  /* Movie grids responsive - iPad Mini only */
  .movie-grid, .movie-item {
    max-width: 100% !important;
    overflow-x: hidden !important;
  }
}

/* iPad Air (821px-1024px) - Hamburger trái - Logo giữa - Search phải + khung tìm kiếm gọn */
@media (min-width: 821px) and (max-width: 1024px) {
  /* Prevent overflow */
  html, body {
    overflow-x: hidden !important;
    max-width: 100vw !important;
  }
  
  /* Tablet Search Buttons */
  .mobile-search {
    width: 45px !important;
    height: 45px !important;
    background: transparent !important;
    border: none !important;
    color: #fff !important;
    font-size: 20px !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    border-radius: 8px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  .mobile-search:hover {
    background: rgba(221, 0, 63, 0.2) !important;
    color: #DD003F !important;
    transform: scale(1.1) !important;
  }

  /* Tablet Search Container */
  .mobile-search-container {
    position: relative !important;
  }

  /* Tablet Search Dropdown */
  .mobile-search-dropdown {
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    right: 0 !important;
    background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%) !important;
    border: 1px solid #333 !important;
    border-top: none !important;
    border-radius: 0 0 12px 12px !important;
    box-shadow: 0 8px 20px rgba(0,0,0,0.4) !important;
    z-index: 9999 !important;
    opacity: 0 !important;
    visibility: hidden !important;
    transform: translateY(-15px) !important;
    transition: all 0.4s ease !important;
    padding: 20px !important;
    margin: 0 20px !important;
  }

  .mobile-search-dropdown.active {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) !important;
  }

  .mobile-search-input-group {
    display: flex !important;
    gap: 12px !important;
    margin-bottom: 15px !important;
  }

  .mobile-search-input {
    flex: 1 !important;
    padding: 15px !important;
    border: 1px solid #444 !important;
    border-radius: 8px !important;
    background: rgba(0,0,0,0.3) !important;
    color: #fff !important;
    font-size: 16px !important;
    transition: all 0.3s ease !important;
  }

  .mobile-search-input:focus {
    outline: none !important;
    border-color: #DD003F !important;
    box-shadow: 0 0 8px rgba(221, 0, 63, 0.4) !important;
  }

  .mobile-search-input::placeholder {
    color: #888 !important;
  }

  .mobile-search-submit {
    padding: 15px 20px !important;
    background: linear-gradient(135deg, #DD003F 0%, #FF1744 100%) !important;
    border: none !important;
    border-radius: 8px !important;
    color: #fff !important;
    font-size: 16px !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
  }

  .mobile-search-submit:hover {
    transform: scale(1.05) !important;
  }
  
  .container {
    max-width: 100vw !important;
    padding: 0 15px !important;
  }
  
  /* Header Layout */
  html body .motchill-top-bar {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 15px 0 !important;
    gap: 15px !important;
    position: relative !important;
    max-width: 100% !important;
    flex-wrap: nowrap !important;
  }
  
  /* Hamburger Button - Left */
  html body .mobile-hamburger {
    display: flex !important;
    order: 1 !important;
    flex: 0 0 auto !important;
    align-items: center !important;
    justify-content: center !important;
    width: 40px !important;
    height: 40px !important;
    background: rgba(221, 0, 63, 0.8) !important;
    border: none !important;
    color: #fff !important;
    font-size: 16px !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    border-radius: 6px !important;
  }
  
  html body .mobile-hamburger:hover {
    background: rgba(221, 0, 63, 1) !important;
    transform: scale(1.05) !important;
  }
  
  /* Logo - Center */
  html body .motchill-logo {
    flex: 1 !important;
    text-align: center !important;
    order: 2 !important;
    margin: 0 !important;
  }
  
  /* Compact Search Section - Right */
  html body .motchill-search-section {
    display: block !important;
    order: 3 !important;
    flex: 0 0 auto !important;
    max-width: 300px !important;
  }
  
  /* Hide Mobile Buttons Container */
  html body .mobile-buttons {
    display: none !important;
  }
  
  /* Hide Search Button (use desktop search) */
  html body .mobile-search {
    display: none !important;
  }
  
  /* Hide Desktop Elements */
  html body .motchill-user-actions {
    display: none !important;
  }
  
  html body .motchill-nav {
    display: none !important;
  }
  
  /* Hide Mobile Search Container */
  html body .mobile-search-container {
    display: none !important;
  }
  
  /* Content responsive - iPad Air only - FULL WIDTH */
  #content, .main-content {
    max-width: 100% !important;
    width: 100% !important;
    overflow-x: hidden !important;
    padding: 0 !important;
    margin: 0 !important;
  }
  
  /* Homepage responsive - iPad Air only - FULL WIDTH */
  .motchill-homepage {
    max-width: 100% !important;
    width: 100% !important;
    overflow-x: hidden !important;
    padding: 0 !important;
  }
  
  /* Homepage sections responsive - iPad Air only - FULL WIDTH */
  .homepage-section {
    max-width: 100% !important;
    width: 100% !important;
    overflow-x: hidden !important;
    padding: 20px 0 !important;
    margin: 0 !important;
  }
  
  /* Movie grids responsive - iPad Air only */
  .movie-grid, .movie-item {
    max-width: 100% !important;
    overflow-x: hidden !important;
  }
}

/* iPad Pro (1025px-1366px) - Show desktop menu, hide mobile buttons */
@media (min-width: 1025px) and (max-width: 1366px) {
  /* Hide Mobile Elements */
  html body .mobile-buttons {
    display: none !important;
  }
  
  html body .mobile-search-container {
    display: none !important;
  }
  
  /* Show Desktop Elements */
  html body .motchill-user-actions {
    display: flex !important;
  }
  
  html body .motchill-search-section {
    display: block !important;
  }
  
  html body .motchill-nav {
    display: block !important;
  }
  
  /* Center Logo */
  html body .motchill-logo {
    text-align: center !important;
    margin: 0 auto !important;
    flex: none !important;
  }
  
  /* Center Navigation */
  html body .motchill-nav {
    text-align: center !important;
    margin: 0 auto !important;
  }
}

/* Desktop (≥1367px) - Full desktop menu */
@media (min-width: 1367px) {
  /* Hide Mobile Elements */
  html body .mobile-buttons {
    display: none !important;
  }
  
  html body .mobile-search-container {
    display: none !important;
  }
  
  /* Show Desktop Elements */
  html body .motchill-user-actions {
    display: flex !important;
  }
  
  html body .motchill-search-section {
    display: block !important;
  }
  
  html body .motchill-nav {
    display: block !important;
  }
}

/* ========================================
   MOBILE STYLES SECTION - MOVED FROM OPTIMIZED
   ======================================== */

/* ========================================
   MOBILE BUTTONS
   ======================================== */
.mobile-buttons {
  display: none;
  gap: 10px;
}

.mobile-hamburger,
.mobile-search {
  background: rgba(221, 0, 63, 0.2);
  border: 1px solid rgba(221, 0, 63, 0.3);
  color: #fff;
  padding: 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.mobile-hamburger:hover,
.mobile-search:hover {
  background: rgba(221, 0, 63, 0.3);
  transform: scale(1.05);
}

/* ========================================
   MOBILE SEARCH CONTAINER
   ======================================== */
.mobile-search-container {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.9);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
}

.mobile-search-container.active {
  display: flex;
}

.mobile-search-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(221, 0, 63, 0.2);
  border: 1px solid rgba(221, 0, 63, 0.3);
  color: #fff;
  padding: 10px;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s ease;
}

.mobile-search-close:hover {
  background: rgba(221, 0, 63, 0.3);
}

.mobile-search-dropdown {
  background: linear-gradient(135deg, rgba(26, 26, 26, 0.98) 0%, rgba(42, 42, 42, 0.98) 100%);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(221, 0, 63, 0.3);
  border-radius: 12px;
  padding: 30px;
  width: 90%;
  max-width: 500px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.mobile-search-dropdown.active {
  opacity: 1;
  visibility: visible;
}

.mobile-search-input-group {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}

.mobile-search-input {
  flex: 1;
  padding: 15px 20px;
  background: rgba(255,255,255,0.1);
  border: 2px solid rgba(221, 0, 63, 0.3);
  border-radius: 25px;
  color: #fff;
  font-size: 16px;
  outline: none;
}

.mobile-search-input::placeholder {
  color: rgba(255,255,255,0.5);
}

.mobile-search-submit {
  background: linear-gradient(135deg, #DD003F 0%, #ff1744 100%);
  border: none;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  color: #fff;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mobile-search-submit:hover {
  background: linear-gradient(135deg, #ff1744 0%, #ff5722 100%);
  transform: scale(1.1);
}

.mobile-search-results {
  max-height: 300px !important;
  overflow-y: auto !important;
}

.mobile-search-result-item {
  display: flex;
  align-items: center;
  padding: 15px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  cursor: pointer;
  transition: all 0.3s ease;
}

.mobile-search-result-item:hover {
  background: rgba(221, 0, 63, 0.1);
}

.mobile-search-result-item img {
  width: 40px;
  height: 60px;
  object-fit: cover;
  border-radius: 6px;
  margin-right: 15px;
}

.mobile-search-result-item .info {
  flex: 1;
}

.mobile-search-result-item .title {
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 5px;
}

.mobile-search-result-item .original-title {
  color: #DD003F;
  font-size: 12px;
  margin-bottom: 5px;
}

.mobile-search-result-item .meta {
  display: flex;
  gap: 10px;
}

.mobile-search-result-item .meta span {
  color: #999;
  font-size: 11px;
  background: rgba(255,255,255,0.1);
  padding: 2px 6px;
  border-radius: 4px;
}

/* ========================================
   MOBILE SIDEBAR & OVERLAY
   ======================================== */

/* Mobile Sidebar */
.mobile-sidebar {
    position: fixed;
    top: 0;
    left: -300px;
    width: 300px;
    height: 100vh;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 100%);
    z-index: 9998;
    transition: all 0.3s ease;
    overflow-y: auto;
}

.mobile-sidebar.active {
    left: 0;
}

.mobile-menu-header {
    padding: 20px;
    border-bottom: 1px solid rgba(221, 0, 63, 0.2);
}

.mobile-menu-title {
    color: #fff;
    font-size: 18px;
    font-weight: bold;
    margin: 0;
}

.mobile-nav {
    padding: 20px 0;
}

.mobile-menu-item {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    color: #fff;
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s ease;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.mobile-menu-item:hover {
    background: rgba(221, 0, 63, 0.1);
    color: #DD003F;
    text-decoration: none;
}

.mobile-submenu {
    background: rgba(0,0,0,0.3);
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s ease;
}

.mobile-submenu.active {
    max-height: 500px;
}

.mobile-submenu-item {
    display: block;
    padding: 12px 40px;
    color: #ccc;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s ease;
}

.mobile-submenu-item:hover {
    background: rgba(221, 0, 63, 0.1);
    color: #DD003F;
    text-decoration: none;
}

/* Mobile Overlay */
.mobile-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9997;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.mobile-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ========================================
   MOBILE & TABLET RESPONSIVE FIXES
   ======================================== */

/* Images responsive - Global */
img {
    max-width: 100% !important;
    height: auto !important;
}

/* Fix for mobile and tablet specific */
@media (max-width: 1024px) {
    /* Ensure no element exceeds viewport */
    html, body {
        overflow-x: hidden !important;
        max-width: 100vw !important;
    }
    
    /* Fix common overflow culprits */
    .container, .row, .col, [class*="col-"] {
        max-width: 100% !important;
        overflow-x: hidden !important;
    }
    
    /* Navigation responsive */
    .motchill-nav ul {
        max-width: 100% !important;
        overflow-x: hidden !important;
    }
    
    /* Search results responsive */
    .search-results {
        max-width: 100% !important;
        overflow-x: hidden !important;
    }
}

/* ========================================
   RESPONSIVE FLOW - DESKTOP → TABLET → MOBILE
   ======================================== */

/* ========================================
   TABLET LAYOUT (769px - 1024px) - ALL TABLET RULES
   ======================================== */
@media (max-width: 1024px) and (min-width: 769px) {
    /* Header layout cho tablet */
    .motchill-top-bar {
        padding: 12px 20px !important;
        gap: 15px !important;
    }
    
    /* Search section thu nhỏ */
    .motchill-search-section {
        flex: 0 0 300px !important;
        max-width: 300px !important;
        margin: 0 10px !important;
    }
    
    .motchill-search-input {
        padding: 10px 45px 10px 15px !important;
        font-size: 13px !important;
    }
    
    .motchill-search-btn {
        width: 35px !important;
        height: 35px !important;
        font-size: 14px !important;
    }
    
    /* User actions thu nhỏ */
    .motchill-user-actions {
        gap: 10px !important;
        min-width: 150px !important;
    }
    
    .motchill-user-action {
        padding: 5px 10px !important;
        font-size: 12px !important;
    }
    
    .motchill-user-action span {
        display: none !important; /* Ẩn text, chỉ hiện icon */
    }
    
    /* Hiện mobile search button để backup */
    .mobile-search-button {
        display: block !important;
        order: 3 !important;
    }
    
    .mobile-search {
        width: 40px !important;
        height: 40px !important;
        background: rgba(221, 0, 63, 0.1) !important;
        border: 1px solid rgba(221, 0, 63, 0.3) !important;
        color: #fff !important;
        font-size: 16px !important;
        cursor: pointer !important;
        transition: all 0.3s ease !important;
        border-radius: 6px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    .mobile-search:hover {
        background: rgba(221, 0, 63, 0.2) !important;
        color: #DD003F !important;
    }
    
    .mobile-search-container {
        display: none !important;
    }
    
    .mobile-search-container.active {
        display: flex !important;
    }
    
    /* Homepage */
    .homepage-layout {
        flex-direction: column;
        gap: 20px;
    }
    
    .homepage-sidebar {
        flex: none;
        position: static;
        width: 100%;
    }
    
    .homepage-section {
        padding: 20px;
    }
    
    .section-title {
        font-size: 18px;
    }
}

/* MOBILE (<768px) - Chỉ mobile elements */
/* ========================================
   MOBILE LAYOUT (≤768px) - ALL MOBILE RULES
   ======================================== */
@media (max-width: 768px) {
    /* Header Layout */
    .motchill-top-bar {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .motchill-logo {
        order: 1;
        flex: 1;
        text-align: center;
    }
    
    .motchill-search-section {
        order: 3;
        width: 100%;
        margin: 10px 0 0 0;
        display: none !important; /* Ẩn desktop search */
    }
    
    .motchill-user-actions {
        order: 2;
        flex: 0 0 auto;
        display: none !important; /* Ẩn desktop user actions */
    }
    
    .mobile-buttons {
        display: flex !important;
        order: 4;
        flex: 0 0 auto;
    }
    
    .mobile-search-button {
        display: block !important;
    }
    
    .mobile-search-container {
        display: none !important;
    }
    
    .mobile-search-container.active {
        display: flex !important;
    }
    
    .motchill-nav {
        display: none;
    }
    
    .motchill-header .container {
        width: 100%;
        padding: 0 10px;
    }
    
    /* Homepage */
    .motchill-homepage {
        padding-top: 100px;
    }
    
    .homepage-slider-full {
        padding: 20px 0;
    }
    
    /* Search Results */
    .desktop-search-results {
        max-height: 300px;
    }
    
    .desktop-search-result-item {
        padding: 10px 12px;
    }
    
    .desktop-search-result-item img {
        width: 40px;
        height: 56px;
    }
}

/* ========================================
   SMALL MOBILE (≤480px) - EXTRA SMALL SCREENS
   ======================================== */
@media (max-width: 480px) {
    .motchill-logo span {
        font-size: 20px;
    }
    
    .motchill-user-action span {
        display: none;
    }
    
    .motchill-user-action {
        padding: 8px;
    }
}

/* ========================================
   FILTER PAGES RESPONSIVE - MOVED FROM FILTER-PAGES-FIX.CSS
   ======================================== */

/* ========================================
   MOBILE FILTER PAGES (≤768px)
   ======================================== */
@media (max-width: 768px) {
  .form-filter {
    flex-direction: column;
    gap: 15px;
    padding: 20px;
  }
  
  .filter-item {
    width: 100%;
    min-width: auto;
  }
  
  .left-content,
  .right-content {
    width: 100%;
    float: none;
    padding: 0;
    margin-bottom: 20px;
  }
  
  .list-films .item {
    width: calc(50% - 6px);
    margin: 0 3px 12px 3px;
  }
  
  .list-films .item img {
    height: 180px;
  }
  
  .list-films .item .name {
    padding: 8px;
  }
  
  .list-films .item .name-title {
    font-size: 12px;
  }
  
  .list-films .item .original-title-home {
    font-size: 10px;
  }
  
  .filter-clear-btn {
    width: 100%;
    margin-top: 10px;
  }
}

/* ========================================
   SMALL MOBILE FILTER PAGES (≤480px)
   ======================================== */
@media (max-width: 480px) {
  .form-filter {
    padding: 15px;
  }
  
  .list-films {
    padding: 15px;
  }
  
  .list-films .item {
    width: calc(50% - 4px);
    margin: 0 2px 10px 2px;
  }
  
  .list-films .item img {
    height: 160px;
  }
}

/* ========================================
   TABLET FILTER PAGES (769px - 1024px)
   ======================================== */
@media (min-width: 769px) and (max-width: 1024px) {
  .list-films .item {
    width: calc(33.333% - 6px);
    margin: 0 3px 12px 3px;
  }
  
  .list-films .item img {
    height: 190px;
  }
}

/* ========================================
   TABLET HOMEPAGE (≤1024px) - MOVED TO TABLET LAYOUT SECTION
   ======================================== */