/* ==============================================
   كىنوخانا بەت يۈزى ياخشىلاش CSS - ئەلالاشتۇرۇلغان
   نۇسخا: 2.0 - سۈرئەت ئۈچۈن ئەلالاشتۇرۇلغان
   ============================================== */

/* ===== كارتا يۇمشاق ئۆتۈش (پەقەت زۆرۈر ئېلېمېنتلارغا) ===== */
.movies-grid .movie-card,
.recommendations-container .rec-card,
.tv-channels-grid .tv-card {
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

/* ===== دېسكتاپ hover تەسىرى (موبایلدا ئىشلىمەيدۇ) ===== */
@media (min-width: 1024px) {
    .movies-grid .movie-card:hover {
        transform: translateY(-6px);
        box-shadow: 0 15px 35px rgba(0,0,0,0.4), 0 0 20px rgba(255,71,87,0.1);
    }
}

/* ===== كارتا چېكىش تەسىرى (موبایل) ===== */
.movies-grid .movie-card:active {
    transform: scale(0.97);
}

/* ===== كارتا ئىچىدىكى رەسىم hover (پەقەت دېسكتاپ) ===== */
@media (min-width: 1024px) {
    .movie-card:hover .poster-img,
    .rec-card:hover .poster-img {
        transform: scale(1.08);
        filter: brightness(1.1);
    }
}

/* ===== يان تىرەك (دېسكتاپ) ===== */
@media (min-width: 768px) {
    .sidebar-desktop {
        background: rgba(21, 21, 37, 0.95);
    }
    
    .sidebar-item {
        transition: all 0.2s ease;
        border-radius: 12px;
        position: relative;
        overflow: hidden;
    }
    
    .sidebar-item::before {
        content: '';
        position: absolute;
        left: 0;
        top: 0;
        width: 3px;
        height: 100%;
        background: var(--primary, #ff4757);
        transform: scaleY(0);
        transition: transform 0.2s ease;
        border-radius: 0 3px 3px 0;
    }
    
    .sidebar-item:hover::before,
    .sidebar-item.active::before {
        transform: scaleY(1);
    }
    
    .sidebar-item:hover {
        background: rgba(255,71,87,0.08);
        padding-left: 24px;
    }
}

/* ===== مودال - يۇمشاق ئارقا كۆرۈنۈش ===== */
.movie-details-modal .modal-content {
    max-width: 95vw;
    border-radius: 20px;
}

/* ===== VIP بەلگىسى ===== */
.vip-badge {
    background: linear-gradient(135deg, #ffd700, #ff8c00);
    color: #1a1a2e;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.7rem;
    animation: badgePulse 2s infinite;
}

@keyframes badgePulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255,215,0,0.4); }
    50% { box-shadow: 0 0 0 6px rgba(255,215,0,0); }
}

/* ===== تۆۋەنكى يول بېكەت ===== */
.mobile-nav button.active::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 3px;
    background: var(--primary, #ff4757);
    border-radius: 3px;
}

/* ===== يۇمشاق كۆرسەتمە ===== */
.ios-snap-prompt {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(21, 21, 37, 0.95);
    color: #fff;
    padding: 12px 24px;
    border-radius: 50px;
    font-size: 0.85rem;
    z-index: 99999;
    animation: slideUpFade 0.5s ease, fadeOut 0.5s ease 2.5s forwards;
    pointer-events: none;
    white-space: nowrap;
    border: 1px solid rgba(255,255,255,0.1);
}

@keyframes slideUpFade {
    from { opacity: 0; transform: translateX(-50%) translateY(20px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

@keyframes fadeOut {
    to { opacity: 0; transform: translateX(-50%) translateY(-10px); }
}

/* ===== رەسىم fallback ===== */
.poster-img {
    object-fit: cover;
    background: var(--bg-elevated, #1e1e35);
}

/* ===== كاتېگورىيە سىيرىلش ===== */
.category-pills::-webkit-scrollbar { display: none; }

.recommendations-container::-webkit-scrollbar { height: 4px; }
.recommendations-container::-webkit-scrollbar-thumb {
    background: var(--primary, #ff4757);
    border-radius: 4px;
}

/* ===== ئىزدەش رامكىسى ===== */
.search-box input:focus {
    box-shadow: 0 0 0 3px rgba(255,71,87,0.15);
}

/* ===== تېكىست قىسقارتىش ===== */
.movie-card .movie-title,
.rec-card .movie-title {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

/* ===== موبایل مودال ===== */
@media (max-width: 768px) {
    .movie-details-modal .modal-content {
        border-radius: 16px 16px 0 0;
        max-height: 90vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .sidebar-mobile {
        max-height: 100vh;
        -webkit-overflow-scrolling: touch;
    }
}

/* ===== يان تىرەك دېسكتاپ ===== */
@media (min-width: 768px) {
    .sidebar-desktop {
        max-height: 100vh;
    }
}

/* ===== iOS بىخەتەر رايون ===== */
@supports (-webkit-touch-callout: none) {
    .mobile-nav {
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }
}

/* ===== رەسىم خاتالىق كۆرۈنۈشى ===== */
.error-img {
    background: linear-gradient(135deg, #1e1e35, #151525);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100px;
    color: var(--text-muted);
}

/* ===== كۆرۈنمەس بەت ===== */
.page-hidden .movie-card {
    animation: none;
}