:root {
    --primary-red: #FF0000;
    --primary-red-dark: #CC0000;
    --white: #FFFFFF;
    --bg-light: #F9F9F9;
    --bg-dark: #0F0F0F;
    --card-light: #FFFFFF;
    --card-dark: #1F1F1F;
    --text-light: #0F0F0F;
    --text-dark: #F1F1F1;
    --text-muted-light: #606060;
    --text-muted-dark: #AAAAAA;
    --shadow-light: 0 2px 8px rgba(0,0,0,0.1);
    --shadow-dark: 0 2px 8px rgba(0,0,0,0.4);
    --border-light: #E5E5E5;
    --border-dark: #3F3F3F;
    --font-family: 'Roboto', sans-serif;
    --transition: 0.3s ease;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body {
    overflow-x: hidden; /* ✅ کسی بھی صورت میں پورا صفحہ افقی طور پر scroll نہ ہو */
    width: 100%;
}
body {
    font-family: var(--font-family);
    background: var(--bg-light);
    color: var(--text-light);
    transition: background var(--transition), color var(--transition);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
body.dark-mode {
    background: var(--bg-dark);
    color: var(--text-dark);
}

/* Header */
.main-header, .admin-header {
    background: var(--primary-red);
    padding: 10px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
.header-left { display: flex; align-items: center; gap: 15px; flex-shrink: 0; }
.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--white);
    text-decoration: none;
    font-weight: 700;
    font-size: 1.3rem;
}
.logo-icon { font-size: 1.8rem; }
.logo-text { letter-spacing: -0.5px; }
#reelsBtn {
    background: rgba(255,255,255,0.15);
    border: none;
    color: var(--white);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 8px;
    line-height: 1;
    flex-shrink: 0;
}
/* ✅ header-center کو flexbox میں سکڑنے کی اجازت دیں تاکہ پورا header سکرین کے اندر فٹ ہو (کوئی horizontal scroll نہ ہو) */
.header-center { flex: 1; max-width: 600px; margin: 0 20px; min-width: 0; }
.search-container {
    display: flex;
    background: var(--white);
    border-radius: 25px;
    overflow: hidden;
    min-width: 0;
}
.search-container input {
    flex: 1;
    min-width: 0;
    padding: 10px 15px;
    border: none;
    outline: none;
    font-family: var(--font-family);
    font-size: 1rem;
}
.search-container button {
    padding: 0 20px;
    background: #F0F0F0;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    transition: background var(--transition);
}
.search-container button:hover { background: #E0E0E0; }
.header-right { display: flex; align-items: center; gap: 15px; }
.header-right button {
    background: none;
    border: none;
    color: var(--white);
    font-size: 1.5rem;
    cursor: pointer;
    transition: transform 0.2s;
}
.header-right button:hover { transform: scale(1.1); }
/* ✅ NEW: PWA Install بٹن — ڈیفالٹ چھپا ہوا، صرف JS اسے دکھائے گا جب انسٹال ممکن ہو */
#installAppBtn { display: none; }
#installAppBtn.show { display: inline-block; }

/* ✅ NEW: Progress Modal — Bulk Save/Delete/Publish/Assign وغیرہ کے لیے مشترکہ پروگریس بار */
.tr-progress-track {
    width: 100%;
    height: 14px;
    background: #eee;
    border-radius: 8px;
    overflow: hidden;
}
body.dark-mode .tr-progress-track { background: #333; }
.tr-progress-fill {
    height: 100%;
    background: var(--primary-red);
    width: 0%;
    transition: width 0.15s ease;
}

/* Category Nav */
.category-nav {
    background: var(--bg-light);
    padding: 10px 20px;
    border-bottom: 1px solid var(--border-light);
    overflow-x: auto;
    position: sticky;
    top: 64px;
    z-index: 999;
    transition: background var(--transition), border var(--transition);
}
body.dark-mode .category-nav {
    background: var(--bg-dark);
    border-color: var(--border-dark);
}
.category-scroll {
    display: flex;
    gap: 12px;
    white-space: nowrap;
    padding-bottom: 4px;
}
.category-pill {
    padding: 8px 20px;
    border-radius: 20px;
    border: 1px solid var(--border-light);
    background: var(--card-light);
    color: var(--text-light);
    cursor: pointer;
    font-family: var(--font-family);
    font-weight: 500;
    font-size: 0.9rem;
    transition: all var(--transition);
}
body.dark-mode .category-pill {
    background: var(--card-dark);
    color: var(--text-dark);
    border-color: var(--border-dark);
}
.category-pill:hover { background: #E5E5E5; }
body.dark-mode .category-pill:hover { background: #3F3F3F; }
.category-pill.active {
    background: var(--primary-red);
    color: var(--white);
    border-color: var(--primary-red);
}

/* Main Content */
.main-content { flex: 1; padding: 20px; max-width: 1400px; margin: 0 auto; width: 100%; display: flex; flex-direction: column; }

/* Video Grid */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}
.video-card {
    background: var(--card-light);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-light);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}
body.dark-mode .video-card {
    background: var(--card-dark);
    box-shadow: var(--shadow-dark);
}
.video-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}
body.dark-mode .video-card:hover {
    box-shadow: 0 8px 20px rgba(0,0,0,0.5);
}
.video-thumbnail {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    background: #000;
}
.video-info { padding: 12px 16px; }
.video-title {
    font-weight: 500;
    font-size: 1rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 6px;
}
.video-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-muted-light);
}
body.dark-mode .video-meta { color: var(--text-muted-dark); }
.video-category {
    background: #F0F0F0;
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 0.75rem;
}
body.dark-mode .video-category { background: #3F3F3F; }
.copyright-badge {
    background: #4CAF50;
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
}

/* Empty State */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted-light);
}
body.dark-mode .empty-state { color: var(--text-muted-dark); }

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.8);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}
.modal.active { display: flex; }
.modal-content {
    background: var(--card-light);
    border-radius: 16px;
    padding: 24px;
    max-width: 800px;
    width: 95%;
    max-height: 90vh;
    overflow-y: auto;
    overflow-x: hidden; /* ✅ کبھی بھی افقی طور پر باہر نہ نکلے */
    position: relative;
    box-sizing: border-box;
}
body.dark-mode .modal-content { background: var(--card-dark); }
.close-modal {
    position: absolute;
    top: 12px; right: 16px;
    font-size: 2rem;
    cursor: pointer;
    color: var(--text-muted-light);
    transition: color 0.2s;
}
body.dark-mode .close-modal { color: var(--text-muted-dark); }
.close-modal:hover { color: var(--primary-red); }
.video-player-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
#videoPlayer iframe {
    width: 100%;
    aspect-ratio: 16/9;
    border-radius: 8px;
}
.video-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}
.action-btn {
    padding: 8px 20px;
    border: none;
    border-radius: 20px;
    background: var(--primary-red);
    color: white;
    cursor: pointer;
    font-family: var(--font-family);
    font-weight: 500;
    transition: background 0.2s;
}
.action-btn:hover { background: var(--primary-red-dark); }
.modal-title {
    font-size: 1.2rem;
    font-weight: 500;
    margin-top: 8px;
}

/* Secret Admin Button */
#secretAdminBtn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(0,0,0,0.3);
    border: none;
    color: rgba(255,255,255,0.3);
    font-size: 1.2rem;
    cursor: pointer;
    z-index: 999;
    backdrop-filter: blur(4px);
    transition: all 0.3s;
    touch-action: manipulation;
}
body.dark-mode #secretAdminBtn {
    background: rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.2);
}
#secretAdminBtn:active {
    transform: scale(0.9);
}

/* NEW MODERN FOOTER (Updated as per your request) */
.main-footer {
    background: #1A1A1A;
    color: #BBBBBB;
    padding: 30px 20px 20px;
    text-align: center;
    margin-top: auto;
    border-top: 1px solid #333;
}
.footer-links-row {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px 20px;
    margin-bottom: 20px;
}
.footer-links-row a {
    color: #CCCCCC;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s;
    font-weight: 400;
}
.footer-links-row a:hover { color: #FFFFFF; }
.footer-icons-row {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
}
.social-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}
.social-icon:hover {
    transform: scale(1.15);
}
.footer-bottom-text p {
    margin: 4px 0;
    font-size: 0.85rem;
    color: #888888;
}

/* Admin Styles (Same as before) */
.admin-header { position: sticky; top: 0; z-index: 1000; }
.admin-nav {
    display: flex;
    background: var(--bg-light);
    border-bottom: 1px solid var(--border-light);
    padding: 10px 20px;
    gap: 10px;
    position: sticky;
    top: 64px;
    z-index: 999;
    overflow-x: auto;
    flex-wrap: nowrap;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
}
body.dark-mode .admin-nav {
    background: var(--bg-dark);
    border-color: var(--border-dark);
}
.admin-tab {
    padding: 8px 24px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-family: var(--font-family);
    font-weight: 500;
    border-radius: 20px;
    transition: all 0.2s;
    color: var(--text-light);
    flex-shrink: 0;
}
body.dark-mode .admin-tab { color: var(--text-dark); }
.admin-tab:hover { background: #E5E5E5; }
body.dark-mode .admin-tab:hover { background: #3F3F3F; }
.admin-tab.active {
    background: var(--primary-red);
    color: var(--white);
}
.admin-content { padding: 20px; max-width: 1200px; margin: 0 auto; width: 100%; }
.admin-tab-content { display: none; }
.admin-tab-content.active { display: block; }
.admin-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}
.btn-primary, .btn-secondary, .btn-danger {
    padding: 10px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-family: var(--font-family);
    font-weight: 500;
    transition: all 0.2s;
}
.btn-primary { background: var(--primary-red); color: white; }
.btn-primary:hover { background: var(--primary-red-dark); }
.btn-secondary { background: #E5E5E5; color: var(--text-light); }
body.dark-mode .btn-secondary { background: #3F3F3F; color: var(--text-dark); }
.btn-secondary:hover { background: #D0D0D0; }
body.dark-mode .btn-secondary:hover { background: #555; }
.btn-danger { background: #DC3545; color: white; }
.btn-danger:hover { background: #C82333; }

.admin-table-wrapper { overflow-x: auto; }
.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--card-light);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-light);
}
body.dark-mode .admin-table {
    background: var(--card-dark);
    box-shadow: var(--shadow-dark);
}
.admin-table th, .admin-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-light);
}
body.dark-mode .admin-table th, .admin-table td {
    border-color: var(--border-dark);
}
.admin-table th { background: #F5F5F5; font-weight: 500; }
body.dark-mode .admin-table th { background: #2A2A2A; }
.admin-table tr:hover { background: #F9F9F9; }
body.dark-mode .admin-table tr:hover { background: #2A2A2A; }
.admin-table .actions-cell { display: flex; gap: 8px; }
.admin-table .actions-cell button {
    padding: 4px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
}
.delete-btn { background: #DC3545; color: white; }
.delete-btn:hover { background: #C82333; }

/* Ad Slots Grid */
.ad-slots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}
.ad-slot-card {
    background: var(--card-light);
    padding: 16px;
    border-radius: 12px;
    box-shadow: var(--shadow-light);
}
body.dark-mode .ad-slot-card {
    background: var(--card-dark);
    box-shadow: var(--shadow-dark);
}
.ad-slot-card h3 { margin-bottom: 8px; }
.ad-slot-card textarea {
    width: 100%;
    min-height: 100px;
    padding: 8px;
    border: 1px solid var(--border-light);
    border-radius: 6px;
    font-family: var(--font-family);
    resize: vertical;
    background: var(--bg-light);
    color: var(--text-light);
}
body.dark-mode .ad-slot-card textarea {
    background: var(--bg-dark);
    color: var(--text-dark);
    border-color: var(--border-dark);
}

/* Settings */
.settings-card {
    background: var(--card-light);
    padding: 20px;
    border-radius: 12px;
    box-shadow: var(--shadow-light);
    margin-bottom: 20px;
}
body.dark-mode .settings-card {
    background: var(--card-dark);
    box-shadow: var(--shadow-dark);
}
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
    margin-right: 12px;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background: #CCC;
    border-radius: 26px;
    transition: 0.3s;
}
.slider:before {
    content: "";
    position: absolute;
    height: 20px; width: 20px;
    left: 3px; bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: 0.3s;
}
.toggle-switch input:checked + .slider { background: var(--primary-red); }
.toggle-switch input:checked + .slider:before { transform: translateX(24px); }

/* Form */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-weight: 500; margin-bottom: 4px; }
.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-light);
    border-radius: 6px;
    font-family: var(--font-family);
    font-size: 1rem;
    background: var(--bg-light);
    color: var(--text-light);
}
body.dark-mode .form-group input, .form-group select, .form-group textarea {
    background: var(--bg-dark);
    color: var(--text-dark);
    border-color: var(--border-dark);
}

/* Responsive */
@media (max-width: 768px) {
    .header-center { margin: 0 10px; }
    .search-container input { padding: 8px 12px; font-size: 0.9rem; }
    .search-container button { padding: 0 12px; }
    .video-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
    .footer-links-row { gap: 8px 12px; font-size: 0.8rem; }
    .footer-icons-row { gap: 15px; }
    .admin-actions { flex-direction: column; }
    .admin-table th, .admin-table td { padding: 8px; font-size: 0.85rem; }
    .modal-content { width: 98%; padding: 16px; }
    .category-nav { top: 56px; padding: 8px 12px; }
    .main-header { padding: 8px 12px; }
    .logo-text { font-size: 1rem; }
    #secretAdminBtn { bottom: 15px; right: 15px; width: 40px; height: 40px; font-size: 1rem; }
}
@media (max-width: 480px) {
    .main-header { padding: 6px 8px; gap: 4px; }
    .header-left { gap: 6px; }
    .logo-text { display: none; } /* ✅ بہت چھوٹی سکرین پر صرف آئیکن، جگہ بچانے کے لیے */
    #reelsBtn { font-size: 1rem; padding: 3px 6px; }
    .header-center { margin: 0 6px; }
    .search-container input { padding: 6px 10px; font-size: 0.85rem; }
    .search-container button { padding: 0 10px; }
    .header-right { gap: 8px; }
    .header-right button { font-size: 1.2rem; }
    .video-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
    .video-info { padding: 8px 10px; }
    .video-title { font-size: 0.85rem; }
    .video-meta { font-size: 0.7rem; }
    }

/* V2.1: New Ad Slot Styles */
.ad-slot-card {
    background: var(--card-light);
    padding: 16px;
    border-radius: 12px;
    box-shadow: var(--shadow-light);
    margin-bottom: 20px;
}
body.dark-mode .ad-slot-card {
    background: var(--card-dark);
    box-shadow: var(--shadow-dark);
}
.ad-slot-card h3 {
    margin-bottom: 8px;
}
.ad-slot-card textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid var(--border-light);
    border-radius: 6px;
    font-family: var(--font-family);
    resize: vertical;
    background: var(--bg-light);
    color: var(--text-light);
}
body.dark-mode .ad-slot-card textarea {
    background: var(--bg-dark);
    color: var(--text-dark);
    border-color: var(--border-dark);
}
/* ==============================================
   USER PHASE 1: YOUTUBE-STYLE PLAYER CONTROLS
   ============================================== */

/* Video Player Container - فل سکرین کے لیے درست کریں */
.video-player-container {
    position: relative;
    width: 100%;
    max-width: 100%; /* ✅ کبھی بھی parent سے چوڑا نہ ہو */
    background: #000;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: 8px;
}

/* اگر فل سکرین میں ہو تو بیک گراؤنڈ مکمل کالا رکھیں */
.video-player-container:fullscreen {
    width: 100vw;
    height: 100vh;
    background: #000;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* iframe یا ویڈیو کو فل سکرین میں پوری اسکرین پر پھیلائیں */
.video-player-container:fullscreen iframe,
.video-player-container:fullscreen video {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain;
    max-width: 100%;
    max-height: 100%;
}

/* YouTube-style کنٹرولز بار */
.yt-controls-overlay {
    position: absolute;
    bottom: 15px;
    left: 15px;
    right: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 0, 0, 0.6);
    padding: 6px 12px;
    border-radius: 30px;
    z-index: 30;
    backdrop-filter: blur(4px);
    pointer-events: auto;
    opacity: 1;
    transition: opacity 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

/* بٹنز کی اسٹائلنگ */
.yt-btn {
    background: none !important;
    border: none !important;
    color: white !important;
    font-size: 18px !important;
    cursor: pointer !important;
    padding: 0 !important;
    line-height: 1 !important;
    transition: transform 0.2s ease, color 0.2s ease;
}

.yt-btn:hover {
    transform: scale(1.15);
    color: #FF0000;
}

#speedControl {
    background: transparent;
    color: white;
    border: 1px solid #888;
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 12px;
    outline: none;
    cursor: pointer;
}

#speedControl option {
    background: #222;
    color: white;
}

/* پلیئر کنٹینر کے اندر لے آؤٹ ٹھیک کریں */
.video-player-container iframe,
.video-player-container video {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

/* YouTube-style overlay controls with auto-hide */
.yt-controls-overlay {
    position: absolute;
    bottom: 15px;
    left: 15px;
    right: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 0, 0, 0.5);
    padding: 6px 12px;
    border-radius: 30px;
    z-index: 30;
    backdrop-filter: blur(4px);
    pointer-events: auto;
    transition: opacity 0.4s ease;
    opacity: 0.8;
}

.video-player-container:hover .yt-controls-overlay,
.video-player-container:active .yt-controls-overlay {
    opacity: 1;
}

#videoPlayerContainer {
    position: relative;
    width: 100%;
    background: black;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: 8px;
}

#videoPlayerContainer iframe,
#videoPlayerContainer video {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

/* ==============================================
   NEW: AUTO-COMPLETE, NATIVE SHARE, HISTORY, COPY LINK
   ============================================== */
#searchSuggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-radius: 0 0 12px 12px;
    max-height: 250px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    display: none;
}
body.dark-mode #searchSuggestions {
    background: #1f1f1f;
    border-color: #444;
}
.search-suggestion-item {
    padding: 10px 16px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.9rem;
    transition: background 0.2s;
}
.search-suggestion-item:hover {
    background: #f5f5f5;
}
body.dark-mode .search-suggestion-item {
    border-color: #333;
}
body.dark-mode .search-suggestion-item:hover {
    background: #2a2a2a;
}
.history-section {
    margin-top: 30px;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 12px;
    border: 1px solid #eee;
}
body.dark-mode .history-section {
    background: #1f1f1f;
    border-color: #333;
}
.history-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
    margin-top: 12px;
}
.history-item {
    cursor: pointer;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #eee;
    background: white;
    transition: transform 0.2s;
}
body.dark-mode .history-item {
    background: #2a2a2a;
    border-color: #444;
}
.history-item:hover {
    transform: scale(1.02);
}
.history-thumb {
    width: 100%;
    height: 90px;
    object-fit: cover;
}
.history-title {
    padding: 6px 10px;
    font-size: 0.8rem;
    font-weight: 500;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ✅ NEW: Playlists Section (Homepage) */
.playlists-section {
    margin: 16px 0 20px;
}
.playlists-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
    margin-top: 12px;
}
.playlist-card {
    position: relative;
    cursor: pointer;
    border-radius: 10px;
    overflow: hidden;
    background: #000;
    aspect-ratio: 16/9;
    transition: transform 0.2s;
}
.playlist-card:hover { transform: scale(1.02); }
.playlist-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.85;
}
.playlist-card-overlay {
    position: absolute;
    top: 6px; right: 6px;
    background: rgba(0,0,0,0.6);
    color: #fff;
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 10px;
}
.playlist-card-title {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    padding: 10px 8px 8px;
    background: linear-gradient(transparent, rgba(0,0,0,0.85));
    color: #fff;
    font-weight: 600;
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ✅ NEW: Playlist View Overlay — کسی ایک Playlist کی تمام ویڈیوز کا فل سکرین گرڈ */
.playlist-view-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: var(--bg-light);
    color: var(--text-light);
    z-index: 9999;
    overflow-y: auto;
    padding: 16px;
}
body.dark-mode .playlist-view-overlay {
    background: var(--bg-dark);
    color: var(--text-dark);
}
.playlist-view-overlay.active { display: block; }
.playlist-view-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    position: sticky;
    top: 0;
    background: var(--bg-light);
    padding: 8px 0;
    z-index: 2;
}
body.dark-mode .playlist-view-header {
    background: var(--bg-dark);
}

/* ============================================
   ✅ Reels View (Vertical Swipe - TikTok/Shorts Style)
   ============================================ */
#reelsBtn {
    background: transparent;
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
}

.reels-view {
    display: none;
    position: fixed;
    inset: 0;
    background: #000;
    z-index: 10000;
}
.reels-view.active {
    display: block;
}

.reels-close-btn {
    position: fixed;
    top: 14px;
    right: 14px;
    z-index: 10002;
    background: rgba(0,0,0,0.5);
    color: #fff;
    border: none;
    font-size: 26px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    line-height: 40px;
    text-align: center;
}

.reels-container {
    height: 100%;
    width: 100%;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    scrollbar-width: none;
}
.reels-container::-webkit-scrollbar { display: none; }

.reel-slide {
    height: 100%;
    width: 100%;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
}
.reel-slide video,
.reel-slide iframe {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
}
/* ✅ NEW: YouTube/Dailymotion Player API کا ٹارگٹ div — یہ اصل iframe کو اندر بناتا ہے */
.reel-player-target {
    width: 100%;
    height: 100%;
    background: #000;
}
.reel-player-target iframe {
    width: 100% !important;
    height: 100% !important;
    border: 0;
}
/* ✅ NEW: اوپر پتلی progress bar */
.reel-progress-track {
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: rgba(255,255,255,0.25);
    z-index: 20;
}
.reel-progress-fill {
    height: 100%;
    width: 0%;
    background: var(--primary-red);
}
/* ✅ NEW: دائیں طرف Play/Pause اور Download بٹنز (mute بٹن کے اوپر سٹیک) */
.reel-side-controls {
    position: absolute;
    right: 14px;
    bottom: 84px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    z-index: 20;
}
.reel-playpause-btn, .reel-download-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(0,0,0,0.5);
    color: #fff;
    border: none;
    font-size: 18px;
    cursor: pointer;
    line-height: 1;
}
.reel-slide .reel-info {
    position: absolute;
    bottom: 24px;
    left: 14px;
    right: 70px;
    color: #fff;
    font-size: 0.95rem;
    text-shadow: 0 1px 3px rgba(0,0,0,0.8);
}
.reel-mute-btn {
    position: absolute;
    bottom: 24px;
    right: 14px;
    background: rgba(0,0,0,0.5);
    color: #fff;
    border: none;
    font-size: 20px;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    cursor: pointer;
}
.reel-empty-msg {
    color: #fff;
    text-align: center;
    padding: 40px 20px;
    font-size: 1rem;
}
