/* =======================
   GymPower Pro — ORANGE DOMINANT THEME
   ======================= */

/* --------- Root palette --------- */
:root {
    --brand: #ff7a1a;        /* برتقالي رئيسي */
    --brand-2: #ff8f3e;      /* برتقالي أفتح للهَوَفر */
    --brand-3: #ff6a00;      /* برتقالي أغمق */
    --ink: #ffffff;          /* نص فاتح */
    --ink-dim: #b9c3da;      /* نص ثانوي */
    --bg-0: #0f0f12;         /* خلفية أساسية (غامقة) */
    --bg-1: #15151a;         /* طبقة بطاقات */
    --bg-2: #1b1b22;         /* طبقة أعمق */
    --line: #282836;         /* حدود خفيفة */
    --success: #2bdc8c;
    --danger: #ff4d4d;
    --shadow: 0 10px 30px rgba(0,0,0,.45);
    --radius: 14px;
    --radius-sm: 10px;
    --radius-lg: 18px;
    --focus: 0 0 0 3px rgba(255,122,26,.25);
}

/* --------- Global reset --------- */
* { box-sizing: border-box; }
html, body {
    margin: 0;
    padding: 0;
    background: radial-gradient(1200px 800px at 70% -10%, rgba(255,122,26,.14), transparent 60%) , var(--bg-0);
    color: var(--ink);
    font-family: "Tajawal", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}
a { color: var(--brand-2); text-decoration: none; }
a:hover { color: var(--brand); }

img { max-width: 100%; display: block; }

/* --------- Utilities --------- */
.no-scroll { overflow: hidden; }
.hide { display: none !important; }

/* --------- Header --------- */
.header {
    position: sticky;
    top: 0;
    z-index: 50;
    display: grid;
    grid-template-columns: auto 80px 1fr auto;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    background:
            linear-gradient(90deg, rgba(255,122,26,.12), rgba(255,122,26,0) 45%),
            var(--bg-1);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow);
}
.header-left { display:flex; align-items:center; gap: 12px; }
.logo {
    font-size: 1rem;
    color: #ffffff;
    font-weight: 700;
    font-family: 'Oswald', sans-serif;
    letter-spacing: 1px;
    text-transform: uppercase;
    text-decoration: none;
}
.logo span {
    color: #ff5500; /* برتقالي */
    transition: all 0.3s ease;
}
.logo:hover span {
    color: #00a8ff; /* أزرق عند hover */
}

.header-center { display:flex; align-items:center; justify-content:center; }
.search-box {
    width: 100%;
    max-width: 520px;
    display:flex; align-items:center; gap:8px;
    background: var(--bg-2);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 10px 12px;
}
.search-box input {
    flex: 1; background: transparent; border:0; color:var(--ink);
    outline: none; font-size: 15px;
}
.search-btn {
    border:0; background: var(--brand);
    color: #111; padding: 10px 14px; border-radius: 999px;
    cursor: pointer; font-weight:700;
}
.search-btn:hover { background: var(--brand-2); }

.header-right { display:flex; align-items:center; gap: 14px; }

.user-menu { position: relative; }
.user-btn {
    display:flex; align-items:center; gap:10px;
    background: var(--bg-2); border: 1px solid var(--line);
    padding: 6px 10px; border-radius: 999px; color: var(--ink);
}
.user-btn i{ color: var(--ink-dim); }
.avatar { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }

.dropdown {
    position: absolute; inset-inline-end: 0; top: calc(100% + 8px);
    min-width: 220px; background: var(--bg-1);
    border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: var(--shadow); padding: 8px;
}
.dropdown-item {
    display:flex; align-items:center; gap:10px;
    padding: 10px; color: var(--ink);
    border-radius: 8px;
}
.dropdown-item:hover { background: rgba(255,122,26,.12); }
.dropdown-divider { height:1px; background: var(--line); margin: 6px 0; }
.dropdown-item.danger i, .dropdown-item.danger { color: var(--danger); }

/* --------- Buttons --------- */
.icon-btn, .pill, .cta-btn, .action-btn, .player-btn, .btn-lang, .filter-btn {
    display:inline-flex; align-items:center; justify-content:center; gap:8px;
    border: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(255,122,26,.22), rgba(255,122,26,.08));
    color: var(--ink); padding: 10px 14px; border-radius: 12px;
    cursor: pointer; transition: .2s ease;
}
.icon-btn:hover, .pill:hover, .cta-btn:hover, .action-btn:hover, .player-btn:hover, .btn-lang:hover, .filter-btn:hover {
    border-color: rgba(255,122,26,.7); transform: translateY(-1px);
}
.cta-btn.cta-solid {
    border: none;
    background: linear-gradient(180deg, var(--brand), var(--brand-3));
    color:#111; font-weight:800;
}
.cta-btn.outline {
    background: transparent; border: 1px dashed var(--brand);
    color: var(--brand);
}
.btn-lang {
    font-weight:800; letter-spacing:.6px;
    background: linear-gradient(180deg, var(--brand), var(--brand-3));
    color:#111;
}

/* --------- Layout --------- */
.yt-container {
    display: grid; gap: 18px;
    grid-template-columns: 1.2fr .8fr;
    padding: 18px; max-width: 1400px; margin: 0 auto;
}
.yt-container.theater { grid-template-columns: 1fr 420px; }

/* --------- Player --------- */
.yt-player {
    background: linear-gradient(180deg, rgba(255,122,26,.06), transparent 35%), var(--bg-1);
    border: 1px solid var(--line);
    border-radius: var(--radius); box-shadow: var(--shadow);
    overflow: hidden;
}
.player-actions {
    display:flex; gap:8px; justify-content:flex-end;
    padding: 10px; border-bottom:1px solid var(--line);
    background: rgba(255,122,26,.08);
}
.player-btn { background: var(--bg-2); }

.yt-titlebar {
    display:flex; align-items:center; justify-content:space-between;
    padding: 14px 16px;
}
#videoTitle { margin: 0; font-size: 22px; letter-spacing:.3px; }
.video-actions { display:flex; gap:10px; flex-wrap: wrap; }
.action-btn {
    background: var(--bg-2); border-color: transparent;
}
.action-btn:hover { background: rgba(255,122,26,.14); }

.yt-framewrap {
    position: relative; background: #000; aspect-ratio: 16/9;
    border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
#ytFrame { width: 100%; height: 100%; display:block; }
.locked {
    position:absolute; inset:0;
    display:flex; flex-direction:column; align-items:center; justify-content:center;
    gap: 14px; text-align:center;
    background: linear-gradient(180deg, rgba(15,15,18,.7), rgba(15,15,18,.9));
    backdrop-filter: blur(2px);
}
.lock-icon { font-size: 34px; }
#lockedMsg { color: var(--ink); opacity:.9; }

.video-loading {
    position:absolute; inset:0; display:none;
    align-items:center; justify-content:center; gap:10px;
    background: linear-gradient(180deg, rgba(15,15,18,.6), rgba(15,15,18,.9));
}
.loading-spinner {
    width: 22px; height: 22px;
    border: 3px solid rgba(255,255,255,.15);
    border-top-color: var(--brand);
    border-radius: 50%; animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.yt-meta {
    display:flex; align-items:center; justify-content:space-between;
    padding: 12px 16px; background: var(--bg-2);
    border-top: 1px solid var(--line);
}
.watched-info { color: var(--ink-dim); }
.views-count { color: var(--ink-dim); }

/* --------- Description, Details --------- */
.video-details { padding: 16px; }
.creator-info {
    display:flex; align-items:center; gap:12px;
    background: var(--bg-2); border: 1px solid var(--line);
    border-radius: var(--radius-sm); padding: 12px;
}
.creator-avatar { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }
.subscribe-btn {
    margin-inline-start: auto;
    background: linear-gradient(180deg, var(--brand), var(--brand-3));
    color: #111; font-weight:800; border: none; border-radius: 10px;
    padding: 10px 14px; cursor:pointer;
}

.video-description {
    margin-top: 14px; background: var(--bg-2);
    border: 1px solid var(--line); border-radius: var(--radius-sm);
}
.description-content { padding: 12px 14px; }
.description-more { max-height: 180px; overflow: hidden; transition: max-height .25s ease; }
.show-more-btn {
    width: 100%; text-align:center; background: transparent; border: 0; color: var(--brand);
    padding: 10px 12px; border-top: 1px dashed var(--line); cursor:pointer;
}

/* --------- Notes --------- */
.notes-section {
    margin-top: 14px; background: var(--bg-2);
    border: 1px solid var(--line); border-radius: var(--radius-sm);
    padding: 12px 14px;
}
.notes-section h3 { margin: 8px 0 10px; }
#notesInput {
    width:100%; min-height: 110px; resize: vertical;
    background: var(--bg-1); color: var(--ink);
    border: 1px solid var(--line); border-radius: 10px;
    padding: 10px;
}
.notes-actions { display:flex; gap:10px; justify-content:flex-end; margin-top: 10px; }

/* --------- Comments --------- */
.comments-section {
    margin-top: 16px; background: var(--bg-2);
    border: 1px solid var(--line); border-radius: var(--radius-sm);
    padding: 12px 14px;
}
.comments-section h3 { margin: 0 0 10px; }
.add-comment { display:flex; gap:10px; align-items:center; }
.user-avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.comment-input-container { flex:1; }
#commentInput {
    width:100%; background: var(--bg-1); color: var(--ink);
    border: 1px solid var(--line); border-radius: 10px; padding: 10px;
}
.comment-actions { display:flex; gap:10px; justify-content:flex-end; margin-top: 8px; }
.text-btn { background: transparent; border: 0; color: var(--ink-dim); cursor:pointer; }
.text-btn:hover { color: var(--ink); }

.comments-list { margin-top: 14px; display: grid; gap: 10px; }
.comment-item {
    display:flex; gap: 10px; align-items:flex-start;
    background: var(--bg-1); border: 1px solid var(--line);
    border-radius: 12px; padding: 10px 12px;
}
.comment-head {
    display:flex; align-items:center; gap: 10px; color: var(--ink-dim);
    font-size: 13px; margin-bottom: 4px;
}
.comment-body { flex:1; }
.empty-comments {
    text-align:center; color: var(--ink-dim);
    padding: 18px; background: var(--bg-1); border: 1px dashed var(--line);
    border-radius: 12px;
}

/* --------- Sidebar --------- */
.yt-sidebar .sidebar-content { position: sticky; top: 88px; }

.card {
    background: linear-gradient(180deg, rgba(255,122,26,.05), transparent 40%), var(--bg-1);
    border: 1px solid var(--line);
    border-radius: var(--radius); box-shadow: var(--shadow);
    padding: 12px;
}
.meta-line {
    display:flex; align-items:center; gap:10px; color: var(--ink-dim);
    padding: 8px 6px; border-bottom: 1px dashed var(--line);
}
.meta-line:last-child { border-bottom: 0; }
.progress { margin: 10px 4px; }
.progress-head { display:flex; align-items:center; justify-content:space-between; color: var(--ink-dim); margin-bottom: 6px; }
.bar {
    width:100%; height: 10px; background: #1a1a22;
    border-radius: 999px; overflow: hidden; border: 1px solid var(--line);
}
.fill {
    height: 100%;
    background: linear-gradient(90deg, var(--brand), var(--brand-2));
    width: 0%;
}

.streak-container {
    margin-top: 10px; background: var(--bg-2);
    border: 1px solid var(--line); border-radius: 12px; padding: 10px;
}

.upnext-header {
    display:flex; align-items:center; justify-content:space-between; padding: 6px 6px 10px;
}
.search-days { padding: 6px; }
.search-days input {
    width: 100%; background: var(--bg-2); color: var(--ink);
    border: 1px solid var(--line); border-radius: 10px; padding: 10px;
}
.days-list { list-style:none; margin: 0; padding: 0; display:grid; gap: 10px; }
.days-item {
    display:grid; grid-template-columns: 120px 1fr auto; align-items:center; gap: 10px;
    background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px;
    padding: 8px; cursor: pointer; transition: .2s;
}
.days-item:hover { border-color: rgba(255,122,26,.5); transform: translateY(-1px); }
.days-item.active { outline: 2px solid rgba(255,122,26,.35); }
.days-item.unlocked { background: linear-gradient(180deg, rgba(255,122,26,.08), transparent 30%), var(--bg-2); }

.thumb { width: 100%; height: 72px; object-fit: cover; border-radius: 10px; }
.day-title { font-weight:800; }
.day-sub { color: var(--ink-dim); }
.lock { opacity: .75; }
.dot {
    --s: 12px;
    width: var(--s); height: var(--s);
    border-radius: 50%;
    background: #ffcfab; opacity:.45;
    box-shadow: 0 0 0 2px rgba(255,122,26,.25);
}
.dot.done { background: var(--success); opacity: 1; }

/* --------- Enroll --------- */
.enroll .enroll-content {
    display:grid; place-items:center; text-align:center; gap: 8px;
    padding: 12px;
}
.enroll-icon { color: var(--brand); font-size: 32px; }

/* --------- Recommended --------- */
.recommended-list { display:grid; gap: 10px; }
.recommended-item {
    display:grid; grid-template-columns: 120px 1fr; gap: 10px;
    background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; padding: 8px;
}
.thumb-wrapper { position:relative; }
.thumb-wrapper img { width:100%; height:72px; object-fit:cover; border-radius: 8px; }
.video-duration {
    position:absolute; inset-inline-end: 6px; bottom: 6px;
    background: rgba(0,0,0,.6); color: #fff; font-size: 12px; padding: 2px 6px; border-radius: 6px;
}
.video-meta { display:flex; align-items:center; gap: 6px; color: var(--ink-dim); font-size: 13px; }

/* --------- Notifications --------- */
.badge {
    position:absolute; inset-inline-end: -4px; top: -4px;
    background: var(--brand); color:#111; border-radius: 10px;
    padding: 2px 6px; font-size: 11px; font-weight: 800;
}
.notif-list { display:grid; gap: 8px; max-height: 340px; overflow:auto; }
.notif-item {
    background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px;
}
.notif-time { color: var(--ink-dim); margin-top: 4px; font-size: 12px; }

/* --------- Modals --------- */
.modal[hidden] { display:none !important; }
.modal {
    position: fixed; inset: 0; z-index: 100;
    display:grid; place-items:center;
    background: rgba(0,0,0,.55);
}
.modal-content {
    width: min(720px, 96vw);
    background: var(--bg-1); border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: var(--shadow); overflow: hidden;
}
.modal-header, .modal-footer {
    display:flex; align-items:center; justify-content:space-between;
    padding: 12px; background: var(--bg-2); border-bottom:1px solid var(--line);
}
.modal-footer { border-top: 1px solid var(--line); border-bottom: 0; }
.modal-body { padding: 12px; }
.close-btn {
    background: transparent; border: 0; color: var(--ink); cursor: pointer; font-size: 22px;
}
.preview-video video { width: 100%; border-radius: 12px; }

/* --------- Loader --------- */
.loader {
    position: fixed; inset: 0; z-index: 999;
    display:flex; flex-direction: column; align-items:center; justify-content:center; gap: 10px;
    background:
            radial-gradient(800px 500px at 80% 10%, rgba(255,122,26,.1), transparent 70%),
            var(--bg-0);
    color: var(--ink);
    transition: opacity .25s ease;
}
.spinner {
    width: 36px; height: 36px;
    border: 4px solid rgba(255,255,255,.18);
    border-top-color: var(--brand);
    border-radius: 50%; animation: spin .9s linear infinite;
}
.load-text { color: var(--ink-dim); }

/* --------- Toast --------- */
.toast {
    position: fixed; inset-inline: 0; bottom: 20px; z-index: 120;
    width: fit-content; max-width: 90vw; margin-inline: auto;
    background: linear-gradient(180deg, var(--brand), var(--brand-3));
    color: #111; padding: 12px 16px; border-radius: 999px;
    transform: translateY(18px); opacity: 0; transition: .25s;
    box-shadow: var(--shadow); font-weight: 800;
}
.toast.show { transform: translateY(0); opacity: 1; }

/* --------- Forms focus --------- */
input, textarea, button, .user-btn, .action-btn, .cta-btn, .pill, .player-btn, .icon-btn, .filter-btn {
    outline: none;
}
input:focus, textarea:focus,
.user-btn:focus, .action-btn:focus, .cta-btn:focus, .pill:focus, .player-btn:focus, .icon-btn:focus, .filter-btn:focus {
    box-shadow: var(--focus);
}

/* --------- Sidebar collapse (mobile) --------- */
@media (max-width: 1100px){
    .yt-container { grid-template-columns: 1fr; }
    .yt-sidebar { order: -1; }
}

/* --------- Small screens --------- */
@media (max-width: 640px) {
    .header { grid-template-columns: auto 60px 1fr auto; gap: 10px; }
    .search-box { max-width: 100%; }
    .days-item { grid-template-columns: 100px 1fr auto; }
    .yt-titlebar { flex-direction: column; align-items: flex-start; gap: 8px; }
}
/* منع التداخل في الهيدر */
.header {
    display: grid;
    grid-template-columns: 1fr auto 1fr; /* يسار | زر/لغة | يمين */
    align-items: center;
    gap: 12px;
    z-index: 200;
}
.header-left, .header-center, .header-right { display:flex; align-items:center; }
.header-center { justify-content:center; min-width:0; }
.search-box { width: min(560px, 100%); }

/* موضع الإشعارات والقائمة */
.notifications, .user-menu { position: relative; }
.notifications .dropdown,
.user-menu .dropdown {
    position: absolute;
    inset-inline-end: 0;
    top: calc(100% + 8px);
}

/* Drawer للموبايل */
@media (max-width:1100px){
    #sidebar{
        position: fixed;
        top: 64px;
        inset-inline-start: 0;
        width: min(90vw, 380px);
        height: calc(100dvh - 64px);
        transform: translateX(var(--drawer-hide, -100%));
        transition: transform .25s ease;
        z-index: 180;
    }
    html[dir="rtl"] #sidebar { --drawer-hide: 100%; }
    html[dir="ltr"] #sidebar { --drawer-hide: -100%; }
    body.sidebar-open #sidebar { transform: translateX(0); }
    .drawer-scrim{ position:fixed; inset:0; background:rgba(0,0,0,.45); z-index:170; display:none; }
    body.sidebar-open .drawer-scrim{ display:block; }
}

