:root {
    --bg: #0b0b0d; --card: #141416; --card-hover: #1c1c1f;
    --text: #f0f0f0; --muted: #8a8a93; --accent: #e50914; --line: #27272a;
    --sidebar-w: 72px;
  }
  * { box-sizing: border-box; }
  button, input { font: inherit; }
  button:focus-visible, input:focus-visible { outline: 3px solid rgba(255,255,255,0.75); outline-offset: 3px; }
  html, body { margin: 0; background: var(--bg); color: var(--text);
    font: 14px/1.5 "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;
    overflow-x: hidden; min-height: 100vh; }

  /* --- SIDEBAR (Desktop Only) --- */
  .sidebar {
    position: fixed; left: 20px; top: 20px; bottom: 20px; width: var(--sidebar-w);
    background: #18181b; border: 1px solid var(--line);
    border-radius: 36px; display: flex; flex-direction: column; align-items: center;
    padding: 20px 0; z-index: 100;
  }
  .sidebar-nav { display: flex; flex-direction: column; gap: 12px; width: 100%; align-items: center; margin-top: 20px; }
  .sidebar-item {
    color: var(--muted); display: flex; align-items: center; justify-content: center;
    width: 48px; height: 48px; border-radius: 16px; transition: all 0.2s;
    background: transparent; border: none; cursor: pointer;
  }
  .sidebar-item svg { width: 24px; height: 24px; fill: currentColor; }
  .sidebar-item:hover { color: var(--text); background: rgba(255,255,255,0.05); }
  .sidebar-item.active { color: var(--accent); }
  .sidebar-bottom { margin-top: auto; padding-top: 20px; }

  /* --- MAIN LAYOUT --- */
  .main-content { margin-left: calc(var(--sidebar-w) + 40px); padding-bottom: 40px; }

  /* --- Top Nav Tabs --- */
  .top-tabs {
    display: flex; gap: 24px; padding: 20px 4%; overflow-x: auto;
    border-bottom: 1px solid var(--line); scrollbar-width: none;
    position: sticky; top: 0; background: rgba(11,11,13,0.95); backdrop-filter: blur(10px); z-index: 50;
  }
  .top-tabs::-webkit-scrollbar { display: none; }
  .tab-btn {
    background: transparent; border: none; color: var(--muted);
    font-size: 15px; font-weight: 500; cursor: pointer; white-space: nowrap; transition: color 0.2s;
  }
  .tab-btn.active { color: var(--text); font-weight: 700; }
  .tab-btn:hover { color: var(--text); }

  /* --- HOME VIEW --- */
  #home-view { display: none; }
  .skeleton-hero { height: 65vh; background: #141416; display: flex; align-items: center; justify-content: center; color: var(--muted); font-weight: bold; }
  #hero-banner { position: relative; width: 100%; height: 65vh; background: #000; background-size: cover; background-position: center top; display: none; flex-direction: column; justify-content: flex-end; align-items: flex-start; padding: 0 4% 60px; }
  #hero-banner::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to top, var(--bg) 0%, transparent 80%), linear-gradient(to right, rgba(11,11,13,0.8) 0%, transparent 50%); }
  .hero-content-wrap { position: relative; z-index: 1; max-width: 800px; display: flex; flex-direction: column; align-items: flex-start; }

  /* LOGO FIX: Lartesi fikse qe te gjitha logot te duken njesoj */
  .hero-logo {
    height: 90px;
    max-width: 350px;
    width: auto;
    object-fit: contain;
    object-position: left center;
    margin-bottom: 16px;
    display: none;
  }

  .hero-title-img { font-size: 56px; font-weight: 900; margin: 0 0 16px; text-transform: uppercase; color: #fff; text-shadow: 0 4px 20px rgba(0,0,0,0.9); line-height: 1.1; }
  .hero-meta { display: flex; gap: 12px; color: #ccc; margin-bottom: 16px; font-size: 13px; align-items: center; font-weight: 600; flex-wrap: wrap; }
  .hero-meta .rating { background: rgba(255,255,255,0.15); padding: 4px 10px; border-radius: 6px; border: 1px solid rgba(255,255,255,0.1); color: #fff; display: flex; align-items: center; gap: 4px; }
  .hero-meta .rating-star { color: #ffd23f; }
  .hero-overview { color: #ccc; font-size: 15px; margin-bottom: 24px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; text-shadow: 0 2px 4px rgba(0,0,0,0.8); line-height: 1.6; }
  .hero-actions { display: flex; gap: 12px; align-items: center; }
  .hero-btn-details { background: #fff; color: #000; padding: 12px 32px; border-radius: 24px; font-weight: 700; font-size: 15px; border: none; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; }
  .hero-btn-details:hover { background: #e0e0e0; }
  .btn-icon { background: rgba(255,255,255,0.1); color: #fff; border: 1px solid rgba(255,255,255,0.2); width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: background 0.2s; }
  .btn-icon:hover { background: rgba(255,255,255,0.2); }
  .btn-icon svg { width: 20px; height: 20px; fill: currentColor; }
  .hero-dots { display: flex; gap: 8px; margin-top: 30px; }
  .hero-dots span { width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,0.3); cursor: pointer; }
  .hero-dots span.active { background: #fff; width: 24px; border-radius: 4px; }

  /* Rows */
  .row { margin-bottom: 40px; padding: 0 4%; }
  .row-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
  .row-title { font-size: 18px; font-weight: 800; margin: 0; text-transform: uppercase; position: relative; padding-bottom: 6px; letter-spacing: 0.5px; }
  .row-title::after { content: ''; position: absolute; bottom: 0; left: 0; width: 40px; height: 3px; background: var(--accent); }

  /* RREGULLIMI KRYESOR I KARTELAVE */
  .row-scroll { display: flex; gap: 16px; overflow-x: auto; padding-bottom: 10px; scrollbar-width: none; align-items: flex-start; }
  .row-scroll::-webkit-scrollbar { display: none; }
  .row-scroll .card {
    flex: 0 0 160px !important;
    width: 160px !important;
    min-width: 160px !important;
    max-width: 160px !important;
  }

  /* Cards */
  .card { background: transparent; cursor: pointer; position: relative; transition: transform 0.3s; }
  .card:hover { transform: translateY(-5px); }
  .poster { aspect-ratio: 2 / 3; background: #1a1d22 center/cover no-repeat; border-radius: 8px; position: relative; overflow: hidden; margin-bottom: 10px; box-shadow: 0 4px 10px rgba(0,0,0,0.5); width: 100%; }
  .poster .rating { position: absolute; bottom: 8px; left: 8px; background: rgba(0,0,0,0.85); color: #fff; font-size: 11px; font-weight: 700; padding: 4px 8px; border-radius: 4px; display: flex; align-items: center; gap: 4px; backdrop-filter: blur(4px); }
  .poster .rating span { color: #ffd23f; }
  .poster .quality { position: absolute; top: 8px; right: 8px; background: var(--accent); color: #fff; font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 4px; text-transform: uppercase; }
  .card-info { padding: 0 4px; }
  .card-title { font-size: 14px; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 2px; }
  .card-sub { font-size: 12px; color: var(--muted); }

  /* --- DETAIL VIEW --- */
  #detail-view { display: none; }
  .detail-hero { position: relative; width: 100%; min-height: 80vh; background: #000; background-size: cover; background-position: center top; display: flex; align-items: flex-end; padding: 0 4% 40px; }
  .detail-hero::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to top, var(--bg) 0%, transparent 90%), linear-gradient(to right, rgba(11,11,13,0.9) 0%, transparent 70%); }
  .detail-hero-content { position: relative; z-index: 1; width: 100%; max-width: 900px; }

  /* LOGO FIX DETAIL */
  .detail-logo {
    height: 110px;
    max-width: 400px;
    width: auto;
    object-fit: contain;
    object-position: left center;
    margin-bottom: 20px;
    display: none;
  }

  .detail-title-img { font-size: 52px; font-weight: 900; margin: 0 0 10px; text-transform: uppercase; line-height: 1.1; text-shadow: 0 4px 20px rgba(0,0,0,0.9); }
  .detail-meta { display: flex; gap: 12px; color: var(--muted); font-size: 13px; font-weight: 600; margin-bottom: 20px; align-items: center; flex-wrap: wrap; }
  .detail-meta .rating { background: rgba(255,255,255,0.15); padding: 4px 10px; border-radius: 6px; color: #fff; display: flex; align-items: center; gap: 4px; }
  .detail-meta .rating-star { color: #ffd23f; }
  .detail-overview { color: #ccc; font-size: 15px; margin-bottom: 24px; line-height: 1.6; text-shadow: 0 2px 4px rgba(0,0,0,0.8); }

  /* Player Area */
  .detail-player { display: none; padding: 30px 4%; margin-top: -80px; position: relative; z-index: 10; }
  .detail-player.active { display: block; }

  /* Server Selector */
  .server-tabs { display: flex; gap: 10px; margin-bottom: 16px; background: #141416; padding: 6px; border-radius: 8px; width: fit-content; border: 1px solid var(--line); }
  .server-btn { background: transparent; border: none; color: var(--muted); padding: 8px 16px; border-radius: 6px; cursor: pointer; font-weight: 600; font-size: 13px; transition: all 0.2s; }
  .server-btn:hover { color: #fff; }
  .server-btn.active { background: var(--accent); color: #fff; }

  .iframe-container { position: relative; width: 100%; aspect-ratio: 16/9; background: #000; border-radius: 12px; overflow: hidden; box-shadow: 0 20px 50px rgba(0,0,0,0.8); }
  .iframe-container iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

  /* Loading Spinner */
  .iframe-loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: #000; z-index: 2; pointer-events: none; transition: opacity 0.3s; }
  .spinner { width: 40px; height: 40px; border: 3px solid rgba(255,255,255,0.1); border-top-color: var(--accent); border-radius: 50%; animation: spin 1s linear infinite; }
  @keyframes spin { to { transform: rotate(360deg); } }

  /* Seasons & Episodes */
  .detail-seasons { padding: 0 4% 20px; display: flex; gap: 10px; overflow-x: auto; }
  .detail-seasons::-webkit-scrollbar { display: none; }
  .season-tab { background: var(--card); border: 1px solid var(--line); color: var(--muted); padding: 8px 20px; border-radius: 24px; cursor: pointer; font-weight: 600; font-size: 14px; transition: all 0.2s; }
  .season-tab:hover { background: var(--card-hover); }
  .season-tab.active { background: var(--accent); color: #fff; border-color: var(--accent); }

  /* RREGULLIMI I EPISODEVE */
  .episode-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; padding: 0 4% 30px; }
  .episode-card { background: var(--card); border-radius: 8px; overflow: hidden; cursor: pointer; border: 1px solid transparent; transition: border 0.2s; }
  .episode-card:hover { border-color: var(--accent); }
  .episode-img { width: 100%; aspect-ratio: 16/9; background: #222 center/cover no-repeat; position: relative; }
  .episode-info { padding: 12px; }
  .episode-info h3 { margin: 0 0 6px; font-size: 14px; color: var(--text); }
  .episode-info p { margin: 0; font-size: 12px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

  /* RREGULLIMI I CAST */
  .cast-section { padding: 20px 4%; }
  .cast-scroll { display: flex; gap: 24px; overflow-x: auto; scrollbar-width: none; padding-bottom: 10px; align-items: flex-start; }
  .cast-scroll::-webkit-scrollbar { display: none; }
  .cast-scroll .cast-card { flex: 0 0 100px !important; width: 100px !important; min-width: 100px !important; max-width: 100px !important; text-align: center; }
  .cast-img { width: 100px; height: 100px; border-radius: 50%; background: #222 center/cover no-repeat; margin-bottom: 12px; border: 2px solid var(--line); }
  .cast-name { font-size: 13px; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .cast-role { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

  /* Details Grid */
  .details-grid-section { padding: 20px 4% 60px; }
  .details-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 30px; }
  .detail-item h4 { margin: 0 0 8px; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; font-weight: 700; }
  .detail-item p { margin: 0; font-size: 14px; color: #e0e0e0; font-weight: 500; line-height: 1.5; }

  /* Search & Settings */
  #search-view { display: none; position: fixed; inset: 0; z-index: 100; background: var(--bg); overflow-y: auto; padding-bottom: 80px; margin-left: calc(var(--sidebar-w) + 40px); }
  .search-header { position: sticky; top: 0; background: var(--bg); z-index: 10; padding: 16px 4%; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid var(--line); }
  .search-back-btn { background: transparent; border: none; color: var(--text); cursor: pointer; padding: 8px; display: flex; align-items: center; justify-content: center; }
  #main-search-input { flex: 1; background: var(--card); border: 1px solid var(--line); color: var(--text); padding: 14px 20px; border-radius: 12px; font-size: 16px; outline: none; }
  .search-results-grid { display: grid; gap: 20px 16px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); padding: 20px 4%; }

  #settings-view { display: none; padding: 40px 4%; max-width: 800px; margin: 0 auto; width: 100%; }
  .settings-group { background: var(--card); border-radius: 12px; margin-bottom: 20px; overflow: hidden; border: 1px solid var(--line); }
  .settings-row { display: flex; justify-content: space-between; align-items: center; padding: 20px; border-bottom: 1px solid var(--line); }
  .settings-row:last-child { border-bottom: none; }
  .switch { position: relative; display: inline-block; width: 50px; height: 28px; }
  .switch input { opacity: 0; width: 0; height: 0; }
  .slider { position: absolute; cursor: pointer; inset: 0; background: #444; border-radius: 28px; transition: .4s; }
  .slider:before { position: absolute; content: ""; height: 20px; width: 20px; left: 4px; bottom: 4px; background: #fff; border-radius: 50%; transition: .4s; }
  input:checked + .slider { background: var(--accent); }
  input:checked + .slider:before { transform: translateX(22px); }
  .btn-danger { background: rgba(229, 9, 20, 0.1); color: var(--accent); border: 1px solid var(--accent); padding: 8px 16px; border-radius: 6px; cursor: pointer; font-weight: 600; }
  .ads-banner { color: #f7f7f7; background: rgba(229, 9, 20, 0.12); border: 1px solid rgba(229, 9, 20, 0.3); border-radius: 10px; padding: 12px 16px; }

  /* ============================================================
     MOBILE RESPONSIVE
     ============================================================ */
  @media (max-width: 768px) {
    :root { --sidebar-w: 0px; }
    .sidebar { display: none !important; }
    .main-content { margin-left: 0; padding-bottom: 70px; padding-top: 10px; }
    #search-view { margin-left: 0; padding-bottom: 70px; }

    .top-tabs { padding-left: 4%; gap: 16px; }
    .tab-btn { font-size: 14px; }

    #hero-banner { height: 70vh; padding-bottom: 40px; }

    /* LOGO FIX MOBILE */
    .hero-logo {
        height: 60px;
        max-width: 220px;
    }

    .hero-title-img { font-size: 32px; }
    .hero-overview { -webkit-line-clamp: 4; font-size: 14px; }
    .hero-actions { width: 100%; }
    .hero-btn-details { flex: 1; justify-content: center; }

    /* RREGULLIMI I KARTELAVE NE TELEFON */
    .row-scroll .card {
      flex: 0 0 130px !important;
      width: 130px !important;
      min-width: 130px !important;
      max-width: 130px !important;
    }

    .card-title { font-size: 13px; }

    .detail-hero { min-height: 70vh; padding-top: 60px; }

    /* LOGO FIX MOBILE DETAIL */
    .detail-logo {
        height: 70px;
        max-width: 250px;
    }

    .detail-title-img { font-size: 32px; }
    .detail-player { margin-top: -20px; padding: 16px; }
    .server-tabs { width: 100%; justify-content: center; flex-wrap: wrap; }

    .episode-list { display: flex; flex-direction: row; overflow-x: auto; gap: 16px; padding: 0 4% 20px; scrollbar-width: none; }
    .episode-list::-webkit-scrollbar { display: none; }
    .episode-card { flex: 0 0 220px; }

    .mobile-nav { display: flex !important; position: fixed; bottom: 0; left: 0; right: 0; z-index: 100; background: rgba(11,11,13,0.95); backdrop-filter: blur(10px); border-top: 1px solid var(--line); padding: 10px 0 14px; justify-content: space-around; }
    .mobile-nav-item { display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--muted); font-size: 10px; cursor: pointer; text-decoration: none; background: transparent; border: 0; padding: 0; }
    .mobile-nav-item svg { width: 24px; height: 24px; fill: currentColor; }
    .mobile-nav-item.active { color: var(--text); }
  }

  @media (min-width: 769px) {
    .mobile-nav { display: none !important; }
  }

  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: 0.01ms !important; }
  }
