/* ══════════════════════════════════════════
   My Favourite Songs - Stylesheet
══════════════════════════════════════════ */

* { margin: 0; padding: 0; box-sizing: border-box; }

/* ── HERO ── */
.hero {
  text-align: center; 
  padding: 60px 20px 40px;
  background: linear-gradient(135deg, #0f0f12 0%, #20212a 30%, #20212a 85%, #3e4152 100%);
  position: relative; 
  overflow: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  
}

/* Dark overlay for better text readability */
.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(49, 52, 69, 0.8);
  z-index: 1;
  
}

.intro{
	color: var(--primary);
    font-size: 1.6rem;
    font-weight: 700;
	padding-bottom: 2rem;
	
}

/* ── LYRICS MARQUEE ── */
.lyrics-marquee-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: none;
  overflow: hidden;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  mix-blend-mode: overlay;
}

.lyrics-marquee-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(25, 27, 45, .7);
  z-index: 1;

}

.lyrics-row {
  font-family: "Noto Serif HK";
  position: absolute;
  width: 100%;
  white-space: nowrap;
  display: flex;
  font-weight: 600;
  letter-spacing: 0.08em;
  opacity: 0.8;
  color: #fff;
  mix-blend-mode: difference;
}

.lyrics-content {
  display: inline-block;
  padding-right: 100px;
  animation: marquee-rtl linear infinite;
  
}

/* Different positions and sizes for each row */
.lyrics-row-1 {
  top: -1%;
  font-size: 25vh;
  animation-duration: 90s;
  filter: blur(3px);
  
}
.lyrics-row-1 .lyrics-content {
  animation-duration: 90s;
  
}

.lyrics-row-2 {
  top: 30%;
  font-size: 12vh;
  animation-duration: 70s;
  filter: blur(2px);
  font-weight: 400;
}
.lyrics-row-2 .lyrics-content {
  animation-duration: 70s;
}

.lyrics-row-3 {
  top: 35%;
  font-size: 32vh;
  animation-duration: 80s;
  filter: blur(2px);
}
.lyrics-row-3 .lyrics-content {
  animation-duration: 80s;
}

.lyrics-row-4 {
  top: 70%;
  font-size: 8vh;
  animation-duration: 60s;
  filter: blur(2px);
  font-weight: 400;
}
.lyrics-row-4 .lyrics-content {
  animation-duration: 60s;
}

.lyrics-row-5 {
  top: 75%;
  font-size: 20vh;
  animation-duration: 100s;
  filter: blur(2px);
  font-weight: 400;
}
.lyrics-row-5 .lyrics-content {
  animation-duration: 100s;
}

/* Marquee animation from right to left */
@keyframes marquee-rtl {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

/* Hero Content */
.hero-content {
  position: relative;
  z-index: 3;
  
}

.hero h1 {
	
  font-size: 3.5rem;
  font-weight: 600;
  color: #fff;
  position:relative; z-index:3;
  
}
.hero p { margin-top:12px; color:#94a3b8; font-size:1rem; position:relative; z-index:3; }

.music-bars {
  display:flex; justify-content:center; align-items:flex-end;
  gap:4px; margin:20px auto 0; height:30px; position:relative; z-index:3;
}
.bar { width:5px; background:linear-gradient(to top,#fff,#fff); border-radius:3px; animation:bars 1.2s ease-in-out infinite; }
.bar:nth-child(1){animation-delay:0s;height:10px} .bar:nth-child(2){animation-delay:.2s;height:20px}
.bar:nth-child(3){animation-delay:.4s;height:15px} .bar:nth-child(4){animation-delay:.6s;height:25px}
.bar:nth-child(5){animation-delay:.8s;height:10px} .bar:nth-child(6){animation-delay:1s;height:18px}
.bar:nth-child(7){animation-delay:.3s;height:22px}
@keyframes bars { 0%,100%{transform:scaleY(0.4)} 50%{transform:scaleY(1.5)} }

/* ── SCROLL REMINDER ── */
.scroll-reminder {
  position: absolute;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-size: 0.9rem;
  animation: bounce 2s ease-in-out infinite;
  z-index: 10;
}

.scroll-reminder i {
  font-size: 1.5rem;
  color: #fff;
}

@keyframes bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(-10px); }
}

/* ── TABS ── */
.tabs-wrapper {
  display:flex; justify-content:center; flex-wrap:wrap; gap:10px;
  padding:20px; 
  	padding-top:55px;
  border-bottom:1px solid rgba(255,255,255,0.00);
}
.tab-btn {
  padding:10px 22px; border:none; border-radius:50px; cursor:pointer;
  font-family:'Noto Sans HK',sans-serif; font-size:.85rem; font-weight:600;
  transition:all .3s; background:rgba(255,255,255,0.07); color:#aaaaaa;
  border:1px solid rgba(255,255,255,0.1);
}
.tab-btn:hover { background: #cccccc; color:#fff; transform:translateY(-2px); }
.tab-btn.active {
  background: var(--secondary); color:#fff;
  box-shadow:0 4px 15px rgba(0,0,0,0.1); border-color:transparent;
}
.tab-btn.multi-selected {
  background: var(--secondary); color:#fff;
  box-shadow:0 4px 15px rgba(0,0,0,0.1); border-color:transparent;
  position: relative;
}
.tab-btn.multi-selected::after {
  content: '✓';
  position: absolute;
  top: -5px;
  right: -5px;
  background: #ccc;
  color: #fff;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  font-size: 0.7rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

/* ── CONTENT ── */
.content { max-width:1200px; margin:0 auto; padding:40px 20px 80px; }
.category { display:none; }
.category.active { display:block; }
.category.has-sticky-player { padding-top: 120px; }

/* ── CATEGORY HEADER ── */
.category-header {
  margin-bottom:20px; padding-bottom:15px;
  border-bottom:1px solid rgba(255,255,255,0.08);
  display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:12px;
}
.category-header-left h2 { color: var(--primary); font-size:1.6rem; font-weight:700; display:flex; align-items:center; gap:10px; }
.category-header-left p { color: var(--dark); font-size:.85rem; margin-top:5px; }

/* ── HEADER BUTTONS GROUP ── */
.header-btns { display:flex; gap:10px; flex-wrap:wrap; align-items:center; }

/* ── PLAY ALL BTN ── */
.play-all-btn {
  display:flex; align-items:center; gap:8px; padding:10px 22px;
  background:var(--primary);
  border:none; border-radius:50px; color:#fff;
  font-family:'Lato',sans-serif; font-size:.85rem; font-weight:500;
  cursor:pointer; transition:all .3s; box-shadow:0 4px 15px rgba(0,0,0,0);
  white-space:nowrap;
}
.play-all-btn:hover { transform:translateY(-2px); box-shadow:0 4px 15px rgba(0,0,0,0.1); }
.play-all-btn.stop-mode { background:#cc4e47; }

/* ── SHUFFLE BTN ── */
.shuffle-btn {
  display:flex; align-items:center; gap:8px; padding:10px 22px;
  background:rgba(255,255,255,0.07);
  border:1px solid #aaaaaa; border-radius:50px; color:#aaaaaa;
  font-family:'Lato',sans-serif; font-size:.85rem; font-weight:500;
  cursor:pointer; transition:all .3s;
  white-space:nowrap;
}
.shuffle-btn:hover { background:#cccccc; color:#fff; transform:translateY(-2px); border:1px solid #cccccc;}
.shuffle-btn.shuffle-on {
  background:linear-gradient(135deg,rgba(16,185,129,0.3),rgba(5,150,105,0.3));
  border-color:rgba(16,185,129,0.5); color:#10b981;
  box-shadow:0 4px 15px rgba(16,185,129,0.2);
  display:none;
}
/* spinning icon when shuffle active */
.shuffle-btn.shuffle-on .shuffle-icon { animation:shuffleSpin .5s ease; }
@keyframes shuffleSpin {
  0%   { transform:rotate(0deg)   scale(1);   }
  50%  { transform:rotate(180deg) scale(1.3); }
  100% { transform:rotate(360deg) scale(1);   }
}

/* ── RESET BTN ── */
.reset-btn {
  display:none; align-items:center; gap:6px; padding:10px 22px;
  background:rgba(255,255,255,0.05);
  border:1px solid #aaaaaa; border-radius:50px; color:#aaaaaa;
  font-family:'Lato',sans-serif; font-size:.82rem; font-weight:500;
  cursor:pointer; transition:all .3s;
  white-space:nowrap;
}
.reset-btn:hover { background:#cccccc; color:#fff; transform:translateY(-2px); border:1px solid #cccccc; }
.reset-btn.visible { display:flex; }

/* ── SHUFFLE TOAST ── */
.shuffle-toast {
  position:fixed; bottom:30px; left:50%; transform:translateX(-50%) translateY(80px);
  background:linear-gradient(135deg,#10b981,#059669);
  color:#fff; padding:12px 24px; border-radius:50px;
  font-size:.85rem; font-weight:600;
  box-shadow:0 8px 30px rgba(16,185,129,0.4);
  z-index:9999; transition:transform .4s cubic-bezier(0.34,1.56,0.64,1), opacity .4s;
  opacity:0; pointer-events:none;
  display:flex; align-items:center; gap:8px;
}
.shuffle-toast.show {
  transform:translateX(-50%) translateY(0);
  opacity:1;
}

/* card fly-in animation after shuffle */
@keyframes cardFlyIn {
  from { opacity:0; transform:translateY(20px) scale(0.95); }
  to   { opacity:1; transform:translateY(0)    scale(1);    }
}
.card-fly { animation:cardFlyIn .4s ease forwards; }

/* ── NOW PLAYING BAR ── */
.now-playing-bar {
  display:none; align-items:center; gap:14px;
  background:linear-gradient(135deg,rgba(99,102,241,.15),rgba(236,72,153,.15));
  border:1px solid rgba(99,102,241,.3); border-radius:14px;
  padding:14px 18px; margin-bottom:24px; flex-wrap:wrap;
  transition: all 0.3s ease;
}
.now-playing-bar.visible { display:flex; }
.now-playing-bar.sticky {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 99;
  margin: 0;
  border-radius: 0;
  border-left: none;
  border-right: none;
  border-bottom: none;
  background: #1e1e2e;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.5);
  animation: slideUp 0.3s ease;
}
@keyframes slideUp {
  from { transform: translateY(100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.np-info { flex:1; min-width:100px; }
.np-song-line { 
  display: flex; 
  align-items: center; 
  gap: 8px; 
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.np-title { font-size:.95rem; font-weight:600; color:#e2e8f0; }
.np-separator { font-size:.95rem; color:var(--primary); }
.np-artist { font-size:.95rem; color:#fff; font-weight:300; }

/* ── PROGRESS BAR ── */
.np-progress-wrap { width:100%; margin-top:8px; display:flex; align-items:center; gap:8px; }
.np-time-cur  { font-size:.7rem; color:var(--primary); font-weight:600; min-width:36px; }
.np-time-total{ font-size:.7rem; color:var(--primary); min-width:36px; text-align:right; }
.np-progress-bg {
  flex:1; height:4px; background:rgba(255,255,255,0.1);
  border-radius:4px; overflow:hidden; cursor:pointer; position:relative;
  transition: height 0.2s ease;
}
.np-progress-bg:hover {
  height: 6px;
}
.np-progress-fill {
  height:100%; width:0%;
  background:linear-gradient(90deg,var(--primary),#6a7dd4);
  border-radius:4px; transition:width .5s linear;
}

.player-controls { display:flex; align-items:center; gap:10px; }
.ctrl-btn {
  background:rgba(255,255,255,.1); border:none; border-radius:50%;
  width:36px; height:36px; display:flex; align-items:center; justify-content:center;
  color:#fff; cursor:pointer; font-size:.9rem; transition:all .2s;
}
.ctrl-btn:hover { background:rgba(255,255,255,.2); transform:scale(1.1); }
.ctrl-btn.play-pause-ctrl {
  width:44px; height:44px; font-size:1.1rem;
  background:#e2382e;
}
.np-counter { font-size:.75rem; color:#475569; white-space:nowrap; }
.np-dots { display:flex; gap:5px; align-items:center; flex-wrap:wrap; }
.np-dot {
  width:8px; height:8px; border-radius:50%;
  background:rgba(255,255,255,.15); cursor:pointer; transition:all .3s;
}
.np-dot.active { background:linear-gradient(135deg,#6366f1,#ec4899); transform:scale(1.3); box-shadow:0 0 8px rgba(99,102,241,.6); }
.np-dot.played { background:rgba(99,102,241,.4); }

/* ── VIDEO GRID ── */
.video-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(300px,1fr)); gap:24px; }

/* ── VIDEO CARD ── */
.video-card {
  background:#f8f8f8; border-radius:16px; overflow:hidden;
  transition:transform .3s, box-shadow .3s, border-color .3s;
  border:1px solid rgba(255,255,255,.06); position:relative;
}
.video-card:hover { transform:translateY(-6px); box-shadow:0 10px 20px rgba(0,0,0,.2);  }
.video-card.now-playing-card {
  border:2px solid #e2382e;
  box-shadow:0 0 0 2px #e2382e,0 20px 40px rgba(0,0,0,.3) !important;
}
.track-badge {
  position:absolute; top:10px; left:10px; background:rgba(0,0,0,.7);
  color:#a78bfa; font-size:.7rem; font-weight:700; padding:3px 8px;
  border-radius:20px; z-index:2; backdrop-filter:blur(4px);
}
.now-playing-badge {
  display:none; position:absolute; top:10px; right:10px;
  background:#e2382e; color:#fff;
  font-size:.65rem; font-weight:500; padding:3px 10px;
  border-radius:20px; z-index:100; letter-spacing:.5px;
  animation:glow 1.5s ease-in-out infinite alternate;
}
@keyframes glow { from{box-shadow:0 0 5px rgba(99,102,241,0)} to{box-shadow:0 0 15px rgba(236,72,153,.0)} }
.video-card.now-playing-card .now-playing-badge { display:block; }

/* ── THUMBNAIL ── */
.video-thumbnail { position:relative; padding-top:56.25%; overflow:hidden; background:#000; cursor:pointer; }
.thumb-layer {
  position:absolute; top:0; left:0; width:100%; height:100%;
  display:flex; align-items:center; justify-content:center;
}
.thumb-layer img {
  position:absolute; top:0; left:0; width:100%; height:100%; object-fit:cover;
  transition:transform .4s, filter .4s;
}
.video-card:hover .thumb-layer img { transform:scale(1.15); filter:brightness(0.65); }
.thumb-play {
  position:relative; z-index:2; width:60px; height:60px; border-radius:50%;
  background:#e2382e; display:flex; align-items:center; justify-content:center;
  transition:transform .3s, background .3s; box-shadow:0 4px 20px rgba(0,0,0,.5);
}
.thumb-play i { color:#fff; font-size:1.4rem; margin-left:4px; }
.video-card:hover .thumb-play { transform:scale(1.3); background:#e2382e; }

/* iOS Play Overlay (Lazy Load) */
.ios-play-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
  cursor: pointer;
  transition: background 0.3s;
}
.ios-play-overlay:hover {
  background: rgba(0, 0, 0, 0.6);
}
.ios-play-button {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(255, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 30px rgba(255, 0, 0, 0.4);
  transition: transform 0.3s, background 0.3s;
}
.ios-play-overlay:hover .ios-play-button {
  transform: scale(1.1);
  background: rgb(255, 0, 0);
  box-shadow: 0 8px 40px rgba(255, 0, 0, 0.6);
}
.ios-play-button i {
  color: #fff;
  font-size: 2rem;
  margin-left: 6px;
}

.iframe-layer { display:none; position:absolute; top:0; left:0; width:100%; height:100%; }
.iframe-layer iframe { width:100%; height:100%; border:none; }
.iframe-layer.active { display:block; }
.video-error {
  display:none; position:absolute; top:0; left:0; width:100%; height:100%;
  background:#0f0f1a; flex-direction:column; align-items:center;
  justify-content:center; gap:10px; padding:20px; text-align:center;
}
.video-error.show { display:flex; }
.video-error i { font-size:2rem; color:#ef4444; }
.video-error p { font-size:.8rem; color:#94a3b8; }
.open-yt-btn {
  display:flex; align-items:center; gap:6px; padding:8px 16px;
  background:#ff0000; border:none; border-radius:20px; color:#fff;
  font-family:'Lato',sans-serif; font-size:.8rem; font-weight:600;
  cursor:pointer; text-decoration:none; transition:background .2s;
}
.open-yt-btn:hover { background:#cc0000; }

/* ── CARD INFO ── */
.video-info { padding:16px; }
.video-info h3 {
  font-size:1.1rem; font-weight:400; color: var(--dark); margin-bottom:6px; line-height:1.4;
  display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden;
}
.video-info .artist { font-size:.9rem; color:var(--dark); margin-bottom:10px; }
.video-info .artist i { margin-right:6px; color:var(--primary); }
.video-meta { display:flex; align-items:center; justify-content:space-between; }
.genre-tag { font-size:.8rem; padding:3px 12px; border-radius:20px; font-weight:400; letter-spacing:.5px; }
.tag-newest   { background:var(--secondary); color:#fff; }
.tag-kpop     { background:rgba(236,72,153,.15); color:#ec4899; }
.tag-japanese { background:rgba(239,68,68,.15);  color:#ef4444; }
.tag-english  { background:rgba(59,130,246,.15); color:#3b82f6; }
.tag-chinese  { background:rgba(34,197,94,.15);  color:#22c55e; }
.duration-badge {
  display:inline-flex; align-items:center; gap:4px;
  font-size:.9rem; color:var(--dark); margin-left:6px; padding-bottom:4px;
}
.duration-badge i { font-size:.9rem; color:var(--primary); }
.song-tags { display:flex; gap:10px; flex-wrap:wrap; flex:1; }
.card-actions { display:flex; align-items:center; gap:8px; }
.play-this-btn {
  background:none; border:none; cursor:pointer; font-size:1.1rem;
  transition:transform .2s; padding:0; color:#6366f1;
}
.play-this-btn:hover { transform:scale(1.3); }
.personal-note {
  margin-top:10px; padding:8px 12px 8px 8px; background:rgba(255,255,255,1);
  border-left:4px solid var(--primary); border-radius:0 8px 8px 0;
  font-size:.78rem; color:var(--dark); font-style:normal; font-weight:300;
}

.footer {
    background: #4e546d;
    color: white;
    text-align: center;
    padding: 2rem;
}

/* ── STICKY PLAYER CONTAINER ── */
#sticky-player-container {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 999;
}

/* Ensure the player inside sticky container is visible and uses flex */
#sticky-player-container .now-playing-bar {
  display: flex !important;
  position: relative;
  bottom: auto;
  left: auto;
  right: auto;
  margin: 0;
  border-radius: 0;
  border-left: none;
  border-right: none;
  border-bottom: none;
  background: #232826;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.5);
}

/* ── BACK TO TOP BUTTON ── */
.back-to-top {
  position: fixed;
  bottom: 120px;
  right: 30px;
  width: 50px;
  height: 50px;
  background: var(--primary);
  border: none;
  border-radius: 50%;
  color: #fff;
  font-size: 1.2rem;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  opacity: 0;
  visibility: hidden;
  z-index: 998;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  transform: translateY(-5px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.back-to-top:active {
  transform: translateY(-2px);
}

.content-section {
    padding: 6rem 0rem 0rem 0rem;  
    background: white;
}

.content-text {
    font-size: clamp(1rem, 2vw, 1.15rem);
    line-height: 2;
    color: var(--dark);
    margin-bottom: 2rem;
	text-align: justify;
	border-bottom: 1px solid #ccc;
}

.content-text p {
    margin-bottom: 5rem;
}

.content-notice {
    font-size: clamp(0.8rem, 1.6vw, 1rem);
    line-height: 2;
    color: var(--dark);
    padding-top: 2rem;
	text-align: center;
}

.red-notice{
	color: #e2382e;	
}

.desktop-notice{
	display: inline;	
}

.fa-circle-exclamation{
	color: #e2382e;
	padding-right:5px;
	
}

.content-credit {
	margin: -6rem 0rem 0rem 0rem;  
    font-size: clamp(0.75rem, 1.5vw, 0.8rem);
    line-height: 2;
    color: var(--dark);
    margin-bottom: 0rem;
	text-align: left;
}

.content-credit p {
    margin-bottom: 0rem;
}

.hero-subtitle {
	
    font-size: clamp(1.5rem, 2.5vw, 1.5rem);
    font-weight: 400;
    padding-top: 15px;
	padding-bottom: 7px;
    opacity: 0.95;
}

.photocredit {
	color: var(--primary);
	text-decoration: none;
	
}

.mobile-break {
	display: none;
}


@media(max-width:640px){
  .video-grid { grid-template-columns:1fr; }
  .tabs-wrapper { gap:8px; }
  .tab-btn { padding:8px 14px; font-size:.78rem; }
  .category-header { flex-direction:column; align-items:flex-start; }
  .header-btns { width:100%; }
  .content-section {
        padding: 4rem 0rem 0rem 0rem;
    }
	.hero h1 {
        font-size: 2.2rem;
    }
	.mobile-break {
		display: block; /* or display: inline; */
	}
	.hero-subtitle {
        font-size: 1.2rem;
    }
	.desktop-notice{
		display: none;	
	}
}

/* ── iOS SPECIFIC FIXES ── */
/* On iOS, make sure thumb-layer doesn't block YouTube player after it loads */
@supports (-webkit-touch-callout: none) {
  /* iOS Safari specific */
  .video-card .iframe-layer.active ~ .thumb-layer {
    /* Hide thumb-layer only after iframe is loaded */
    display: none !important;
    pointer-events: none !important;
  }
  
  .video-card .iframe-layer.active {
    pointer-events: auto !important;
    z-index: 2 !important;
  }
  
  .video-card .iframe-layer.active iframe {
    pointer-events: auto !important;
  }
  
  /* Keep thumb-layer visible initially */
  .video-card .thumb-layer {
    pointer-events: auto !important;
    z-index: 1 !important;
  }
}
