/* ===========================================
   Aflamicose - responsive.css
   استجابة الأجهزة المختلفة
=========================================== */

/* ===== Large Desktop: 1400px+ ===== */
@media (min-width: 1400px) {
    .container { max-width: 1380px; }
    .hero-title { font-size: 3.2rem; }
    .grid-5 { grid-template-columns: repeat(5, 1fr); }
    .grid-6 { grid-template-columns: repeat(6, 1fr); }
}

/* ===== Desktop: up to 1200px ===== */
@media (max-width: 1200px) {
    .grid-6 { grid-template-columns: repeat(5, 1fr); }
    .footer-middle-grid { grid-template-columns: 2fr 1fr 1fr; }
    .footer-latest-col { display: none; }
    .top-three-showcase { grid-template-columns: repeat(3, 1fr); }
}

/* ===== Tablet Landscape: up to 1024px ===== */
@media (max-width: 1024px) {
    .movie-layout { grid-template-columns: 240px 1fr; gap: 25px; }
    .grid-5 { grid-template-columns: repeat(4, 1fr); }
    .grid-6 { grid-template-columns: repeat(4, 1fr); }
    .footer-widgets-grid { grid-template-columns: repeat(2, 1fr); }
    .footer-middle-grid { grid-template-columns: 1fr 1fr; gap: 25px; }
    .details-table { grid-template-columns: 1fr; }
    .hero-title { font-size: 2.2rem; }
    .hero-poster img { width: 160px; }
    .person-layout { grid-template-columns: 240px 1fr; }
    .profile-layout { grid-template-columns: 240px 1fr; }
    .top-three-showcase { grid-template-columns: repeat(3, 1fr); }
}

/* ===== Tablet Portrait: up to 768px ===== */
@media (max-width: 768px) {
    /* Navigation */
    .main-nav { display: none; }
    .mobile-menu-toggle { display: flex; }
    .user-name { display: none; }

    /* Hero */
    .hero-slider { height: 70vh; min-height: 450px; max-height: 600px; }
    .hero-content { flex-direction: column; gap: 20px; align-items: flex-start; padding: 70px 0 40px; }
    .hero-poster img { width: 120px; }
    .hero-title { font-size: 1.6rem; }
    .hero-excerpt { display: none; }
    .hero-buttons { gap: 8px; }
    .btn-hero-watch, .btn-hero-info { padding: 11px 18px; font-size: .88rem; }
    .hero-prev { right: 10px; }
    .hero-next { left: 10px; }

    /* Grids */
    .grid-4 { grid-template-columns: repeat(3, 1fr); }
    .grid-5 { grid-template-columns: repeat(3, 1fr); }
    .grid-6 { grid-template-columns: repeat(3, 1fr); }

    /* Movie Layout */
    .movie-layout { grid-template-columns: 1fr; margin-top: -80px; }
    .movie-sidebar-col { position: static; display: grid; grid-template-columns: 180px 1fr; gap: 20px; }
    .movie-poster-wrap { max-width: 180px; }
    .movie-title { font-size: 1.6rem; }

    /* Person Layout */
    .person-layout { grid-template-columns: 1fr; }
    .person-photo-col { display: flex; gap: 20px; align-items: flex-start; }
    .person-photo-wrap { max-width: 130px; }

    /* Profile Layout */
    .profile-layout { grid-template-columns: 1fr; }

    /* Footer */
    .footer-middle-grid { grid-template-columns: 1fr 1fr; }
    .footer-widgets-grid { grid-template-columns: 1fr 1fr; }
    .footer-bottom-row { flex-direction: column; text-align: center; }

    /* Episode Nav */
    .episode-navigation { grid-template-columns: 1fr; }

    /* Top Three */
    .top-three-showcase { grid-template-columns: 1fr; }
    .trending-grid { grid-template-columns: 1fr; }

    /* Search */
    .search-results-grid { grid-template-columns: 1fr; }

    /* Profile */
    .profile-form .form-row { grid-template-columns: 1fr; }

    /* Ads */
    .mobile-only { display: block; }
    .desktop-only { display: none; }

    /* Sections header */
    .section-title { font-size: 1.1rem; }
    .taxonomy-title { font-size: 1.8rem; }
    .page-title { font-size: 1.6rem; }
    .archive-title { font-size: 1.6rem; }
}

/* ===== Mobile: up to 480px ===== */
@media (max-width: 480px) {
    /* Base */
    :root { font-size: 15px; }
    .container { padding: 0 14px; }

    /* Hero */
    .hero-slider { height: 55vh; min-height: 380px; }
    .hero-content { gap: 12px; padding: 65px 0 30px; }
    .hero-poster { display: none; }
    .hero-title { font-size: 1.4rem; }
    .hero-meta { gap: 8px; }
    .btn-hero-watch { padding: 10px 16px; font-size: .85rem; }
    .btn-hero-info { display: none; }

    /* Grids */
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .grid-5 { grid-template-columns: repeat(2, 1fr); }
    .grid-6 { grid-template-columns: repeat(2, 1fr); }
    .movies-row .movie-card { flex: 0 0 140px; }

    /* Movie Layout */
    .movie-sidebar-col { grid-template-columns: 140px 1fr; gap: 14px; }
    .movie-poster-wrap { max-width: 140px; }
    .movie-title { font-size: 1.3rem; }
    .details-table { grid-template-columns: 1fr; }
    .movie-action-buttons { flex-direction: row; flex-wrap: wrap; }
    .btn-action { flex: 1; min-width: 120px; font-size: .8rem; padding: 10px; }

    /* Footer */
    .footer-middle-grid { grid-template-columns: 1fr; }
    .footer-widgets-grid { grid-template-columns: 1fr; }
    .footer-about { margin-bottom: 20px; }

    /* Cast Slider */
    .cast-card { flex: 0 0 90px; }

    /* Episodes */
    .episodes-grid { grid-template-columns: repeat(2, 1fr); }

    /* Filter */
    .filter-form { flex-direction: column; }
    .filter-group { width: 100%; }

    /* Pagination */
    .page-numbers a, .page-numbers span { width: 34px; height: 34px; font-size: .8rem; }

    /* IMDb */
    .top-three-showcase { grid-template-columns: 1fr; }
    .imdb-list-item { flex-wrap: wrap; }
    .list-info { width: 100%; order: 3; }

    /* Trending */
    .trending-item { flex-wrap: nowrap; }
    .trending-rank { display: none; }

    /* User pages */
    .profile-stats { grid-template-columns: repeat(3, 1fr); }
    .history-item { flex-wrap: wrap; }

    /* 404 */
    .num-4 { font-size: 5rem; }
    .num-0 { width: 80px; height: 80px; }
    .reel-icon { font-size: 2.5rem; }
    .error-actions { flex-direction: column; align-items: center; }

    /* Person */
    .person-photo-col { flex-direction: column; }
    .person-name { font-size: 1.6rem; }

    /* Search */
    .search-filter-bar { flex-direction: column; align-items: flex-start; }
    .search-form-large { flex-direction: row; }

    /* Scroll to top */
    .scroll-to-top { bottom: 15px; left: 15px; width: 38px; height: 38px; }

    /* Genre showcase */
    .genres-showcase { grid-template-columns: repeat(2, 1fr); }
    .genres-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ===== Very Small Mobile: 320px ===== */
@media (max-width: 360px) {
    .hero-title { font-size: 1.2rem; }
    .grid-5 { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .grid-6 { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .profile-stats { grid-template-columns: repeat(3, 1fr); }
    .profile-stats .stat-num { font-size: 1.1rem; }
}

/* ===== Print Media ===== */
@media print {
    .site-header, .site-footer, .scroll-to-top, .ad-zone, .movie-action-buttons, .player-section, .cast-section { display: none !important; }
    body { background: #fff; color: #000; }
    a { color: #000; }
}

/* ===== High DPI / Retina ===== */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .movie-poster, .person-photo, .profile-avatar { image-rendering: -webkit-optimize-contrast; }
}
