/* ══════════════════════════════════════
   MontaTV — style.css
   ══════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@400;700;800;900&display=swap');

:root {
    --cyan:    #00E7FF;
    --purple:  #7B2FF7;
    --pink:    #ff4d6d;
    --bg:      #000000;
    --card-bg: rgba(18, 24, 39, 0.85);
    --border:  rgba(255, 255, 255, 0.08);
}

* {
    margin: 0; padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg);
    color: #fff;
    font-family: 'Tajawal', sans-serif;
    overflow-x: hidden;
    min-height: 100vh;
}

/* ══════════════════════════════════════
   MODAL — نافذة التسجيل
   ══════════════════════════════════════ */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(4px);
}

.modal-card {
    background: var(--card-bg);
    padding: 35px 30px;
    border-radius: 20px;
    border: 1px solid rgba(0, 231, 255, 0.3);
    text-align: center;
    width: 100%;
    max-width: 350px;
    backdrop-filter: blur(15px);
    box-shadow: 0 20px 60px rgba(0,0,0,0.6), 0 0 40px rgba(0,231,255,0.05);
}

.modal-title {
    color: var(--cyan);
    margin-bottom: 8px;
    font-size: 1.4rem;
}

.modal-sub {
    color: rgba(255,255,255,0.55);
    margin-bottom: 25px;
    font-size: 0.9rem;
}

.modal-input {
    width: 100%;
    padding: 13px 15px;
    margin-bottom: 12px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(0,0,0,0.4);
    color: #fff;
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.2s;
}
.modal-input:focus {
    outline: none;
    border-color: var(--cyan);
}

.modal-btn {
    width: 100%;
    background: linear-gradient(90deg, var(--purple), var(--cyan));
    color: #fff;
    border: none;
    padding: 14px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 800;
    font-size: 1.1rem;
    font-family: inherit;
    transition: 0.2s;
}
.modal-btn:hover { filter: brightness(1.1); transform: translateY(-1px); }

.modal-msg {
    margin-top: 12px;
    font-size: 0.85rem;
    color: #ff4444;
    display: none;
}

/* ══════════════════════════════════════
   HEADER
   ══════════════════════════════════════ */
.top-header {
    position: fixed;
    top: 0; left: 0;
    width: 100%;
    padding: 14px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10;
    background: linear-gradient(to bottom, rgba(0,0,0,0.7) 0%, transparent 100%);
    pointer-events: none;
}

.app-logo {
    font-weight: 900;
    font-size: 1.3rem;
    pointer-events: auto;
    cursor: pointer;
    user-select: none;
}
.app-logo span { color: var(--cyan); }

.header-right {
    display: flex;
    align-items: center;
    gap: 10px;
    pointer-events: auto;
}

#grid-btn {
    pointer-events: auto;
    cursor: pointer;
    font-size: 1.1rem;
    color: rgba(255,255,255,0.85);
    transition: color 0.2s;
}
#grid-btn:hover { color: var(--cyan); }

/* ══════════════════════════════════════
   🔍  SEARCH BAR
   ══════════════════════════════════════ */
.search-wrapper {
    display: flex;
    align-items: center;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 50px;
    padding: 6px 14px;
    gap: 8px;
    transition: 0.25s;
    backdrop-filter: blur(8px);
    width: 180px;
}
.search-wrapper:focus-within {
    border-color: var(--cyan);
    background: rgba(0,231,255,0.06);
    width: 230px;
}

.search-icon {
    color: rgba(255,255,255,0.45);
    font-size: 0.85rem;
    flex-shrink: 0;
}

.search-input {
    background: transparent;
    border: none;
    outline: none;
    color: #fff;
    font-family: inherit;
    font-size: 0.88rem;
    width: 100%;
}
.search-input::placeholder { color: rgba(255,255,255,0.35); }

.search-clear {
    background: transparent;
    border: none;
    color: rgba(255,255,255,0.45);
    cursor: pointer;
    display: flex;
    align-items: center;
    padding: 0;
    font-size: 0.8rem;
    transition: color 0.2s;
    flex-shrink: 0;
}
.search-clear:hover { color: #fff; }

/* ══════════════════════════════════════
   GRID
   ══════════════════════════════════════ */
.grid-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    padding: 8px;
    padding-top: 72px;
}
@media (min-width: 768px)  { .grid-container { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1024px) { .grid-container { grid-template-columns: repeat(4, 1fr); } }

.grid-item {
    aspect-ratio: 9/16;
    background: #111;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    position: relative;
    border: 1px solid var(--border);
    transition: transform 0.2s, border-color 0.2s;
}
.grid-item:hover {
    transform: scale(1.02);
    border-color: rgba(0,231,255,0.3);
}
.grid-item:active { transform: scale(0.97); }

/* Thumbnail canvas */
.video-thumb {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.4s ease;
}

/* Skeleton loader */
.thumb-skeleton {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        110deg,
        #1a1a1a 30%,
        #2a2a2a 50%,
        #1a1a1a 70%
    );
    background-size: 200% 100%;
    animation: shimmer 1.4s infinite;
}
@keyframes shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.grid-overlay {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    padding: 30px 10px 10px;
    background: linear-gradient(to top, rgba(0,0,0,0.92), transparent);
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}
.grid-title {
    font-size: 0.78rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #fff;
    flex: 1;
}
.grid-meta {
    flex-shrink: 0;
    margin-right: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.grid-views {
    font-size: 0.72rem;
    color: rgba(255,255,255,0.6);
    display: flex;
    align-items: center;
    gap: 4px;
}
.grid-download-btn {
    width: 24px; height: 24px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.15);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    text-decoration: none;
    transition: 0.2s;
    flex-shrink: 0;
}
.grid-download-btn:hover {
    background: var(--cyan);
    color: #000;
    border-color: var(--cyan);
}

/* Empty / No Results */
.empty-state, .no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: rgba(255,255,255,0.35);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}
.empty-state i, .no-results i {
    font-size: 2.8rem;
}

/* ══════════════════════════════════════
   SCROLL VIEW (TikTok)
   ══════════════════════════════════════ */
.app-container {
    height: 100vh;
    height: 100dvh;
    width: 100%;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    display: none;
}

.video-wrapper {
    height: 100vh;
    height: 100dvh;
    width: 100%;
    scroll-snap-align: start;
    position: relative;
    background: #000;
}

.video-player {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
}

/* ── UI فوق الفيديو ── */
.ui-layer {
    position: absolute;
    bottom: 0; left: 0;
    width: 100%;
    padding: 20px;
    padding-bottom: 34px;
    background: linear-gradient(to top, rgba(0,0,0,0.88) 0%, transparent 100%);
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.bottom-info { flex: 1; padding-left: 14px; }
.author-name {
    font-size: 1.05rem;
    font-weight: 800;
    margin-bottom: 6px;
    text-shadow: 1px 1px 4px rgba(0,0,0,0.9);
}
.video-title {
    font-size: 0.92rem;
    margin-bottom: 10px;
    text-shadow: 1px 1px 4px rgba(0,0,0,0.9);
    line-height: 1.4;
}
.views-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.78rem;
    color: rgba(255,255,255,0.6);
    background: rgba(255,255,255,0.08);
    padding: 4px 10px;
    border-radius: 50px;
    border: 1px solid rgba(255,255,255,0.1);
}

/* ── الأزرار الجانبية ── */
.right-actions {
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
}

.action-btn {
    background: transparent;
    border: none;
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    position: relative;
    text-decoration: none;
}

.action-icon {
    width: 50px; height: 50px;
    background: rgba(0,0,0,0.45);
    backdrop-filter: blur(8px);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 1px solid rgba(255,255,255,0.12);
    transition: background 0.2s, border-color 0.2s;
    font-size: 1.15rem;
}

.action-label {
    font-size: 0.72rem;
    color: rgba(255,255,255,0.7);
    font-family: 'Tajawal', sans-serif;
    font-weight: 700;
}

/* ── ❤️ Like button ── */
.like-icon { transition: color 0.25s; }
.like-btn.liked .like-count { color: var(--pink); }

/* Floating heart أنيميشن */
.floating-heart {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.4rem;
    pointer-events: none;
    animation: floatUp 0.9s ease-out forwards;
    z-index: 20;
}
@keyframes floatUp {
    0%   { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
    100% { opacity: 0; transform: translateX(-50%) translateY(-60px) scale(1.6); }
}

/* ── Play/Pause icon ── */
.play-pause-icon {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    font-size: 4.5rem;
    color: rgba(255,255,255,0.75);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
    text-shadow: 0 0 20px rgba(0,0,0,0.5);
}
.is-paused .play-pause-icon { opacity: 1; }

/* ══════════════════════════════════════
   🔔 TOAST
   ══════════════════════════════════════ */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(30,30,40,0.95);
    color: #fff;
    padding: 12px 22px;
    border-radius: 50px;
    font-size: 0.88rem;
    font-weight: 700;
    border: 1px solid rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    opacity: 0;
    transition: opacity 0.25s, transform 0.25s;
    z-index: 9999;
    pointer-events: none;
    white-space: nowrap;
}
.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ══════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════ */
@media (max-width: 400px) {
    .search-wrapper { width: 140px; }
    .search-wrapper:focus-within { width: 170px; }
    .action-icon { width: 44px; height: 44px; font-size: 1rem; }
}

/* ══════════════════════════════════════
   COMMENTS SECTION — MontaTV
   (تصميم العناصر الداخلية: فقاعات، أفاتار، نموذج الكتابة)
   ══════════════════════════════════════ */

.comments-section {
    padding: 20px 18px 40px;
    border-top: 1px solid rgba(255,255,255,.07);
    margin-top: 8px;
}

/* ── رأس القسم ── */
.comments-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
}
.comments-title {
    font-size: .95rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #fff;
}
.comments-title i { color: var(--cyan); font-size: .9rem; }
.comments-count {
    font-size: .78rem;
    color: rgba(255,255,255,.35);
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 50px;
    padding: 2px 12px;
    font-weight: 700;
}

/* ── حقل الإدخال ── */
.comment-form {
    display: flex;
    gap: 12px;
    margin-bottom: 22px;
    flex-shrink: 0;
}
.comment-avatar-wrap { flex-shrink: 0; }
.comment-avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: rgba(123,47,247,.25);
    border: 1px solid rgba(123,47,247,.35);
    display: flex; align-items: center; justify-content: center;
    font-size: .88rem;
    font-weight: 900;
    color: rgba(200,170,255,.9);
    user-select: none;
}
.comment-input-wrap { flex: 1; min-width: 0; }

.comment-textarea {
    width: 100%;
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,.1);
    background: rgba(255,255,255,.05);
    color: #fff;
    font-family: 'Tajawal', sans-serif;
    font-size: .9rem;
    line-height: 1.5;
    resize: none;
    min-height: 42px;
    max-height: 140px;
    transition: border-color .2s, background .2s;
    display: block;
}
.comment-textarea:focus {
    outline: none;
    border-color: var(--cyan);
    background: rgba(0,231,255,.04);
}
.comment-textarea::placeholder { color: rgba(255,255,255,.3); }

.comment-actions {
    display: none;          /* تظهر فقط عند التركيز أو وجود نص */
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 8px;
}
.comment-textarea:focus ~ .comment-actions,
.comment-actions.visible { display: flex; }

.char-counter {
    font-size: .75rem;
    color: rgba(255,255,255,.3);
    margin-left: auto;
}
.char-counter.warn { color: #FFD166; }
.char-counter.over { color: var(--pink); }

.btn-cancel {
    background: transparent;
    border: 1px solid rgba(255,255,255,.12);
    color: rgba(255,255,255,.5);
    padding: 7px 14px;
    border-radius: 8px;
    font-family: 'Tajawal', sans-serif;
    font-size: .82rem;
    font-weight: 700;
    cursor: pointer;
    transition: .2s;
}
.btn-cancel:hover { background: rgba(255,255,255,.06); color: #fff; }

.btn-send {
    background: rgba(0,231,255,.12);
    border: 1px solid rgba(0,231,255,.25);
    color: var(--cyan);
    padding: 7px 16px;
    border-radius: 8px;
    font-family: 'Tajawal', sans-serif;
    font-size: .82rem;
    font-weight: 800;
    cursor: pointer;
    transition: .2s;
    display: flex; align-items: center; gap: 6px;
}
.btn-send:hover { background: rgba(0,231,255,.22); }
.btn-send:disabled { opacity: .5; cursor: not-allowed; }

/* ── قائمة التعليقات ── */
.comments-loading {
    text-align: center;
    padding: 28px;
    color: rgba(255,255,255,.25);
    font-size: 1.2rem;
}

.comment-item {
    display: flex;
    gap: 11px;
    margin-bottom: 18px;
    animation: fadeSlide .25s ease-out both;
}
@keyframes fadeSlide {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.comment-item.pinned .comment-bubble {
    border-color: rgba(255,209,102,.25);
    background: rgba(255,209,102,.05);
}
.pinned-badge {
    font-size: .7rem;
    color: #FFD166;
    background: rgba(255,209,102,.12);
    border: 1px solid rgba(255,209,102,.2);
    border-radius: 50px;
    padding: 1px 8px;
    margin-right: 6px;
    font-weight: 700;
}

.comment-bubble {
    flex: 1;
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(255,255,255,.07);
    border-radius: 12px;
    padding: 11px 14px;
    min-width: 0;
}
.comment-name {
    font-size: .82rem;
    font-weight: 800;
    color: rgba(200,170,255,.9);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
}
.comment-body {
    font-size: .88rem;
    color: rgba(255,255,255,.8);
    line-height: 1.5;
    word-break: break-word;
}
.comment-footer {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 7px;
}
.comment-time {
    font-size: .72rem;
    color: rgba(255,255,255,.3);
}
.btn-report {
    background: transparent;
    border: none;
    color: rgba(255,255,255,.2);
    font-size: .72rem;
    cursor: pointer;
    padding: 0;
    font-family: 'Tajawal', sans-serif;
    transition: color .2s;
    display: flex; align-items: center; gap: 4px;
}
.btn-report:hover { color: var(--pink); }
.btn-report.reported { color: rgba(255,77,109,.5); pointer-events: none; }

/* حالة "لا تعليقات" */
.no-comments {
    text-align: center;
    padding: 32px 10px;
    color: rgba(255,255,255,.25);
    font-size: .88rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}
.no-comments i { font-size: 2rem; }

/* ══════════════════════════════════════
   COMMENTS — سلوك الانبثاق فوق الفيديو
   (Bottom Sheet: خلفية معتمة + لوحة منزلقة)
   ══════════════════════════════════════ */

.comments-overlay-bg {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 60;
    opacity: 0;
    visibility: hidden;
    transition: opacity .25s ease;
}
.comments-overlay-bg.is-open {
    opacity: 1;
    visibility: visible;
}

.comments-section-floating {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 61;
    max-height: 70vh;
    background: #0b0d14;
    border-radius: 18px 18px 0 0;
    transform: translateY(100%);
    transition: transform .3s cubic-bezier(.32,.72,0,1);
    display: flex;
    flex-direction: column;
    padding-bottom: max(20px, env(safe-area-inset-bottom));
}
.comments-section-floating.is-open {
    transform: translateY(0);
}

.comments-section-floating .comments-list {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 4px;
}

.comments-close-btn {
    background: none;
    border: none;
    color: rgba(255,255,255,.6);
    font-size: 1.1rem;
    cursor: pointer;
    margin-right: auto;
    padding: 4px;
}
.comments-close-btn:hover { color: #fff; }

@media (min-width: 700px) {
    .comments-section-floating {
        left: 50%;
        right: auto;
        width: 420px;
        margin-left: -210px;
        bottom: 5vh;
        max-height: 80vh;
        border-radius: 18px;
        transform: translateY(30px) scale(.96);
        opacity: 0;
        transition: transform .25s ease, opacity .25s ease;
    }
    .comments-section-floating.is-open {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

/* ══════════════════════════════════════
   MONTATV — style_additions.css
   أضف هذا في نهاية ملف style.css الموجود
   ══════════════════════════════════════ */

/* ─── إزالة padding-top القديم من grid ─── */
/* (الهيدر الجديد ليس fixed — لا حاجة لـ padding-top كبير) */
.grid-container {
    padding-top: 12px !important;
}

/* ─── تحسين بطاقات الشبكة ─── */
.grid-item {
    border-radius: 14px;
    box-shadow: 0 4px 16px rgba(0,0,0,.5);
}
.grid-item:hover {
    box-shadow: 0 8px 28px rgba(0,231,255,.15);
}

/* ─── owner badge (في scroll view) ─── */
.owner-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(29,78,216,.15);
    border: 1px solid rgba(96,165,250,.25);
    border-radius: 50px;
    padding: 3px 12px 3px 8px;
    font-size: .75rem;
    font-weight: 800;
    color: #93c5fd;
    margin-bottom: 6px;
}
.owner-badge i { font-size: .7rem; color: #60a5fa; }

/* ─── Admin Badge ─── */
.admin-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: linear-gradient(90deg, #1d4ed8, #2563eb);
    border: 1px solid rgba(96,165,250,.4);
    border-radius: 50px;
    padding: 1px 8px;
    font-size: .65rem;
    font-weight: 800;
    color: #fff;
    margin-right: 6px;
    vertical-align: middle;
    box-shadow: 0 0 8px rgba(37,99,235,.4);
}
.admin-badge i { font-size: .6rem; color: #93c5fd; }

/* ─── section label في الجريد ─── */
.section-label {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 4px 4px;
    font-size: .82rem;
    font-weight: 800;
    color: rgba(255,255,255,.5);
    letter-spacing: .04em;
    text-transform: uppercase;
}
.section-label::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255,255,255,.07);
}
.section-label i { color: #00E7FF; }

/* ─── Animated strip ─── */
.animated-strip {
    background: linear-gradient(90deg,
        rgba(123,47,247,.18) 0%,
        rgba(0,231,255,.12) 50%,
        rgba(123,47,247,.18) 100%);
    border-bottom: 1px solid rgba(0,231,255,.15);
    padding: 9px 20px;
    display: flex;
    align-items: center;
    overflow: hidden;
}
.strip-track {
    display: flex;
    gap: 32px;
    animation: marquee 22s linear infinite;
    white-space: nowrap;
    align-items: center;
}
@keyframes marquee {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}
.strip-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: .82rem;
    font-weight: 700;
    color: rgba(255,255,255,.7);
    flex-shrink: 0;
}
.strip-item.cyan i   { color: #00E7FF; }
.strip-item.purple i { color: #a78bfa; }
.strip-item.gold i   { color: #FFD166; }
.strip-item.pink i   { color: #ff4d6d; }
.strip-dot { color: rgba(255,255,255,.2); font-size: 1.2rem; flex-shrink: 0; }

/* ─── Main header ─── */
.main-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
    background: rgba(0,0,0,.55);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(255,255,255,.07);
    position: sticky;
    top: 0;
    z-index: 50;
}
.logo-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}
.logo-icon {
    width: 36px; height: 36px;
    background: linear-gradient(135deg, #7B2FF7, #00E7FF);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem;
    box-shadow: 0 0 14px rgba(0,231,255,.3);
}
.app-logo {
    font-weight: 900;
    font-size: 1.25rem;
}
.app-logo span { color: #00E7FF; }
.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ─── User Chip ─── */
.user-chip {
    display: none;
    align-items: center;
    gap: 8px;
    background: rgba(0,231,255,.08);
    border: 1px solid rgba(0,231,255,.18);
    border-radius: 50px;
    padding: 5px 12px 5px 6px;
    animation: chipIn .4s ease-out;
}
@keyframes chipIn {
    from { opacity:0; transform: scale(.85); }
    to   { opacity:1; transform: scale(1); }
}
.user-chip-avatar {
    width: 26px; height: 26px;
    border-radius: 50%;
    background: linear-gradient(135deg, #7B2FF7, #00E7FF);
    display: flex; align-items: center; justify-content: center;
    font-size: .72rem; font-weight: 900; color: #fff;
}
.user-chip-name {
    font-size: .8rem; font-weight: 800; color: #00E7FF;
    max-width: 100px; white-space: nowrap;
    overflow: hidden; text-overflow: ellipsis;
}
.user-chip-star { font-size: .65rem; color: #FFD166; }

/* ─── Welcome Banner ─── */
.welcome-banner {
    display: none;
    padding: 14px 18px;
    background: linear-gradient(90deg, rgba(123,47,247,.15), rgba(0,231,255,.08));
    border-bottom: 1px solid rgba(0,231,255,.1);
    align-items: center;
    gap: 14px;
    animation: bannerIn .5s ease-out;
}
@keyframes bannerIn {
    from { opacity:0; transform: translateY(-8px); }
    to   { opacity:1; transform: translateY(0); }
}
.welcome-banner.show { display: flex; }
.wb-icon { font-size: 1.6rem; flex-shrink: 0; animation: wave 1.5s ease-in-out 2; }
@keyframes wave {
    0%,100% { transform: rotate(0); }
    25%      { transform: rotate(20deg); }
    75%      { transform: rotate(-10deg); }
}
.wb-text { flex: 1; }
.wb-title { font-size: .95rem; font-weight: 800; color: #fff; margin-bottom: 2px; }
.wb-title span { color: #00E7FF; }
.wb-sub { font-size: .78rem; color: rgba(255,255,255,.5); }
.wb-badge {
    background: linear-gradient(135deg, #7B2FF7, #00E7FF);
    border-radius: 50px; padding: 5px 14px;
    font-size: .75rem; font-weight: 800; color: #fff;
    white-space: nowrap; flex-shrink: 0;
}

/* ─── Promo FAB ─── */
.promo-fab {
    position: fixed;
    bottom: 24px; left: 18px;
    z-index: 200;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    animation: fabBounce 2s ease-in-out infinite;
}
@keyframes fabBounce {
    0%,100% { transform: translateY(0); }
    50%      { transform: translateY(-6px); }
}
.promo-fab a {
    width: 52px; height: 52px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.3rem; text-decoration: none; color: #fff;
    box-shadow: 0 4px 20px rgba(0,0,0,.5);
    transition: transform .2s;
}
.promo-fab a:hover { transform: scale(1.1); }
.promo-fab a.shop-btn { background: linear-gradient(135deg, #FFD166, #ff9f43); }
.promo-fab a.site-btn { background: linear-gradient(135deg, #7B2FF7, #00E7FF); }
.promo-fab-label { font-size: .6rem; font-weight: 800; color: rgba(255,255,255,.5); text-align: center; }

/* ─── Stars background ─── */
.stars-bg {
    position: fixed; inset: 0;
    pointer-events: none; z-index: 0; overflow: hidden;
}
.star {
    position: absolute; background: #fff; border-radius: 50%;
    animation: twinkle var(--d,3s) ease-in-out infinite var(--delay,0s);
    opacity: 0;
}
@keyframes twinkle {
    0%,100% { opacity:0; transform:scale(.6); }
    50%      { opacity:var(--op,.7); transform:scale(1); }
}

/* ─── تأكد من أن الجريد فوق النجوم ─── */
.grid-container, .app-container, header {
    position: relative;
    z-index: 1;
}

/* ─── تحسين على الموبايل ─── */
@media (max-width: 400px) {
    .user-chip-name { max-width: 70px; }
    .wb-badge { display: none; }
    .promo-fab a { width: 44px; height: 44px; font-size: 1.1rem; }
}

/* ══════════════════════════════════════
   أضف هذا في نهاية style.css
   ══════════════════════════════════════ */

/* ─── Upload Progress Bar ─── */
.upload-progress-wrap {
    margin-top: 14px;
    display: none;
    animation: fadeIn .3s ease;
}
@keyframes fadeIn { from { opacity:0; transform:translateY(4px); } to { opacity:1; transform:none; } }

.upload-progress-bar-bg {
    height: 8px;
    background: rgba(255,255,255,.07);
    border-radius: 50px;
    overflow: hidden;
}
.upload-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--purple), var(--cyan));
    border-radius: 50px;
    transition: width .25s ease;
    position: relative;
    overflow: hidden;
}
/* shimmer على الـ progress bar */
.upload-progress-bar::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.2), transparent);
    animation: barShimmer 1.2s infinite;
}
@keyframes barShimmer {
    0%   { transform: translateX(-100%); }
    100% { transform: translateX(200%); }
}

.upload-progress-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    font-size: .82rem;
}
.upload-progress-status { color: rgba(255,255,255,.55); font-weight: 700; }
.upload-progress-right  { display: flex; gap: 10px; align-items: center; }
.upload-pct   { color: var(--cyan); font-size: .95rem; font-weight: 900; }
.upload-speed { color: rgba(255,255,255,.3); font-size: .78rem; }

/* ─── Thumbnail (img بدل canvas) ─── */
.grid-thumb-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity .4s ease;
}
.grid-thumb-img.loaded { opacity: 1; }

/* ─── Infinite Scroll loader ─── */
.load-more-spinner {
    grid-column: 1 / -1;
    text-align: center;
    padding: 24px;
    color: rgba(255,255,255,.3);
    font-size: 1.4rem;
    display: none;
}
.load-more-spinner.visible { display: block; }

.load-more-end {
    grid-column: 1 / -1;
    text-align: center;
    padding: 20px;
    font-size: .8rem;
    color: rgba(255,255,255,.2);
    font-weight: 700;
    display: none;
}
.load-more-end.visible { display: block; }
