/* ══════════════════════════════════════════
   YT Keyword Pages — Frontend v5
   SEO-optimized + YouTube Search Engine
══════════════════════════════════════════ */

/* ══════════════════════════════════════════
   OLD PAGES (v4) — .ytkp-page
   يحافظ على شكل الصفحات القديمة
══════════════════════════════════════════ */
.ytkp-page {
    max-width: 860px;
    margin: 0 auto;
    padding: 10px 0;
    font-family: inherit;
    direction: rtl;
}

.ytkp-page .ytkp-videos-list {
    display: flex !important;
    flex-direction: column !important;
    gap: 16px;
    margin-bottom: 32px;
    list-style: none !important;
    padding: 0 !important;
}

.ytkp-page .ytkp-video-row {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 16px;
    background: #ffffff;
    border: 1px solid #e8e8e8;
    border-radius: 12px;
    padding: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,.07);
    transition: box-shadow .25s, transform .25s;
    text-decoration: none !important;
    overflow: hidden;
}
.ytkp-page .ytkp-video-row:hover {
    box-shadow: 0 6px 20px rgba(0,0,0,.13);
    transform: translateY(-2px);
}

.ytkp-page .ytkp-thumb-wrap {
    position: relative !important;
    flex-shrink: 0 !important;
    width: 220px !important;
    height: 124px !important;
    border-radius: 8px;
    overflow: hidden;
    background: #111;
}
.ytkp-page .ytkp-thumb-wrap img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    transition: transform .3s, opacity .3s;
}
.ytkp-page .ytkp-video-row:hover .ytkp-thumb-wrap img {
    transform: scale(1.05);
    opacity: .88;
}

.ytkp-page .ytkp-play-icon {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: 48px;
    height: 48px;
    background: rgba(220, 0, 0, .9);
    border-radius: 50%;
    display: flex !important;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 20px;
    pointer-events: none;
    box-shadow: 0 2px 8px rgba(0,0,0,.4);
    transition: transform .25s, background .25s;
}
.ytkp-page .ytkp-video-row:hover .ytkp-play-icon {
    transform: translate(-50%, -50%) scale(1.15) !important;
    background: rgba(180, 0, 0, 1);
}

.ytkp-page .ytkp-video-info {
    flex: 1 1 auto !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: flex-start !important;
    gap: 14px;
    min-width: 0;
    padding: 4px 0;
}

.ytkp-page .ytkp-video-title {
    font-size: 15px !important;
    font-weight: 700 !important;
    line-height: 1.55 !important;
    color: #1a1a1a !important;
    margin: 0 !important;
    padding: 0 !important;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ytkp-page .ytkp-watch-btn {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px;
    background: #e00 !important;
    color: #fff !important;
    padding: 9px 22px !important;
    border-radius: 7px !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    text-decoration: none !important;
    border: none !important;
    box-shadow: 0 3px 10px rgba(220,0,0,.35);
    transition: background .2s, box-shadow .2s, transform .15s;
    white-space: nowrap;
    cursor: pointer;
}
.ytkp-page .ytkp-watch-btn:hover {
    background: #bb0000 !important;
    box-shadow: 0 5px 16px rgba(180,0,0,.45);
    transform: translateY(-1px);
}
.ytkp-page .ytkp-watch-btn:active { transform: translateY(0); }

.ytkp-page .ytkp-related {
    border-top: 2px solid #eee;
    padding-top: 22px;
    margin-top: 16px;
}
.ytkp-page .ytkp-related-title {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 12px !important;
    color: #333;
}
.ytkp-page .ytkp-related-list {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.ytkp-page .ytkp-related-list li {
    margin: 0 !important;
    padding: 0 !important;
}
.ytkp-page .ytkp-related-list li a {
    display: inline-block;
    background: #f0f4ff;
    color: #1a4fd8 !important;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    text-decoration: none !important;
    border: 1px solid #c8d8ff;
    transition: background .2s, color .2s;
    font-weight: 500;
}
.ytkp-page .ytkp-related-list li a:hover {
    background: #1a4fd8;
    color: #fff !important;
    border-color: #1a4fd8;
}

.ytkp-description {
    background: #f8f9fa;
    border-right: 4px solid #e52d27;
    border-radius: 6px;
    padding: 20px 24px;
    margin-bottom: 32px;
    font-size: 15px;
    line-height: 1.8;
    color: #333;
    direction: rtl;
}
.ytkp-description p { margin: 0; }

@media (max-width: 640px) {
    .ytkp-page .ytkp-video-row {
        flex-direction: column !important;
        align-items: stretch !important;
    }
    .ytkp-page .ytkp-thumb-wrap {
        width: 100% !important;
        height: 200px !important;
    }
    .ytkp-page .ytkp-video-info {
        align-items: flex-start !important;
        padding: 4px 0 0;
    }
    .ytkp-page .ytkp-watch-btn {
        width: 100% !important;
        justify-content: center !important;
    }
}

/* ══════════════════════════════════════════
   NEW POSTS (v5) — .ytkp-article
══════════════════════════════════════════ */

/* ── Breadcrumb ─────────────────────────── */
.ytkp-breadcrumb {
    font-size: 13px;
    color: #666;
    margin-bottom: 16px;
    direction: rtl;
}
.ytkp-breadcrumb a { color: #1a4fd8; text-decoration: none; }
.ytkp-breadcrumb a:hover { text-decoration: underline; }
.ytkp-bc-sep { margin: 0 6px; color: #aaa; }

/* ── Article Container ──────────────────── */
.ytkp-article {
    max-width: 860px;
    margin: 0 auto;
    padding: 10px 0;
    font-family: inherit;
    direction: rtl;
}

/* ── Section Titles ─────────────────────── */
.ytkp-article .ytkp-section-title {
    font-size: 20px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 28px 0 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e52d27;
}

/* ── AI Introduction ────────────────────── */
.ytkp-intro {
    background: #f8f9fa;
    border-right: 4px solid #e52d27;
    border-radius: 6px;
    padding: 20px 24px;
    margin-bottom: 28px;
    font-size: 15px;
    line-height: 1.9;
    color: #333;
}
.ytkp-intro p { margin: 0 0 12px; }
.ytkp-intro p:last-child { margin-bottom: 0; }

/* ── Video List ─────────────────────────── */
.ytkp-article .ytkp-videos-list {
    display: flex !important;
    flex-direction: column !important;
    gap: 16px;
    margin-bottom: 32px;
    list-style: none !important;
    padding: 0 !important;
}

.ytkp-article .ytkp-video-row {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 16px;
    background: #ffffff;
    border: 1px solid #e8e8e8;
    border-radius: 12px;
    padding: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,.07);
    transition: box-shadow .25s, transform .25s;
    overflow: hidden;
}
.ytkp-article .ytkp-video-row:hover {
    box-shadow: 0 6px 20px rgba(0,0,0,.13);
    transform: translateY(-2px);
}

/* ── Thumbnail ──────────────────────────── */
.ytkp-article .ytkp-thumb-wrap {
    position: relative !important;
    flex-shrink: 0 !important;
    width: 220px !important;
    height: 124px !important;
    border-radius: 8px;
    overflow: hidden;
    background: #111;
}
.ytkp-article .ytkp-thumb-wrap img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
    margin: 0 !important; padding: 0 !important; border: none !important;
    transition: transform .3s, opacity .3s;
}
.ytkp-article .ytkp-video-row:hover .ytkp-thumb-wrap img {
    transform: scale(1.05);
    opacity: .88;
}

.ytkp-article .ytkp-play-icon {
    position: absolute !important;
    top: 50% !important; left: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: 48px; height: 48px;
    background: rgba(220, 0, 0, .9);
    border-radius: 50%;
    display: flex !important; align-items: center; justify-content: center;
    color: #fff; font-size: 20px;
    pointer-events: none;
    box-shadow: 0 2px 8px rgba(0,0,0,.4);
    transition: transform .25s, background .25s;
}
.ytkp-article .ytkp-video-row:hover .ytkp-play-icon {
    transform: translate(-50%, -50%) scale(1.15) !important;
    background: rgba(180, 0, 0, 1);
}

/* ── Video Info ──────────────────────────── */
.ytkp-article .ytkp-video-info {
    flex: 1 1 auto !important;
    display: flex !important; flex-direction: column !important;
    justify-content: center !important; align-items: flex-start !important;
    gap: 8px; min-width: 0; padding: 4px 0;
}

.ytkp-article .ytkp-video-title {
    font-size: 15px !important; font-weight: 700 !important;
    line-height: 1.55 !important; color: #1a1a1a !important;
    margin: 0 !important; padding: 0 !important;
    display: -webkit-box; -webkit-line-clamp: 3;
    -webkit-box-orient: vertical; overflow: hidden;
}

.ytkp-article .ytkp-video-channel {
    font-size: 12px;
    color: #888;
    display: block;
}

/* ── Watch Button ───────────────────────── */
.ytkp-article .ytkp-watch-btn,
.ytkp-live-results .ytkp-watch-btn {
    display: inline-flex !important; align-items: center !important; gap: 6px;
    background: #e00 !important; color: #fff !important;
    padding: 9px 22px !important; border-radius: 7px !important;
    font-size: 14px !important; font-weight: 700 !important;
    text-decoration: none !important; border: none !important;
    box-shadow: 0 3px 10px rgba(220,0,0,.35);
    transition: background .2s, box-shadow .2s, transform .15s;
    white-space: nowrap; cursor: pointer;
}
.ytkp-article .ytkp-watch-btn:hover,
.ytkp-live-results .ytkp-watch-btn:hover {
    background: #bb0000 !important;
    box-shadow: 0 5px 16px rgba(180,0,0,.45);
    transform: translateY(-1px);
}

/* ── Related Links ──────────────────────── */
.ytkp-article .ytkp-related {
    border-top: 2px solid #eee;
    padding-top: 22px;
    margin-top: 16px;
}
.ytkp-article .ytkp-related-list {
    list-style: none !important; padding: 0 !important; margin: 0 !important;
    display: flex; flex-wrap: wrap; gap: 8px;
}
.ytkp-article .ytkp-related-list li { margin: 0 !important; padding: 0 !important; }
.ytkp-article .ytkp-related-list li a {
    display: inline-block; background: #f0f4ff; color: #1a4fd8 !important;
    padding: 6px 14px; border-radius: 20px; font-size: 13px;
    text-decoration: none !important; border: 1px solid #c8d8ff;
    transition: background .2s, color .2s; font-weight: 500;
}
.ytkp-article .ytkp-related-list li a:hover {
    background: #1a4fd8; color: #fff !important; border-color: #1a4fd8;
}

/* ══════════════════════════════════════════
   YouTube Search Engine
══════════════════════════════════════════ */
.ytkp-search-section {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 14px;
    padding: 24px 28px;
    margin: 36px 0;
    color: #fff;
}
.ytkp-search-box {
    display: flex;
    gap: 10px;
}
.ytkp-live-input {
    flex: 1;
    padding: 12px 18px;
    border: 2px solid #333;
    border-radius: 10px;
    background: #0d1117;
    color: #fff;
    font-size: 15px;
    outline: none;
    transition: border-color .2s;
    direction: rtl;
}
.ytkp-live-input:focus {
    border-color: #e52d27;
}
.ytkp-live-input::placeholder { color: #666; }
.ytkp-live-btn {
    padding: 12px 24px;
    background: #e52d27;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: background .2s;
    white-space: nowrap;
}
.ytkp-live-btn:hover { background: #c41f1a; }

/* Loading */
.ytkp-live-loading {
    text-align: center;
    padding: 20px;
    color: #aab;
    font-size: 14px;
}
.ytkp-spinner {
    display: inline-block;
    width: 20px; height: 20px;
    border: 3px solid #333;
    border-top-color: #e52d27;
    border-radius: 50%;
    animation: ytkp-spin .6s linear infinite;
    vertical-align: middle;
    margin-left: 8px;
}
@keyframes ytkp-spin { to { transform: rotate(360deg); } }

/* Search Results */
.ytkp-live-results {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 16px;
}
.ytkp-live-item {
    display: flex;
    align-items: center;
    gap: 14px;
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 10px;
    padding: 10px;
    transition: background .2s;
}
.ytkp-live-item:hover {
    background: rgba(255,255,255,.1);
}
.ytkp-live-thumb {
    position: relative;
    flex-shrink: 0;
    width: 180px; height: 100px;
    border-radius: 8px;
    overflow: hidden;
    background: #000;
}
.ytkp-live-thumb img {
    width: 100%; height: 100%; object-fit: cover; display: block;
}
.ytkp-live-play {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%,-50%);
    width: 36px; height: 36px;
    background: rgba(220,0,0,.85);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 15px;
    pointer-events: none;
}
.ytkp-live-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}
.ytkp-live-title {
    font-size: 14px;
    font-weight: 600;
    color: #eee;
    margin: 0;
    display: -webkit-box; -webkit-line-clamp: 2;
    -webkit-box-orient: vertical; overflow: hidden;
}
.ytkp-live-channel {
    font-size: 12px;
    color: #888;
}
.ytkp-live-error {
    text-align: center;
    color: #f88;
    font-size: 14px;
    padding: 16px;
}

/* ══════════════════════════════════════════
   FAQ Section
══════════════════════════════════════════ */
.ytkp-faq {
    margin: 32px 0 20px;
}
.ytkp-faq-item {
    border: 1px solid #e8e8e8;
    border-radius: 10px;
    padding: 16px 20px;
    margin-bottom: 10px;
    background: #fafafa;
}
.ytkp-faq-item h3 {
    font-size: 15px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 8px;
}
.ytkp-faq-item p {
    font-size: 14px;
    line-height: 1.7;
    color: #555;
    margin: 0;
}

/* ══ MOBILE ══════════════════════════════ */
@media (max-width: 640px) {
    .ytkp-article .ytkp-video-row,
    .ytkp-live-item {
        flex-direction: column !important;
        align-items: stretch !important;
    }
    .ytkp-article .ytkp-thumb-wrap,
    .ytkp-live-thumb {
        width: 100% !important;
        height: 200px !important;
    }
    .ytkp-article .ytkp-video-info,
    .ytkp-live-info { padding: 4px 0 0; }
    .ytkp-article .ytkp-watch-btn,
    .ytkp-live-results .ytkp-watch-btn {
        width: 100% !important;
        justify-content: center !important;
    }
    .ytkp-search-box { flex-direction: column; }
    .ytkp-live-btn { width: 100%; }
}
