/* style.css — Yorqin (Light) YouTube uslubi */
body { 
    background-color: #ffffff; /* Asosiy fon oq */
    color: #0f0f0f; /* Asosiy matn qora */
    margin: 0; 
    font-family: 'Roboto', sans-serif; 
}

/* HEADER */
.yt-header {
    height: 54px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 16px;
    background: #f8f8f8;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid #e5e5e5;
}

.header-left { 
    display: flex; 
    align-items: center; 
    gap: 15px; 
}

.header-right { 
    display: flex; 
    align-items: center; 
    gap: 8px; 
}

.logo { 
    color: #0f0f0f; 
    text-decoration: none; 
    font-weight: bold; 
    font-size: 18px; 
    display: flex; 
    align-items: center; 
    gap: 4px; 
}

.header-center { 
    flex: 0 1 420px; 
    display: flex; 
    align-items: center; 
    gap: 15px; 
}

.search-box { 
    display: flex; 
    flex: 1; 
}

.search-input { 
    background: #ffffff; 
    border: 1px solid #ccc; 
    color: #000; 
    padding: 8px 15px; 
    border-radius: 40px 0 0 40px; 
    width: 100%; 
    outline: none;
}

.search-input:focus {
    border-color: #1c62b9; /* Qidiruv faollashganda ko'k chiziq */
}

.search-box button { 
    background: #f8f8f8; 
    border: 1px solid #ccc; 
    border-left: none;
    color: #333; 
    padding: 0 20px; 
    border-radius: 0 40px 40px 0; 
    cursor: pointer;
}

.search-box button:hover {
    background: #f0f0f0;
}

.mic-icon {
    background: #f2f2f2;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: #0f0f0f;
    cursor: pointer;
}

.header-right i {
    color: #0f0f0f;
    font-size: 20px;
    cursor: pointer;
}

.menu-btn { 
    background: #f2f2f2; /* Och kulrang tugmalar */
    color: #0f0f0f; 
    border: none; 
    padding: 8px 16px; 
    border-radius: 6px; 
    cursor: pointer; 
    font-size: 14px; 
    display: flex; 
    align-items: center; 
    gap: 8px; 
    font-weight: 500;
}

.menu-btn:hover { 
    background: #e5e5e5; 
}

/* MAIN LAYOUT */
.container { display: flex; max-width: 1700px; margin: 0 auto; padding: 20px; gap: 24px; }
.container-list { max-width: 1700px; margin: 0 auto;}
.main-content { flex: 1; }

/* PLAYER:*/
#player { width: 100%; height: auto; max-height: 80vh; border-radius: 12px;}

/* INFO & BUTTONS */
.video-title { 
    font-size: 20px; 
    margin: 10px 0; 
    font-weight: 700; 
    color: #0f0f0f;
}

.video-bar { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    margin-bottom: 12px; 
}

.meta-data { 
    font-size: 14px; 
    color: #606060; 
}

.action-btns { 
    display: flex; 
    gap: 8px; 
}

.yt-btn { 
    background: #f2f2f2; /* Och kulrang tugmalar */
    color: #0f0f0f; 
    border: none; 
    padding: 8px 16px; 
    border-radius: 20px; 
    cursor: pointer; 
    font-size: 14px; 
    display: flex; 
    align-items: center; 
    gap: 8px; 
    font-weight: 500;
}

.yt-btn:hover { 
    background: #e5e5e5; 
}

/* SIDEBAR & RECS */
.sidebar { 
    width: 370px; 
}

.sidebar-title {
    color: #0f0f0f;
    font-size: 16px;
    margin-bottom: 15px;
}

.rec-item { 
    display: flex; 
    gap: 12px; 
    margin-bottom: 12px; 
    text-decoration: none; 
    color: #0f0f0f; 
}

.rec-thumb-wrapper { 
    position: relative; 
    flex-shrink: 0; 
}

.rec-thumb { 
    width: 168px; 
    height: 94px; 
    border-radius: 8px; 
    object-fit: cover; 
}

.rec-duration { 
    position: absolute; 
    bottom: 8px; 
    right: 4px; 
    background: rgba(0,0,0,0.5); 
    color: #fff;
    font-size: 12px; 
    padding: 1px 4px; 
    border-radius: 4px; 
}

.rec-meta h4 { 
   font-size: 14px; 
    margin: 0 0 4px 0;
    font-weight: 500;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden; 
}

.rec-channel, .rec-views { 
    font-size: 12px; 
    color: #606060; 
    margin: 0; 
}

/* --- VIDEO GRID LAYOUT --- */
.video-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 10px;
}

.video-list > div {
  display: contents;
}

/* --- KARTОCHKA --- */
.video-card {
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease;
    padding: 12px;
   
}

/* RASHM (THUMBNAIL) */
.thumbnail-box {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 12px;
    overflow: hidden;
    background-color: #f2f2f2;
}

.thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.video-time {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 3px 6px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

/* --- DETALLAR (INFO) --- */
.video-details {
    display: flex;
    margin-top: 12px;
    gap: 12px;
}

.author-img img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}

.video-meta {
    flex: 1;
}

.video-title1 {
    margin: 0;
    font-size: 16px;
    line-height: 1.4;
    font-weight: 600;
    color: #0f0f0f;
    /* Matn 2 qatordan oshsa "..." bo'ladi */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.video-title1 a {
    text-decoration: none;
    color: inherit;
}

.video-stats {
    margin-top: 4px;
    font-size: 14px;
    color: #606060;
    display: flex;
    align-items: center;
    gap: 4px;
}

.dot {
    font-weight: bold;
}

/* --- PLAY HOVER TUGMASI --- */

/* Rasm ustidagi havola konteyneri */
.thumbnail-box a {
    display: block;
    position: relative;
    width: 100%;
    height: 100%;
}

/* PLAY TUGMASI KONTEYNERI */
.play-hover-icon {
    position: absolute;
    /* Rasmning aynan markaziga joylashtirish */
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    
    /* Tugma o'lchamlari */
    width: 65px;
    height: 65px;
    background-color: rgba(255, 255, 255, 0.45); /* Shaftof oq fon */
    border-radius: 50%;
    
    /* ICHIDAGI ICONKANI O'RTALASH (FLEXBOX) */
    display: flex !important;
    align-items: center;    /* Vertikal o'rtalash */
    justify-content: center; /* Gorizontal o'rtalash */
    
    opacity: 0;
    transition: all 0.25s ease;
    z-index: 5;
    pointer-events: none;
}

/* PLAY IKONKASINING O'ZI */
.play-hover-icon i {
    color: #ffffff;
    font-size: 28px;
    margin-left: 4px; 
}

/* HOVER HOLATI */
.video-card:hover .play-hover-icon {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}
.video-card:hover .thumb-img {
  transform: scale(1.05);
}

.thumb-img {
  transition: 0.3s;
}

/* Hover bo'lganda rasm ustida xira shaftof fon paydo bo'lishi */
.thumbnail-box:hover::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
    z-index: 1;
}

/* --- MOBIL MOSLASHUVCHANLIK (Media Queries) --- */

@media (max-width: 768px) {
    /* 1. Header sozlamalari */
    .yt-header {
        padding: 0 10px;
        height: 48px;
    }
    .header-center {
        display: none; /* Mobil qidiruvni alohida tugma qilish uchun joy tejaymiz */
    }
    .header-right i {
        font-size: 18px;
        gap: 15px;
    }
    .header-left {
      color: #FFFFFF;
      gap: 10px;
    }
  
  .menu-icon {
        display: none !important;
    }
  
  .menu-btn {display: none;}
  
  .fa-youtube {
        color: #ffffff !important;
    }

    .container {
        flex-direction: column;
        padding: 0;
        gap: 0;
    }

    /* 3. Pleyer mobil uchun */
    .main-content {
        width: 100%;
    }
    .video-container {
        position: sticky;
        top: 0;
        z-index: 1000;
        background: #000;
    }
    #player {
        border-radius: 0;
        }

    .video-info {
        padding: 6px 10px;
    }
    .video-title {
        font-size: 18px;
        margin: 5px 0;
    }
    .video-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    .action-btns {
        width: 100%;
        overflow-x: auto;
        padding-bottom: 5px;
        -webkit-overflow-scrolling: touch;
    }
    .yt-btn {
        flex-shrink: 0;
        padding: 6px 12px;
        font-size: 13px;
    }

    /* 5. Tavsif (Description) */
    .description-card {
        border-radius: 8px;
    }

    /* 6. Sidebar (Tavsiya videolar) mobil stili */
    .sidebar {
        width: 100%;
        padding: 15px;
    }
    .sidebar-title {
        font-size: 15px;
        margin-bottom: 12px;
    }
    
    .rec-item {
        margin-bottom: 15px;
        
    }
    .rec-thumb {
        width: 140px; /* Mobil uchun rasm biroz kichikroq */
        height: 80px;
    }
    .rec-meta h4 {
        font-size: 13px;
        -webkit-line-clamp: 2;
    }
    .rec-channel, .rec-views {
        font-size: 11px;
    }

    /* 7. Kommentariyalar */
    .comments-area {
        padding: 15px;
        border-top: 1px solid #333;
    }
   .video-grid {
        grid-template-columns: 1fr; /* Mobilda 1 ta ustun */
        padding: 0; /* Yon bo'shliqlar yo'qoladi */
        gap: 20px;
    }

    .thumbnail-box {
        border-radius: 0; /* Mobilda rasm chetlari to'g'ri (YouTube kabi) */
    }

    .video-details {
        padding: 0 12px; /* Faqat matn uchun ichki bo'shliq */
    }

    .video-title1 {
        font-size: 14px;
    }
}

/* Kichik telefonlar uchun (iPhone SE va h.k) */
@media (max-width: 400px) {
    .rec-thumb {
        width: 120px;
        height: 68px;
    }
    .video-title {
        font-size: 16px;
    }
}