/*
Theme Name: MalakTube Custom
Description: Custom Dark Mode Tube Theme
Version: 2.0
Author: MalakTube
*/

:root {
    --bg-color: #0f0f0f;
    --card-bg: #1f1f1f;
    --primary: #E50914;
    --accent: #3ea6ff;
    --text-main: #FFFFFF;
    --text-muted: #AAAAAA;
    --radius: 12px;
    --border-color: rgba(255,255,255,0.1);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { background-color: var(--bg-color) !important; color: var(--text-main) !important; font-family: 'Inter', sans-serif !important; line-height: 1.5; font-size: 16px; overflow-x: hidden; direction: rtl; text-align: right; }
a { text-decoration: none; color: inherit; }
.container { width: 100%; max-width: 1400px; margin: 0 auto; padding: 0 20px; }

header.site-header { background: #0f0f0f; border-bottom: 1px solid var(--border-color); padding: 14px 0; position: sticky; top: 0; z-index: 100; }
.header-inner { display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; }

.header-left-area { display: flex; align-items: center; gap: 25px; flex-wrap: wrap; }
.logo a { font-size: 24px; font-weight: 800; color: #fff; display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.logo span { color: var(--primary); }

.external-links { display: flex; align-items: center; gap: 12px; list-style: none; flex-wrap: wrap; }
.external-links a { font-size: 14px; font-weight: 600; color: var(--text-muted); background: #1a1a1a; padding: 8px 14px; border-radius: 6px; border: 1px solid var(--border-color); transition: all 0.2s; }
.external-links a:hover { color: #fff; background: #252525; border-color: var(--primary); }

.search-form { display: flex; align-items: center; background: #121212; border: 1px solid var(--border-color); border-radius: 40px; overflow: hidden; width: 100%; max-width: 380px; flex-shrink: 0; }
.search-input { width: 100%; background: transparent; border: none; padding: 10px 18px; color: #fff; font-size: 15px; outline: none; text-align: right; }
.search-btn { background: #222; border: none; color: #fff; padding: 10px 18px; cursor: pointer; transition: background 0.2s; font-size: 15px; }
.search-btn:hover { background: #333; }

.video-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin: 25px 0; }
.video-card { background: transparent; border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; transition: transform 0.2s; position: relative; }
.video-card:hover .thumbnail-wrapper { transform: scale(1.02); }
.card-link-overlay { position: absolute; inset: 0; z-index: 2; }

.thumbnail-wrapper { position: relative; aspect-ratio: 16/9; background: #202020; border-radius: var(--radius); overflow: hidden; transition: transform 0.2s ease; }
.thumbnail-wrapper img { width: 100%; height: 100%; object-fit: cover; }

.video-duration { position: absolute; bottom: 10px; left: 10px; background: rgba(0, 0, 0, 0.85); color: #fff; font-size: 13px; font-weight: 600; padding: 4px 8px; border-radius: 6px; z-index: 3; }

.video-info { padding: 14px 6px; position: relative; z-index: 3; }
.video-title { font-size: 17px; font-weight: 600; margin-bottom: 6px; color: #fff; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.4; }
.video-meta { font-size: 14px; color: var(--text-muted); display: flex; align-items: center; gap: 8px; }

.single-post-container { max-width: 950px; margin: 40px auto; background: #141414; padding: 35px; border-radius: var(--radius); border: 1px solid var(--border-color); }
.post-title { font-size: 28px; font-weight: 700; margin-bottom: 24px; color: #fff; line-height: 1.4; }
.post-body { font-size: 17px; color: #ccc; line-height: 1.8; }
.post-body iframe, .post-body .embed-container { width: 100% !important; aspect-ratio: 16 / 9 !important; height: auto !important; max-height: 650px; border-radius: 8px; margin-bottom: 25px; border: none; }
.post-body img { max-width: 100%; height: auto; border-radius: 8px; margin: 15px 0; }

.empty-notice { text-align: center; padding: 60px; color: var(--text-muted); font-size: 16px; width: 100%; grid-column: span 3; }

#scrollToTopBtn {
    position: fixed;
    bottom: 30px;
    left: 30px;
    background: var(--primary);
    color: #fff;
    border: none;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}
#scrollToTopBtn.show { opacity: 1; visibility: visible; }
#scrollToTopBtn:hover { background: #ff1e2a; transform: translateY(-3px); }

@media screen and (max-width: 1024px) {
    .video-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
    .empty-notice { grid-column: span 2; }
}
@media screen and (max-width: 768px) {
    .video-grid { grid-template-columns: 1fr; gap: 20px; }
    .empty-notice { grid-column: span 1; }
    .single-post-container { padding: 20px 15px; margin: 20px 10px; }
    .post-title { font-size: 22px; }
    .header-inner, .header-left-area { flex-direction: column; align-items: stretch; gap: 15px; }
    .search-form { max-width: 100%; }
}