/* ============================================================
   PsyPlay — YouTube-Style Front Page Overrides
   ============================================================ */

/* ── Variables ─────────────────────────────────────────────── */
:root {
  --yt-bg:           #0f0f0f;
  --yt-surface:      #181818;
  --yt-border:       #272727;
  --yt-text:         #f1f1f1;
  --yt-text-muted:   #aaaaaa;
  --yt-red:          #ff0000;
  --yt-red-hover:    #cc0000;
  --yt-chip-bg:      #272727;
  --yt-chip-active:  #f1f1f1;
  --yt-chip-text:    #f1f1f1;
  --yt-chip-active-text: #0f0f0f;
  --yt-header-h:     56px;
  --yt-filter-h:     48px;
  --yt-total-h:      calc(var(--yt-header-h) + var(--yt-filter-h));
  --yt-radius:       10px;
}

/* ── Base Reset for YouTube feel ───────────────────────────── */
body {
  background: var(--yt-bg) !important;
  color: var(--yt-text) !important;
  font-family: 'Roboto', 'Arial', sans-serif !important;
}

a { color: var(--yt-text); }
a:hover { color: var(--yt-text); }

/* ── Hide old header ────────────────────────────────────────── */
header:not(#yt-header) {
  display: none !important;
}
.header-pad {
  display: none !important;
}

/* ════════════════════════════════════════════════════════════
   NEW HEADER  #yt-header
   ════════════════════════════════════════════════════════════ */
#yt-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  background: var(--yt-bg);
  border-bottom: 1px solid var(--yt-border);
}

/* ── Top row ────────────────────────────────────────────────── */
.yt-header-inner {
  display: flex;
  align-items: center;
  height: var(--yt-header-h);
  padding: 0 16px;
  gap: 8px;
}

/* LEFT */
.yt-header-left {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.yt-menu-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
}
.yt-menu-btn:hover { background: rgba(255,255,255,0.1); }
.yt-menu-btn span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--yt-text);
  border-radius: 1px;
}

.yt-logo {
  display: flex;
  align-items: center;
  text-decoration: none !important;
  margin-left: 8px;
  white-space: nowrap;
  font-size: 20px;
  font-weight: 900;
  letter-spacing: -0.5px;
  line-height: 1;
}
.yt-logo-psy  { color: var(--yt-red); }
.yt-logo-play { color: var(--yt-text); margin-left: 1px; }

/* CENTER */
.yt-header-center {
  flex: 1;
  max-width: 620px;
  margin: 0 auto;
}

.yt-search-box {
  display: flex;
  align-items: stretch;
  border: 1px solid #303030;
  border-radius: 40px;
  overflow: hidden;
  background: var(--yt-surface);
  height: 40px;
}
.yt-search-box:focus-within {
  border-color: #1c62b9;
}

.yt-search-input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--yt-text);
  padding: 0 16px;
  font-size: 16px;
  outline: none;
}
.yt-search-input::placeholder { color: var(--yt-text-muted); }

.yt-search-btn {
  background: #222;
  border: none;
  border-left: 1px solid #303030;
  color: var(--yt-text);
  padding: 0 20px;
  cursor: pointer;
  font-size: 15px;
  display: flex;
  align-items: center;
}
.yt-search-btn:hover { background: #303030; }

/* RIGHT */
.yt-header-right {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.yt-icon-btn {
  background: none;
  border: none;
  color: var(--yt-text);
  cursor: pointer;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  position: relative;
  text-decoration: none;
}
.yt-icon-btn:hover { background: rgba(255,255,255,0.1); color: var(--yt-text); }

.yt-notif-badge {
  position: absolute;
  top: 4px;
  right: 2px;
  background: var(--yt-red);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  border-radius: 10px;
  padding: 1px 4px;
  min-width: 16px;
  text-align: center;
  line-height: 14px;
}

.yt-user-menu { position: relative; }
.yt-avatar-btn { display: block; cursor: pointer; }
.yt-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.yt-dropdown-menu {
  position: absolute !important;
  right: 0 !important;
  top: 44px !important;
  left: auto !important;
  min-width: 180px;
  background: #282828 !important;
  border: 1px solid #3d3d3d !important;
  border-radius: 12px !important;
  padding: 8px 0 !important;
  box-shadow: 0 4px 16px rgba(0,0,0,0.5) !important;
  z-index: 300;
}
.yt-dropdown-menu > li > a {
  padding: 10px 16px !important;
  color: var(--yt-text) !important;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.yt-dropdown-menu > li > a:hover {
  background: rgba(255,255,255,0.1) !important;
}

.yt-signin-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #3ea6ff;
  border-radius: 20px;
  color: #3ea6ff !important;
  padding: 6px 14px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none !important;
  white-space: nowrap;
  background: transparent;
}
.yt-signin-btn:hover {
  background: rgba(62,166,255,0.1) !important;
  color: #3ea6ff !important;
}

.yt-mobile-search-toggle { display: none; }

/* ── Filter / Chip bar ──────────────────────────────────────── */
.yt-filter-bar {
  background: var(--yt-bg);
  border-bottom: 1px solid var(--yt-border);
  height: var(--yt-filter-h);
  overflow: hidden;
}

.yt-filter-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  overflow-x: auto;
  scrollbar-width: none;
  height: 100%;
}
.yt-filter-inner::-webkit-scrollbar { display: none; }

.yt-chip {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  background: var(--yt-chip-bg);
  color: var(--yt-chip-text);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none !important;
  flex-shrink: 0;
  transition: background 0.15s;
  cursor: pointer;
}
.yt-chip:hover {
  background: #3f3f3f;
  color: var(--yt-chip-text) !important;
}
.yt-chip-active {
  background: var(--yt-chip-active) !important;
  color: var(--yt-chip-active-text) !important;
}

/* ── Spacer so content doesn't hide under fixed header ──────── */
.yt-header-spacer {
  height: var(--yt-total-h);
}

/* ════════════════════════════════════════════════════════════
   CONTENT AREA — YouTube grid card style
   ════════════════════════════════════════════════════════════ */

/* Container */
#contenedor, .container {
  background: transparent !important;
}

/* Module sections */
.module .content header,
.module .content header h1,
.module .content header h2 {
  color: var(--yt-text) !important;
}
.module .content {
  border-color: var(--yt-border) !important;
}
.module .content .items {
  border-color: var(--yt-border) !important;
}

/* Item cards */
.module .content .items .item {
  padding: 6px !important;
}
.module .content .items .item .poster {
  border-radius: 8px;
  overflow: hidden;
}
.module .content .items .item .data h3 {
  color: var(--yt-text) !important;
  font-size: 14px !important;
  font-weight: 500 !important;
}
.module .content .items .item .data span {
  color: var(--yt-text-muted) !important;
  font-size: 12px !important;
}
.module .content .items .item .poster .rating {
  background: rgba(0,0,0,0.8) !important;
  color: #fff !important;
}

/* Section headers */
.module .content header {
  background: transparent !important;
  border-bottom: 1px solid var(--yt-border) !important;
  padding: 8px 10px !important;
}
a.see-all, a.see_all {
  background: transparent !important;
  border: 1px solid #3f3f3f !important;
  color: #3ea6ff !important;
}

/* Sidebar */
.module .sidebar {
  background: transparent !important;
  border-left: 1px solid var(--yt-border) !important;
}
.sidemenu h2 {
  color: var(--yt-text) !important;
}
.sidemenu ul.genres li {
  border-color: var(--yt-border) !important;
}
.sidemenu ul.genres li a {
  color: var(--yt-text-muted) !important;
}
.sidemenu ul.genres li a:hover {
  color: var(--yt-text) !important;
}

/* Slider section */
.slider article.item .image {
  border-radius: 8px;
  overflow: hidden;
}
.slider article.item .image .data {
  background: linear-gradient(to top, rgba(0,0,0,0.85), transparent) !important;
}

/* Footer */
footer {
  background: var(--yt-surface) !important;
  border-top: 1px solid var(--yt-border) !important;
}
footer.main .fbox .fmenu ul li {
  border-color: var(--yt-border) !important;
}
footer.main .fbox .fmenu ul li a,
footer.main .fbox .copy {
  color: var(--yt-text-muted) !important;
}

/* Search results */
.search-suggest {
  background: #282828 !important;
  border: 1px solid #3d3d3d !important;
  border-radius: 12px !important;
}
.search-suggest ul li {
  border-color: var(--yt-border) !important;
}
.search-suggest ul li .ss-info a.ss-title {
  color: var(--yt-text) !important;
}

/* Buttons */
.btn-successful {
  background: var(--yt-red) !important;
  border-color: var(--yt-red) !important;
  color: #fff !important;
  border-radius: 20px !important;
}
.btn-successful:hover {
  background: var(--yt-red-hover) !important;
}

/* Pagination */
.pagination a, .pagination span {
  background: var(--yt-chip-bg) !important;
  border-color: var(--yt-border) !important;
  color: var(--yt-text) !important;
  border-radius: 20px !important;
}
.pagination a:hover {
  background: #3f3f3f !important;
}

/* Single post */
.sheader, .sbox {
  background: var(--yt-surface) !important;
}
.sbox h1, .sbox h2, .sheader .data h1 {
  color: var(--yt-text) !important;
}
.extra span { color: var(--yt-text-muted) !important; }

/* Live search results */
.live-search ul {
  background: #282828 !important;
  border: 1px solid #3d3d3d !important;
  border-radius: 12px !important;
  overflow: hidden;
}
.live-search ul li {
  border-color: var(--yt-border) !important;
}
.live-search ul li:hover { background: rgba(255,255,255,0.08) !important; }
.live-search ul li .title { color: var(--yt-text) !important; }
.live-search ul li .other-name { color: var(--yt-text-muted) !important; }

/* ── Mobile responsive ──────────────────────────────────────── */
@media (max-width: 768px) {
  .yt-header-center { display: none; }
  .yt-mobile-search-toggle { display: flex; }

  .yt-header-inner { padding: 0 8px; }

  .yt-filter-inner { padding: 6px 8px; gap: 6px; }
  .yt-chip { padding: 5px 10px; font-size: 13px; }

  .module .content .items .item { width: 50% !important; }
}

@media (max-width: 480px) {
  .module .content .items .item { width: 50% !important; }
  .yt-signin-btn span { display: none; }
}

/* ── Night Mode compatibility ────────────────────────────────── */
.sm-icon, .sm-text { color: var(--yt-text) !important; }
#switch-mode { 
  background: var(--yt-surface) !important;
  border: 1px solid var(--yt-border) !important;
}

/* ── Scrollbar styling ──────────────────────────────────────── */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--yt-bg); }
::-webkit-scrollbar-thumb { background: #3f3f3f; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #555; }

/* ── Quality badges ─────────────────────────────────────────── */
span.quality, .mepo span.quality {
  background: rgba(0,0,0,0.85) !important;
  color: #fff !important;
  font-weight: 700 !important;
  border-radius: 3px !important;
}

/* ── Rating badge ───────────────────────────────────────────── */
.module .content .items .item .poster .rating {
  background: rgba(0,0,0,0.85) !important;
  border-radius: 4px !important;
  font-size: 12px !important;
  font-weight: 600 !important;
}

/* ── Item hover overlay ─────────────────────────────────────── */
.module .content .items .item .poster:hover > img {
  -webkit-filter: brightness(0.7) !important;
  filter: brightness(0.7) !important;
}

/* ── Top header nav adjustment ──────────────────────────────── */
header.main { display: none !important; }
