/* ===== בסיס ===== */
* { margin:0; padding:0; box-sizing:border-box; }
:root {
  --bg:#fff; --text:#0f0f0f; --sub:#606060; --hover:#f2f2f2;
  --chip:#f2f2f2; --chip-active:#0f0f0f; --chip-active-text:#fff;
  --border:#e5e5e5; --red:#f00; --header-h:56px;
}
html,body { height:100%; }
body { font-family: Arial, "Helvetica Neue", Helvetica, sans-serif; background:var(--bg); color:var(--text); direction:rtl; }
a { color:inherit; text-decoration:none; }
button { font-family:inherit; cursor:pointer; border:none; background:none; color:inherit; }
img { display:block; }

/* ===== כותרת עליונה ===== */
.header { position:fixed; top:0; right:0; left:0; height:var(--header-h); background:var(--bg);
  display:flex; align-items:center; padding:0 16px; gap:16px; z-index:100; }
.header .menu-btn { width:40px; height:40px; border-radius:50%; display:flex; align-items:center; justify-content:center; flex-shrink:0; }
.header .menu-btn:hover { background:var(--hover); }
.logo { display:flex; align-items:center; gap:4px; font-size:20px; font-weight:700; letter-spacing:-0.5px; flex-shrink:0; cursor:pointer; }
.logo .play-badge { width:28px; height:20px; background:var(--red); border-radius:5px; display:flex; align-items:center; justify-content:center; }
.logo .play-badge svg { width:10px; height:10px; fill:#fff; }
.search-wrap { flex:1; display:flex; justify-content:center; min-width:0; }
.search-box { display:flex; width:100%; max-width:560px; }
.search-box input { flex:1; height:40px; border:1px solid #ccc; border-radius:20px 0 0 20px; padding:0 16px;
  font-size:16px; outline:none; min-width:0; direction:rtl; border-left:none; border-top-left-radius:0; border-bottom-left-radius:0;
  border-top-right-radius:20px; border-bottom-right-radius:20px; border-right:1px solid #ccc; }
.search-box input:focus { border-color:#1c62b9; }
.search-box .search-btn { width:64px; height:40px; background:#f8f8f8; border:1px solid #d3d3d3;
  border-radius:0 20px 20px 0; display:flex; align-items:center; justify-content:center; flex-shrink:0; border-right:none; }
.search-box .search-btn:hover { background:#f0f0f0; }
.header-actions { display:flex; align-items:center; gap:8px; flex-shrink:0; }
.icon-btn { width:40px; height:40px; border-radius:50%; display:flex; align-items:center; justify-content:center; }
.icon-btn:hover { background:var(--hover); }
.avatar { width:32px; height:32px; border-radius:50%; background:#7b1fa2; color:#fff; display:flex;
  align-items:center; justify-content:center; font-size:14px; font-weight:600; cursor:pointer; }

/* חיפוש במובייל */
.search-overlay { display:none; position:fixed; top:0; right:0; left:0; height:var(--header-h); background:var(--bg);
  z-index:200; align-items:center; padding:0 8px; gap:8px; }
.search-overlay.open { display:flex; }
.search-overlay .search-box { max-width:none; }

/* ===== סרגל צד ===== */
.sidebar { position:fixed; top:var(--header-h); right:0; bottom:0; width:240px; background:var(--bg);
  padding:12px; overflow-y:auto; transition:transform .2s; z-index:90; }
.sidebar.mini { width:72px; padding:4px; }
.side-item { display:flex; align-items:center; gap:24px; padding:10px 12px; border-radius:10px; font-size:14px; cursor:pointer; }
.side-item:hover { background:var(--hover); }
.side-item.active { font-weight:700; background:var(--hover); }
.sidebar.mini .side-item { flex-direction:column; gap:6px; padding:10px 4px; font-size:10px; }
.sidebar.mini .side-item span { display:none; }
.sidebar.mini .side-item small { display:block; }
.side-item small { display:none; }
.side-sep { border-top:1px solid var(--border); margin:12px 0; }
.side-title { padding:8px 12px 4px; font-size:15px; font-weight:700; }
.sidebar.mini .side-title, .sidebar.mini .side-sep { display:none; }

/* ===== תוכן ===== */
.main { margin-top:var(--header-h); margin-right:240px; transition:margin .2s; }
.main.wide { margin-right:72px; }
.chips-bar { position:sticky; top:var(--header-h); background:var(--bg); z-index:80; padding:12px 24px;
  display:flex; gap:12px; overflow-x:auto; scrollbar-width:none; }
.chips-bar::-webkit-scrollbar { display:none; }
.chip { padding:8px 12px; background:var(--chip); border-radius:8px; font-size:14px; white-space:nowrap; cursor:pointer; }
.chip:hover { background:#e5e5e5; }
.chip.active { background:var(--chip-active); color:var(--chip-active-text); }

.video-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(310px,1fr)); gap:16px 16px; padding:12px 24px 40px; }
.v-card { cursor:pointer; }
.v-thumb-wrap { position:relative; border-radius:12px; overflow:hidden; aspect-ratio:16/9; background:#000; }
.v-thumb-wrap img { width:100%; height:100%; object-fit:cover; }
.v-duration { position:absolute; bottom:8px; left:8px; background:rgba(0,0,0,.8); color:#fff; font-size:12px;
  padding:3px 4px; border-radius:4px; font-weight:500; }
.v-meta { display:flex; gap:12px; padding-top:12px; }
.v-avatar { width:36px; height:36px; border-radius:50%; flex-shrink:0; display:flex; align-items:center;
  justify-content:center; color:#fff; font-weight:600; font-size:15px; }
.v-title { font-size:16px; font-weight:600; line-height:1.35; display:-webkit-box; -webkit-line-clamp:2;
  -webkit-box-orient:vertical; overflow:hidden; }
.v-sub { font-size:14px; color:var(--sub); margin-top:4px; }

/* ===== עמוד צפייה ===== */
.watch-layout { display:flex; gap:24px; padding:24px; max-width:1750px; margin:0 auto; align-items:flex-start; }
.watch-main { flex:1; min-width:0; }
.player-wrap { border-radius:12px; overflow:hidden; background:#000; aspect-ratio:16/9; width:100%; }
.player-wrap video { width:100%; height:100%; }
.watch-title { font-size:20px; font-weight:700; margin-top:16px; line-height:1.4; }
.watch-row { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:12px; margin-top:12px; }
.channel-row { display:flex; align-items:center; gap:12px; }
.channel-row .v-avatar { width:40px; height:40px; }
.channel-name { font-size:16px; font-weight:600; }
.channel-subs { font-size:12px; color:var(--sub); }
.subscribe-btn { background:var(--text); color:var(--bg); padding:10px 16px; border-radius:18px; font-size:14px; font-weight:600; }
.subscribe-btn.subscribed { background:var(--chip); color:var(--text); }
.actions-row { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.pill-group { display:flex; background:var(--chip); border-radius:18px; overflow:hidden; }
.pill-group button { padding:8px 16px; display:flex; align-items:center; gap:6px; font-size:14px; font-weight:600; }
.pill-group button:hover { background:#e5e5e5; }
.pill-group .sep { width:1px; background:#d9d9d9; margin:6px 0; }
.pill-btn { background:var(--chip); border-radius:18px; padding:8px 16px; display:flex; align-items:center; gap:6px; font-size:14px; font-weight:600; }
.pill-btn:hover { background:#e5e5e5; }
.desc-box { background:var(--chip); border-radius:12px; padding:12px; margin-top:16px; font-size:14px; line-height:1.6; }
.desc-stats { font-weight:600; margin-bottom:4px; }
.desc-text { white-space:pre-line; }
.comments { margin-top:32px; }
.comments-title { font-size:16px; font-weight:700; margin-bottom:24px; }
.comment { display:flex; gap:16px; margin-bottom:20px; }
.comment-body { flex:1; }
.comment-author { font-size:13px; font-weight:600; }
.comment-time { font-size:12px; color:var(--sub); font-weight:400; margin-right:4px; }
.comment-text { font-size:14px; margin-top:2px; line-height:1.5; }
.comment-actions { font-size:12px; color:var(--sub); margin-top:6px; display:flex; gap:16px; align-items:center; }
.up-next { width:400px; flex-shrink:0; display:flex; flex-direction:column; gap:8px; }
.upnext-item { display:flex; gap:8px; cursor:pointer; padding:4px; border-radius:8px; }
.upnext-item:hover { background:var(--hover); }
.upnext-thumb { position:relative; width:168px; aspect-ratio:16/9; border-radius:8px; overflow:hidden; flex-shrink:0; background:#000; }
.upnext-thumb img { width:100%; height:100%; object-fit:cover; }
.upnext-meta .v-title { font-size:14px; }
.upnext-meta .v-sub { font-size:12px; margin-top:2px; }

/* ===== תוצאות חיפוש ===== */
.results { padding:24px; max-width:1100px; display:flex; flex-direction:column; gap:16px; }
.result-item { display:flex; gap:16px; cursor:pointer; }
.result-thumb { position:relative; width:360px; aspect-ratio:16/9; border-radius:12px; overflow:hidden; flex-shrink:0; background:#000; }
.result-thumb img { width:100%; height:100%; object-fit:cover; }
.result-meta .v-title { font-size:18px; font-weight:500; }
.result-meta .v-sub { font-size:12px; margin-top:6px; }
.result-desc { font-size:12px; color:var(--sub); margin-top:8px; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.no-results { padding:60px 24px; text-align:center; color:var(--sub); font-size:16px; }

/* ===== מובייל ===== */
@media (max-width:1100px) {
  .up-next { width:320px; }
  .result-thumb { width:280px; }
}
@media (max-width:768px) {
  .sidebar { transform:translateX(100%); box-shadow:-2px 0 8px rgba(0,0,0,.1); }
  .sidebar.open { transform:translateX(0); width:240px; }
  .sidebar.mini { width:240px; }
  .sidebar.mini .side-item { flex-direction:row; gap:24px; padding:10px 12px; font-size:14px; }
  .sidebar.mini .side-item span { display:inline; }
  .sidebar.mini .side-title, .sidebar.mini .side-sep { display:block; }
  .main, .main.wide { margin-right:0; }
  .header .search-wrap { display:none; }
  .video-grid { grid-template-columns:1fr; padding:12px 12px 40px; gap:24px; }
  .chips-bar { padding:12px; }
  .watch-layout { flex-direction:column; padding:0 0 24px; gap:0; }
  .player-wrap { border-radius:0; }
  .watch-title, .watch-row, .desc-box, .comments { margin-right:12px; margin-left:12px; }
  .up-next { width:100%; padding:12px; margin-top:8px; }
  .results { padding:16px 12px; }
  .result-item { flex-direction:column; gap:8px; }
  .result-thumb { width:100%; }
}
