/* /root/anifehras/frontend/css/detail-page.css */
#page-detail { padding: 0; max-width: 100%; margin-right: 0; }
.detail-hero { position: relative; width: 100%; min-height: 400px; display: flex; align-items: flex-end; padding: 40px; border-radius: 0 0 24px 24px; overflow: hidden; margin-bottom: 30px; }
.detail-back-btn { position: absolute; top: 16px; right: 16px; z-index: 10; background: rgba(0,0,0,0.4); border: 1px solid rgba(255,255,255,0.15); color: #fff; border-radius: 50%; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; cursor: pointer; backdrop-filter: blur(8px); }
.detail-back-btn:hover { background: rgba(0,0,0,0.6); }
.detail-backdrop { position: absolute; inset: -20px; background-size: cover; background-position: center; filter: blur(15px) brightness(0.6); z-index: 0; }
.detail-overlay-gradient { position: absolute; inset: 0; background: linear-gradient(to top, var(--bg-deep) 5%, transparent 100%); z-index: 1; }
.detail-content { position: relative; z-index: 2; display: flex; gap: 30px; width: 100%; max-width: 1200px; margin: 0 auto; }
.detail-poster { width: 220px; aspect-ratio: 3/4; border-radius: 16px; box-shadow: 0 15px 40px rgba(0,0,0,0.6); flex-shrink: 0; border: 1px solid var(--glass-border); background: #0b1324; overflow: hidden; }
.detail-poster img { width: 100%; height: 100%; object-fit: cover; }
.detail-info { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; }
.detail-title { font-family: var(--font-display); font-size: 38px; font-weight: 800; color: #fff; margin-bottom: 2px; line-height: 1.25; transition: opacity 0.2s; }
.detail-title:hover { opacity: 0.85; }
.detail-title::after { content: ' 📋'; font-size: 20px; opacity: 0; transition: opacity 0.2s; vertical-align: middle; margin-right: 8px; }
.detail-title:hover::after { opacity: 0.8; }
.detail-title-alt { font-size: 14px; color: rgba(255,255,255,0.6); margin-bottom: 10px; font-weight: 600; }
.detail-meta { display: flex; flex-wrap: wrap; gap: 15px; align-items: center; font-size: 15px; color: rgba(255,255,255,0.8); margin-bottom: 15px; }
.detail-meta-item { display: flex; align-items: center; gap: 6px; }
.detail-meta .dot { width: 5px; height: 5px; border-radius: 50%; background: rgba(255,255,255,0.5); }
.detail-score { font-weight: 700; }
.source-pill { color: #fff; font-size: 11px; font-weight: 800; padding: 3px 7px; border-radius: 6px; }
.detail-body { max-width: 1200px; margin: 0 auto; padding: 0 40px 60px; display: grid; grid-template-columns: 2fr 1fr; gap: 40px; }
.detail-main-col, .detail-side-col { min-width: 0; }
.detail-section { background: var(--glass-bg); backdrop-filter: blur(var(--blur-amount)); border: 1px solid var(--glass-border); border-radius: 20px; padding: 24px; margin-bottom: 24px; }
.detail-section-title { font-family: var(--font-display); font-size: 20px; font-weight: 700; color: var(--text-main); margin-bottom: 15px; }
.detail-desc { font-size: 15px; line-height: 1.9; color: var(--text-sub); word-wrap: break-word; overflow-wrap: break-word; white-space: pre-line; text-align: start; }
.detail-desc.clamped { display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; }
.desc-toggle { background: none; border: none; color: var(--accent); font-family: var(--font-body); font-size: 13px; font-weight: 700; cursor: pointer; padding: 10px 0 0; }

/* عدّاد الحلقة القادمة */
.countdown-box { background: var(--accent-soft); border: 1px solid var(--accent-border); border-radius: 16px; padding: 16px; text-align: center; margin-bottom: 24px; }
.countdown-text { font-size: 13px; color: var(--accent); font-weight: 700; margin-bottom: 6px; }
.countdown-timer { font-family: var(--font-display); font-size: 24px; font-weight: 800; color: #fff; letter-spacing: 1px; direction: ltr; }

.trailer-container { position: relative; width: 100%; padding-bottom: 56.25%; border-radius: 16px; overflow: hidden; border: 1px solid var(--glass-border); }
.trailer-container iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: none; }

.fav-btn-detail { display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.15); color: #fff; padding: 8px 16px; border-radius: 20px; font-size: 13px; font-weight: 700; cursor: pointer; margin-top: 12px; margin-left: 10px; transition: all 0.2s; font-family: var(--font-body); }
.fav-btn-detail:hover { background: rgba(255, 255, 255, 0.15); }
.fav-btn-detail.active { color: #ef4444; border-color: rgba(239, 68, 68, 0.4); }
.fav-btn-detail svg { width: 18px; height: 18px; fill: currentColor; stroke: currentColor; stroke-width: 1.5; }
.fav-btn-detail:not(.active) svg { fill: none; color: #fff; }
.share-btn-detail { display: inline-flex; align-items: center; gap: 6px; background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.15); color: #fff; padding: 8px 16px; border-radius: 20px; font-size: 13px; font-weight: 700; cursor: pointer; margin-top: 12px; font-family: var(--font-body); transition: all 0.2s; }
.share-btn-detail:hover { background: rgba(255,255,255,0.15); }

.modal-anime-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.modal-tag { padding: 4px 12px; border-radius: 20px; font-size: 11px; font-weight: 700; background: rgba(255, 255, 255, 0.08); color: var(--text-main); border: 1px solid var(--glass-border); }
.modal-tag.genre-tag { cursor: pointer; transition: all 0.2s; }
.modal-tag.genre-tag:hover { border-color: var(--accent-border); color: var(--accent); }
.modal-tag.type { color: var(--accent); border-color: var(--accent-border); background: var(--accent-soft); }
.modal-tag.status { color: #4ade80; border-color: rgba(74,222,128,0.3); background: rgba(74,222,128,0.1); }

.modal-empty-sleek { display: flex; align-items: center; gap: 16px; padding: 16px 20px; background: rgba(255, 255, 255, 0.02); border-radius: 16px; border: 1px dashed rgba(255, 255, 255, 0.08); }
.modal-empty-sleek-icon { font-size: 28px; opacity: 0.6; }
.modal-empty-sleek-text { font-size: 13px; color: var(--text-sub); line-height: 1.6; }

/* صفوف التطبيقات المتاحة (كان CSS ناقصاً بالكامل) */
.detail-apps { display: flex; flex-direction: column; gap: 10px; }
.app-row { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; background: rgba(255,255,255,0.03); border: 1px solid var(--glass-border); border-radius: 14px; padding: 12px 16px; cursor: pointer; transition: border-color 0.2s; }
.app-row:hover { border-color: var(--accent-border); }
.app-row-left { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.app-row-icon { width: 36px; height: 36px; border-radius: 10px; overflow: hidden; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 18px; background: linear-gradient(135deg, #1a2a40, #0f1a2e); }
.app-row-icon img { width: 100%; height: 100%; border-radius: 10px; object-fit: cover; }
.app-row-name { font-weight: 700; font-size: 14px; color: var(--text-main); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.badge { padding: 3px 10px; border-radius: 20px; font-size: 10.5px; font-weight: 800; flex-shrink: 0; }
.badge-sub  { background: rgba(56,189,248,0.15); color: #38bdf8; border: 1px solid rgba(56,189,248,0.3); }
.badge-dub  { background: rgba(168,85,247,0.15); color: #c084fc; border: 1px solid rgba(168,85,247,0.3); }
.badge-both { background: rgba(74,222,128,0.15); color: #4ade80; border: 1px solid rgba(74,222,128,0.3); }

/* v10: صف التطبيق داخل صفحة التفاصيل - الاسم المسجل + زر النسخ (Görev 3) */
.app-row-title-panel { flex-basis: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--glass-border); cursor: default; }
.app-row-title-text { font-size: 12.5px; color: var(--text-sub); line-height: 1.6; }
.app-row-title-text b { color: var(--text-main); font-weight: 700; }
.app-row-title-empty { opacity: 0.75; }
.app-row-copy-btn { flex-shrink: 0; background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.15); color: #fff; font-family: var(--font-body); font-size: 12px; font-weight: 700; padding: 6px 14px; border-radius: 20px; cursor: pointer; transition: all 0.2s; }
.app-row-copy-btn:hover { background: rgba(255,255,255,0.15); }

/* الشخصيات وطاقم العمل */
.people-scroll { gap: 16px; }
.person-card { min-width: 100px; max-width: 100px; flex-shrink: 0; text-align: center; cursor: pointer; }
.person-avatar { width: 100px; height: 100px; border-radius: 50%; overflow: hidden; border: 2px solid var(--glass-border); margin-bottom: 8px; background: #0b1324; transition: border-color 0.2s; }
.person-card:hover .person-avatar { border-color: var(--accent-border); }
.person-avatar img { width: 100%; height: 100%; object-fit: cover; }
.person-name { font-size: 12px; font-weight: 700; color: var(--text-main); line-height: 1.2; }
.person-role { font-size: 10px; color: var(--accent); margin-top: 4px; font-weight: 600; }

/* مواعيد الحلقات */
.schedule-list { display: flex; flex-direction: column; gap: 10px; }
.schedule-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: rgba(255,255,255,0.03); border: 1px solid var(--glass-border); border-radius: 12px; padding: 10px 16px; font-size: 13px; }
.schedule-ep { font-weight: 800; color: var(--text-main); }
.schedule-date { color: var(--text-sub); font-weight: 600; }

/* هيكل تحميل صفحة التفاصيل */
.detail-skeleton-title { height: 30px; width: 60%; margin-bottom: 12px; }
.detail-skeleton-line { height: 13px; width: 100%; margin-bottom: 9px; }
.detail-skeleton-line.short { width: 45%; }

/* نافذة الشخصية */
.char-modal { max-width: 700px; padding: 0; background: var(--bg-deep); overflow: hidden; display: flex; flex-wrap: wrap; }
.char-close { background: rgba(0,0,0,0.6); top: 12px; left: 12px; right: auto; border: none; color: #fff; }
.char-modal-photo { flex: 1 1 200px; min-width: 200px; max-width: 300px; background: #0b1324; position: relative; align-self: flex-start; }
.char-modal-photo img { width: 100%; aspect-ratio: 3/4; object-fit: cover; display: block; }
.char-modal-body { flex: 999 1 350px; padding: 30px 24px; text-align: start; max-height: 85vh; overflow-y: auto; }
.char-modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 8px; }
.char-modal-head h2 { font-family: var(--font-display); font-size: 26px; font-weight: 800; color: var(--text-main); margin: 0; line-height: 1.2; }
.char-role-badge { padding: 4px 12px; background: var(--accent); color: #fff; border-radius: 8px; font-size: 11px; font-weight: 800; flex-shrink: 0; }
.char-native { font-size: 13px; color: var(--text-sub); margin-bottom: 24px; }
.char-stats { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 24px; }
.char-stat { background: rgba(255,255,255,0.03); padding: 8px 14px; border-radius: 10px; border: 1px solid var(--glass-border); flex: 1; min-width: 90px; }
.char-stat-label { font-weight: 700; color: var(--text-sub); font-size: 11px; margin-bottom: 4px; }
.char-stat-value { font-weight: 600; font-size: 13px; color: var(--text-main); }
.char-divider { height: 1px; background: var(--glass-border); margin-bottom: 20px; }
.char-desc { font-size: 14px; line-height: 1.8; color: var(--text-sub); white-space: pre-line; }
/* v11: -webkit-line-clamp, `white-space: pre-line` ile CAKISIYOR ve kirpma
   uygulanmiyordu. clamped durumunda pre-line'i normal'e cekiyoruz.
   Ayrica alta yumusak bir solma ekleyerek "devami var" hissi veriyoruz. */
/* v13: `white-space: normal` paragraf aralarini YOK EDIYORDU (yazilar birbirine
   yapisiyordu). pre-line korunuyor; kirpma icin sabit yukseklik + overflow
   kullaniliyor (-webkit-line-clamp yerine), bu pre-line ile cakismiyor. */
.char-desc.clamped { max-height: 14.4em; overflow: hidden; position: relative; }
.char-desc.clamped::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0;
    height: 40px; pointer-events: none;
    background: linear-gradient(to bottom, transparent, var(--bg-deep)); }
.desc-toggle { background: transparent; border: 0; color: var(--accent);
    font-family: var(--font-body); font-size: 13px; font-weight: 700;
    padding: 8px 0 0; cursor: pointer; }
.desc-toggle[hidden] { display: none; }



/* ============ صفحة تفاصيل التطبيق (v7 Redesign) ============ */
#page-app-detail { padding: 0 0 90px; }
.ad-topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px; padding: 14px 16px; background: rgba(3,8,16,.92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--glass-border); }
.ad-topbar h1 { font-size: 17px; margin: 0; font-family: var(--font-display); }
.ad-back { background: transparent; border: 0; color: var(--text-main); padding: 4px; cursor: pointer; display: flex; }
#app-detail-body { padding: 30px 24px; max-width: 1000px; margin-inline: auto; }

/* Hero Section */
.ad-hero-section { display: flex; align-items: center; gap: 24px; margin-bottom: 36px; }
.ad-hero-icon { width: 110px; height: 110px; border-radius: 28px; overflow: hidden; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 40px; background: linear-gradient(135deg, rgba(255,255,255,0.06), rgba(255,255,255,0.01)); box-shadow: 0 15px 35px rgba(0,0,0,0.4); border: 1px solid rgba(255,255,255,0.1); }
.ad-hero-icon img { width: 100%; height: 100%; object-fit: cover; }
.ad-hero-info { display: flex; flex-direction: column; gap: 12px; }
.ad-hero-title { margin: 0; font-size: 36px; font-weight: 800; font-family: var(--font-display); color: var(--text-main); line-height: 1.2; text-shadow: 0 4px 20px rgba(0,0,0,0.5); }
.ad-hero-badges { display: flex; flex-wrap: wrap; gap: 8px; }

/* Layout Grid */
.ad-layout-grid { display: grid; grid-template-columns: 1fr 360px; gap: 24px; align-items: start; }
@media (max-width: 850px) {
    .ad-layout-grid { grid-template-columns: 1fr; }
    .ad-layout-grid .ad-side-col { order: -1; }
    .ad-hero-section { flex-direction: column; text-align: center; gap: 16px; margin-bottom: 28px; }
    .ad-hero-icon { width: 90px; height: 90px; border-radius: 22px; }
    .ad-hero-title { font-size: 28px; }
    .ad-hero-badges { justify-content: center; }
    #app-detail-body { padding: 20px 16px; }
}

/* Glass Panels */
.ad-glass-panel { background: linear-gradient(180deg, rgba(15,25,42,0.6) 0%, rgba(8,15,26,0.8) 100%); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border: 1px solid rgba(255,255,255,0.05); border-top: 1px solid rgba(255,255,255,0.1); border-radius: 24px; padding: 26px; box-shadow: 0 10px 40px rgba(0,0,0,0.25); }
.ad-stats-panel { background: linear-gradient(180deg, rgba(10,30,50,0.7) 0%, rgba(5,15,25,0.9) 100%); position: relative; overflow: hidden; }
.ad-stats-panel::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: linear-gradient(90deg, transparent, var(--accent), transparent); opacity: 0.8; }
.ad-panel-title { font-size: 17px; color: var(--text-main); margin: 0 0 24px; font-weight: 800; display: flex; align-items: center; gap: 10px; }
.ad-panel-title svg { width: 22px; height: 22px; color: var(--accent); }

/* Technical Specs Grid */
.ad-specs-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.ad-row { display: flex; flex-direction: column; gap: 8px; background: rgba(255,255,255,0.02); padding: 16px; border-radius: 18px; border: 1px solid rgba(255,255,255,0.03); transition: background 0.2s; }
.ad-row:hover { background: rgba(255,255,255,0.04); }
.ad-label { color: var(--text-sub); font-size: 13px; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.ad-label::before { content: ''; display: block; width: 6px; height: 6px; background: var(--accent); border-radius: 50%; opacity: 0.8; }
.ad-value { color: var(--text-main); font-size: 14.5px; font-weight: 700; display: flex; flex-wrap: wrap; gap: 8px; }
.ad-nodata { color: #5a6b80; font-style: italic; font-weight: normal; font-size: 13.5px; }

/* Library Stats */
.ad-lib { display: flex; gap: 16px; margin-bottom: 24px; }
.ad-lib-box { flex: 1; text-align: center; }
.ad-lib-box b { display: block; font-size: 38px; font-family: var(--font-display); background: linear-gradient(135deg, #ffffff, var(--accent)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; text-shadow: 0 4px 20px color-mix(in srgb, var(--accent) 30%, transparent); margin-bottom: 4px; line-height: 1.1; }
.ad-lib-box span { font-size: 12.5px; font-weight: 800; color: var(--text-sub); text-transform: uppercase; letter-spacing: 0.5px; }
.ad-bar { height: 10px; border-radius: 8px; background: rgba(0,0,0,0.5); overflow: hidden; box-shadow: inset 0 2px 5px rgba(0,0,0,0.5); margin-bottom: 10px; }
.ad-bar i { display: block; height: 100%; background: linear-gradient(90deg, #3b82f6, #00e5ff); border-radius: 8px; box-shadow: 0 0 15px rgba(0,229,255,0.5); position: relative; }
.ad-bar i::after { content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent); animation: shimmer 2s infinite; }
@keyframes shimmer { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }
.ad-bar-hint { font-size: 13.5px; color: var(--text-main); font-weight: 700; text-align: center; }
.ad-stamp { font-size: 11.5px; color: #5a6b80; margin-top: 14px; text-align: center; }

/* Massive Action Buttons */
.ad-main-action { display: flex; flex-direction: column; gap: 14px; margin-top: 28px; }
.ad-btn-massive { display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; background: linear-gradient(135deg, var(--accent), #00e5ff); color: #fff; text-decoration: none; padding: 20px; border-radius: 20px; font-size: 18px; font-weight: 800; box-shadow: 0 10px 30px color-mix(in srgb, var(--accent) 40%, transparent); transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1); }
.ad-btn-massive svg { width: 24px; height: 24px; }
.ad-btn-massive:hover { transform: translateY(-4px) scale(1.02); box-shadow: 0 14px 35px color-mix(in srgb, var(--accent) 60%, transparent); }
.ad-btn-secondary { width: 100%; background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1); color: var(--text-main); padding: 18px; border-radius: 20px; font-size: 16px; font-weight: 700; cursor: pointer; transition: all 0.2s; font-family: inherit; }
.ad-btn-secondary:hover { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.2); }
.ad-disclaimer-sleek { font-size: 13px; color: #d4af37; background: rgba(212,175,55,0.08); border: 1px dashed rgba(212,175,55,0.3); border-radius: 16px; padding: 16px; margin-top: 20px; text-align: center; line-height: 1.6; }

/* Chips & Details */
.ad-chip { background: rgba(255,255,255,0.05); border: none; border-radius: 8px; padding: 6px 12px; font-size: 12.5px; font-weight: 600; color: #8aa0b6; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; box-shadow: inset 0 1px 1px rgba(255,255,255,0.02); }
.ad-chip.a { color: #a7f3d0; background: rgba(52,211,153,0.08); }
.ad-chip.b { color: #fde047; background: rgba(250,204,21,0.08); }
.ad-chip.warn { color: #fca5a5; background: rgba(248,113,113,0.08); }
.ad-tri.yes { color: #4ade80; } .ad-tri.no { color: #f87171; } .ad-tri.unk { color: #8aa0b6; }
.ad-dots { display: inline-flex; gap: 5px; }
.ad-dots i { width: 12px; height: 12px; border-radius: 50%; background: rgba(255,255,255,.1); }
.ad-dots i.on { background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.ad-dots-txt { font-size: 13px; font-weight: 800; color: var(--text-sub); margin-right: 8px; }

/* Modal override to match new vibe */
.app-modal-lib { display: flex; gap: 12px; margin: 8px 0 4px; }
.app-modal-lib div { flex: 1; background: rgba(0,0,0,0.2); border: 1px solid rgba(255,255,255,0.04); border-radius: 16px; padding: 16px 10px; text-align: center; position: relative; overflow: hidden; }
.app-modal-lib div::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px; background: linear-gradient(90deg, transparent, rgba(0,229,255,0.4), transparent); }
.app-modal-lib b { display: block; font-size: 24px; font-family: var(--font-display); background: linear-gradient(135deg, #ffffff, #00e5ff); -webkit-background-clip: text; -webkit-text-fill-color: transparent; margin-bottom: 4px; text-shadow: 0 4px 15px rgba(0,229,255,0.15); }
.app-modal-lib span { font-size: 12px; font-weight: 600; color: var(--text-sub); }
