/* ============================================================
   single-enhance.css - APKMobeAI
   تحسينات إضافية لصفحة التطبيق الفردية
   ============================================================ */

/* ── Back To Top Button ─────────────────────────────────── */
.back-to-top {
    position: fixed;
    bottom: 24px;
    left: 24px; /* left for RTL */
    width: 44px;
    height: 44px;
    background: var(--color_button);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-btn);
    opacity: 0;
    transform: translateY(16px);
    transition: opacity var(--transition-base), transform var(--transition-base);
    pointer-events: none;
    z-index: 99;
    border: none;
    cursor: pointer;
}

[dir="ltr"] .back-to-top {
    right: 24px;
    left: auto;
}

.back-to-top.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.back-to-top:hover {
    background: var(--color_button_dark, #0a58ca);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(var(--color_button_rgb), 0.5);
}

/* ── Detail Content Wrap ────────────────────────────────── */
.detail_content_wrap {
    display: flex;
    flex-direction: column;
    gap: var(--module-spacing);
}

/* ── Related Section ────────────────────────────────────── */
.related-section {
    display: flex;
    flex-direction: column;
    gap: var(--module-spacing);
}

/* ── Smooth image loading ───────────────────────────────── */
.apk_info img {
    transition: transform var(--transition-slow);
}
.apk_info img:hover {
    transform: scale(1.03);
}

/* ── Download button pulse animation ───────────────────── */
@keyframes pulse-btn {
    0%   { box-shadow: 0 0 0 0 rgba(var(--color_button_rgb), 0.5); }
    70%  { box-shadow: 0 0 0 10px rgba(var(--color_button_rgb), 0); }
    100% { box-shadow: 0 0 0 0 rgba(var(--color_button_rgb), 0); }
}

.dt-gp-btn-box .download-btn-main,
.dt-gp-btn-box .btn-download-main {
    animation: pulse-btn 2.5s ease-out 1.5s 3;
}

/* ── Gallery images lazy load fade ─────────────────────── */
.gallery img[loading="lazy"] {
    opacity: 0;
    transition: opacity 0.4s ease;
}
.gallery img.loaded {
    opacity: 1;
}

/* ── Section titles accent ──────────────────────────────── */
.title-bar {
    border-right: 3px solid var(--color_button);
    padding-right: 10px;
}

[dir="ltr"] .title-bar {
    border-right: none;
    border-left: 3px solid var(--color_button);
    padding-right: 0;
    padding-left: 10px;
}

/* ── Scrollbar for content areas ───────────────────────── */
.dt-details-new-box ::-webkit-scrollbar { width: 4px; height: 4px; }
.dt-details-new-box ::-webkit-scrollbar-thumb {
    background: var(--color_button);
    border-radius: 4px;
    opacity: 0.5;
}

/* ── Focus styles accessibility ─────────────────────────── */
a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--color_button);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

/* ── Print optimizations ────────────────────────────────── */
@media print {
    .side, .back-to-top, #header, .footer_new { display: none !important; }
    .details { max-width: 100% !important; }
}
