/* ==========================================================================
   SUGOIX MASTER STYLESHEET (LIQUID GLASS EDITION)
   Theme: Glassmorphism | Primary Accent: Electric Blue (#2f80ff)
   ========================================================================== */

/* --- FONTS --- */
@font-face { font-family: 'Poppins'; src: url('../assets/fonts/Poppins-Medium.ttf') format('truetype'); font-weight: 400 500; font-style: normal; font-display: swap; }
@font-face { font-family: 'Poppins'; src: url('../assets/fonts/Poppins-Bold.ttf') format('truetype'); font-weight: 600 900; font-style: normal; font-display: swap; }

/* --- CSS VARIABLES (LIGHT & DARK MODE) --- */
:root {
  /* Default Light Mode */
  --bg: #e5e9f0; 
  --bg-soft: #f3f4f6;
  --glass-bg: rgba(255, 255, 255, 0.65);
  --glass-border: rgba(255, 255, 255, 0.9);
  --glass-highlight: rgba(47, 128, 255, 0.4);
  --accent: #2f80ff; /* Sugoix Electric Blue */
  --accent-hover: #1c64e0;
  --accent-2: #6aa8ff;
  --accent-grad: linear-gradient(120deg, #2f80ff, #6aa8ff);
  --text: #2d3748; 
  --text-dim: #718096;
  --text-mute: #a0aec0;
  --header-bg: rgba(243, 244, 246, 0.75);
  --font-display: 'Outfit', 'Poppins', sans-serif;
  --font-body: 'Poppins', sans-serif;
}

[data-theme="dark"] {
  /* Dark Mode - blue-black with electric-blue light, like the INTECH reference */
  --bg: #02040a;
  --bg-soft: #050a14;
  --glass-bg: rgba(8, 14, 30, 0.62);
  --glass-border: rgba(150, 190, 255, 0.14);
  --glass-highlight: rgba(47, 128, 255, 0.5);
  --accent: #2f80ff;
  --accent-hover: #1c64e0;
  --accent-2: #38bdf8;
  --accent-grad: linear-gradient(120deg, #2f80ff, #0a2f78);
  --text: #ffffff;
  --text-dim: #a3b0c7;
  --text-mute: #5f6d85;
  --header-bg: rgba(2, 4, 10, 0.75);
}

/* --- GLOBAL RESETS --- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { 
  margin: 0; 
  background: var(--bg); 
  color: var(--text); 
  font-family: var(--font-body); 
  min-height: 100vh; 
  transition: background 0.4s ease, color 0.4s ease;
  overflow-x: hidden;
}
a { text-decoration: none; color: inherit; transition: color 0.2s; }
button, input, select { font: inherit; outline: none; }
.container { width: min(1180px, calc(100% - 32px)); margin: auto; }

/* --- GLOBAL ANIMATIONS --- */
.scroll-animate {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s cubic-bezier(0.25, 0.8, 0.25, 1), transform 0.8s cubic-bezier(0.25, 0.8, 0.25, 1);
  will-change: opacity, transform;
}
.scroll-animate.visible { opacity: 1; transform: translateY(0); }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pcPulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }

.loading { display: flex; justify-content: center; align-items: center; padding: 40px; }
.spinner { border: 3px solid rgba(47, 128, 255, 0.2); border-top-color: var(--accent); border-radius: 50%; width: 40px; height: 40px; animation: spin 1s linear infinite; }

/* --- HEADER & NAVIGATION (LIQUID GLASS) --- */
.site-header { position: sticky; top: 0; z-index: 50; background: var(--header-bg); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-bottom: 1px solid var(--glass-border); transition: all 0.4s; }
.nav { height: 78px; display: flex; align-items: center; gap: 30px; }
.brand { display: flex; align-items: center; gap: 5px; font-family: var(--font-display); font-size: 26px; font-weight: 800; letter-spacing: 0.5px; color: var(--text); }
.brand span { color: var(--accent); }
.brand-mark { display: none; } /* Image logo hidden in favor of text */

.desktop-nav { display: flex; gap: 24px; font-size: 13px; font-weight: 700; color: var(--text-dim); }
.desktop-nav a { position: relative; padding: 5px 0; }
.desktop-nav a:hover, .desktop-nav a.active { color: var(--accent); }
.desktop-nav a.active::after { content: ''; position: absolute; bottom: 0; left: 0; width: 100%; height: 2px; background: var(--accent); border-radius: 2px; }

.nav-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.search { height: 38px; width: 220px; background: var(--glass-bg); border: 1px solid var(--glass-border); border-radius: 999px; display: flex; align-items: center; padding: 0 15px; transition: all 0.3s; }
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 10px rgba(47, 128, 255, 0.2); }
.search input { flex: 1; background: none; border: 0; color: var(--text); font-size: 13px; width: 100%; }
.search button { border: 0; background: none; color: var(--accent); font-size: 18px; cursor: pointer; padding: 0; }
.icon-btn { background: var(--glass-bg); border: 1px solid var(--glass-border); color: var(--text); border-radius: 50%; width: 38px; height: 38px; display: grid; place-items: center; cursor: pointer; transition: 0.3s; }
.icon-btn:hover { border-color: var(--accent); color: var(--accent); }

/* --- HERO SECTION --- */
.hero { height: 500px; position: relative; border-radius: 20px; overflow: hidden; border: 1px solid var(--glass-border); background: var(--bg-soft); margin: 20px 0 42px; }
.hero-bg { position: absolute; inset: 0; background-size: cover; background-position: center; transition: transform 0.7s, opacity 0.5s; }
.hero-bg.hero-bg-zoom { transform: scale(1.05); }
.hero-overlay { position: absolute; inset: 0; background: linear-gradient(90deg, var(--bg) 0%, rgba(5,5,5,0.8) 40%, transparent 100%); }
[data-theme="light"] .hero-overlay { background: linear-gradient(90deg, var(--bg) 0%, rgba(229,233,240,0.9) 40%, transparent 100%); }

.hero-content { position: absolute; left: 0; bottom: 0; width: min(600px, 90%); padding: 40px; opacity: 1; transition: opacity 0.4s; }
.hero-content.hero-anim { animation: fadeUp 0.6s cubic-bezier(0.25, 0.8, 0.25, 1); }
@keyframes fadeUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

.eyebrow { display: flex; gap: 10px; align-items: center; font-size: 11px; font-weight: 800; color: var(--text-dim); margin-bottom: 15px; }
.eyebrow span { background: var(--accent); color: #fff; padding: 4px 8px; border-radius: 6px; }
.eyebrow b { background: rgba(255,255,255,0.1); padding: 4px 8px; border-radius: 6px; color: var(--text); }
.hero h1 { font-family: var(--font-display); font-weight: 700; font-size: clamp(32px, 5vw, 48px); line-height: 1.1; margin: 0 0 15px; }
.hero p { color: var(--text-dim); line-height: 1.6; font-size: 14px; margin: 0 0 20px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 12px 20px; border-radius: 12px; font-size: 13px; font-weight: 700; cursor: pointer; transition: all 0.3s; border: none; }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 4px 15px rgba(47, 128, 255, 0.3); }
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-2px); box-shadow: 0 6px 20px rgba(47, 128, 255, 0.4); }
.btn-ghost { background: var(--glass-bg); border: 1px solid var(--glass-border); color: var(--text); backdrop-filter: blur(10px); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

.hero-dots { position: absolute; right: 25px; bottom: 25px; display: flex; gap: 8px; }
.hero-dots button { width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,0.3); border: none; cursor: pointer; transition: 0.3s; }
.hero-dots button.active { width: 24px; background: var(--accent); border-radius: 4px; }

/* --- SECTION HEADERS --- */
.section { margin-bottom: 50px; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.section-head > div, .page-title > div { display: flex; align-items: center; gap: 10px; }
.section-line { display: block; width: 4px; height: 20px; border-radius: 4px; background: var(--accent); }
.section-head h2, .page-title h1 { font-family: var(--font-display); font-size: 20px; margin: 0; font-weight: 700; color: var(--text); }
.section-head a { font-size: 12px; color: var(--text-dim); font-weight: 600; background: var(--glass-bg); padding: 6px 12px; border-radius: 8px; border: 1px solid var(--glass-border); transition: 0.3s; }
.section-head a:hover { color: var(--accent); border-color: var(--accent); }

/* --- CARDS & GRIDS (LIQUID GLASS) --- */
.card-row { display: flex; gap: 15px; overflow-x: auto; padding: 10px 5px 20px; scrollbar-width: none; }
.card-row::-webkit-scrollbar { display: none; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 20px 15px; }

.card { flex: 0 0 160px; background: var(--glass-bg); backdrop-filter: blur(10px); border: 1px solid var(--glass-border); border-radius: 12px; overflow: hidden; cursor: pointer; transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s; }
.card:hover { transform: translateY(-5px); border-color: var(--accent); box-shadow: 0 10px 25px rgba(47, 128, 255, 0.15); }
.card:focus-visible { outline: 2px solid var(--accent); transform: translateY(-3px); }

.poster { position: relative; aspect-ratio: 3/4.2; background: #000; overflow: hidden; }
.poster img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.card:hover .poster img { transform: scale(1.08); }

.score { position: absolute; top: 8px; right: 8px; background: var(--accent); color: #fff; font-size: 10px; font-weight: 700; padding: 4px 8px; border-radius: 6px; z-index: 2; }
.hd { position: absolute; top: 8px; left: 8px; background: rgba(0,0,0,0.7); color: #fff; font-size: 10px; font-weight: 700; padding: 4px 8px; border-radius: 6px; z-index: 2; }
.dub, .type-badge { position: absolute; bottom: 8px; left: 8px; background: rgba(47, 128, 255, 0.9); color: #fff; font-size: 9px; font-weight: 800; padding: 4px 8px; border-radius: 6px; z-index: 2; }

.play-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.5); display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity 0.3s; z-index: 1; }
.card:hover .play-overlay { opacity: 1; }
.play-circle { width: 45px; height: 45px; border-radius: 50%; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; padding-left: 3px; font-size: 18px; box-shadow: 0 4px 15px rgba(47, 128, 255, 0.4); transform: scale(0.8); transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
.card:hover .play-circle { transform: scale(1); }

.card-title { font-size: 14px; font-weight: 600; margin: 12px 12px 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); }
.card-sub { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-dim); margin: 0 12px 12px; }

/* Empty States */
.empty { text-align: center; padding: 60px 20px; background: var(--glass-bg); backdrop-filter: blur(16px); border: 1px solid var(--glass-border); border-radius: 20px; }
.empty > div { font-size: 40px; color: var(--accent); margin-bottom: 10px; }
.empty h2 { color: var(--text); margin: 0 0 5px; font-size: 18px; }
.empty p { color: var(--text-dim); margin: 0; font-size: 13px; }
.hidden { display: none !important; }

/* --- DETAILS PAGE (FIXED & REBUILT) --- */
.ae-details-page { position: relative; min-height: 500px; overflow: hidden; border: 1px solid var(--glass-border); border-radius: 24px; background: var(--bg); margin-bottom: 30px; }
.ae-backdrop { position: absolute; inset: 0; background-size: cover; background-position: center 20%; filter: blur(20px) saturate(1.2); opacity: 0.4; z-index: 0; transform: scale(1.1); }
.ae-backdrop-shade { position: absolute; inset: 0; background: linear-gradient(to bottom, transparent 0%, var(--bg) 95%); z-index: 0; }
.ae-close { position: absolute; top: 20px; left: 20px; width: 40px; height: 40px; border: 1px solid var(--glass-border); background: var(--glass-bg); backdrop-filter: blur(10px); color: var(--text); border-radius: 50%; font-size: 24px; display: grid; place-items: center; cursor: pointer; z-index: 10; transition: 0.3s; }
.ae-close:hover { background: var(--accent); border-color: var(--accent); color: #fff; transform: scale(1.05); }

.ae-details-content { position: relative; z-index: 1; padding: 40px; max-width: 900px; }
.ae-award { color: var(--accent); font-weight: 800; font-size: 12px; letter-spacing: 1px; margin-bottom: 10px; text-transform: uppercase; }
.ae-title-row h1 { font-family: var(--font-display); font-size: clamp(28px, 4vw, 46px); font-weight: 700; line-height: 1.1; margin: 0 0 15px; color: var(--text); }
.ae-meta-line { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; font-size: 12px; color: var(--text-dim); font-weight: 600; margin-bottom: 15px; }
.ae-rating-badge { background: var(--accent); color: #fff; padding: 3px 8px; border-radius: 6px; }

.ae-action-row { display: flex; gap: 15px; margin: 20px 0; }
.ae-action { display: flex; align-items: center; gap: 8px; padding: 12px 20px; background: var(--glass-bg); backdrop-filter: blur(10px); border: 1px solid var(--glass-border); border-radius: 12px; font-weight: 600; font-size: 13px; color: var(--text); cursor: pointer; transition: 0.3s; }
.ae-action:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,0.1); }
.ae-action strong { color: var(--accent); font-size: 16px; }

.ae-description { color: var(--text-dim); line-height: 1.7; font-size: 14px; max-width: 750px; }
.ae-more-details { background: none; border: none; color: var(--accent); font-weight: 600; font-size: 13px; cursor: pointer; padding: 0; margin-top: 10px; }

/* Tabs */
.ae-tabs { display: flex; gap: 15px; overflow-x: auto; border-bottom: 1px solid var(--glass-border); padding-bottom: 15px; margin-bottom: 25px; }
.ae-tabs button { background: var(--glass-bg); border: 1px solid var(--glass-border); color: var(--text); padding: 10px 20px; border-radius: 999px; font-weight: 600; font-size: 13px; cursor: pointer; transition: 0.3s; white-space: nowrap; }
.ae-tabs button:hover { border-color: var(--accent); }
.ae-tabs button.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* --- PLAYER & WATCH CONTROLS --- */
.watch-layout { display: grid; grid-template-columns: 1fr 320px; gap: 20px; }
.main-player-col { display: flex; flex-direction: column; gap: 20px; }

.player { background: #000; border: 1px solid var(--glass-border); border-radius: 16px; overflow: hidden; position: relative; aspect-ratio: 16/9; box-shadow: 0 10px 30px rgba(0,0,0,0.2); }
.player video, .player iframe { width: 100%; height: 100%; display: block; border: none; }

.player-controls { position: absolute; bottom: 0; left: 0; right: 0; padding: 20px; background: linear-gradient(to top, rgba(0,0,0,0.9), transparent); display: flex; align-items: center; gap: 15px; opacity: 0; transition: opacity 0.3s; }
.player:hover .player-controls { opacity: 1; }

.pc-btn { background: var(--accent); border: none; color: #fff; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; transition: 0.2s; }
.pc-btn:hover { transform: scale(1.1); background: var(--accent-hover); }
.pc-time { font-size: 12px; color: #ddd; font-variant-numeric: tabular-nums; }
.pc-seek { flex: 1; -webkit-appearance: none; height: 6px; background: rgba(255,255,255,0.2); border-radius: 3px; cursor: pointer; }
.pc-seek::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; background: var(--accent); border-radius: 50%; }

.stream-box { background: var(--glass-bg); backdrop-filter: blur(16px); border: 1px solid var(--glass-border); border-radius: 16px; padding: 20px; }
.server-btn { display: flex; justify-content: space-between; align-items: center; background: rgba(255,255,255,0.05); border: 1px solid var(--glass-border); padding: 12px 16px; border-radius: 10px; color: var(--text); cursor: pointer; transition: 0.3s; }
.server-btn:hover { border-color: var(--accent); background: rgba(47, 128, 255, 0.05); }
.server-btn.active { border-color: var(--accent); background: rgba(47, 128, 255, 0.15); color: var(--accent); }

/* Sidebar Episodes */
.episode-panel { background: var(--glass-bg); backdrop-filter: blur(16px); border: 1px solid var(--glass-border); border-radius: 16px; padding: 20px; max-height: 600px; overflow-y: auto; }
.episode-panel::-webkit-scrollbar { width: 6px; }
.episode-panel::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 10px; }

/* --- FOOTER --- */
.footer { border-top: 1px solid var(--glass-border); background: var(--glass-bg); backdrop-filter: blur(16px); padding: 40px 0 30px; margin-top: 60px; }
.footer-inner { display: flex; align-items: flex-start; justify-content: space-between; gap: 30px; flex-wrap: wrap; }
.footer-brand .brand { font-size: 28px; }
.footer p { color: var(--text-dim); font-size: 12px; margin: 10px 0; max-width: 400px; line-height: 1.6; }

.social-wrap { display: flex; flex-direction: column; gap: 10px; }
.social-label { font-size: 11px; font-weight: 700; color: var(--text); text-transform: uppercase; letter-spacing: 1px; }
.socials { display: flex; gap: 10px; }
.social { width: 40px; height: 40px; border-radius: 12px; background: var(--glass-bg); border: 1px solid var(--glass-border); color: var(--text); display: grid; place-items: center; transition: 0.3s; }
.social:hover { background: var(--accent); border-color: var(--accent); color: #fff; transform: translateY(-3px); box-shadow: 0 6px 15px rgba(47, 128, 255, 0.3); }

/* --- RESPONSIVE MEDIA QUERIES --- */
@media (max-width: 992px), (max-device-width: 992px) and (pointer: coarse) {
  .watch-layout { grid-template-columns: 1fr; }
  .episode-panel { max-height: 400px; }
}

@media (max-width: 768px), (max-device-width: 768px) and (pointer: coarse) {
  .nav { gap: 15px; }
  .desktop-nav, .search { display: none; }
  .mobile-only { display: grid; }
  .hero { height: 400px; padding: 20px; }
  .hero-content { padding: 20px; width: 100%; }
  .hero h1 { font-size: 28px; }
  .ae-details-content { padding: 20px; }
  .ae-title-row h1 { font-size: 24px; }
  .footer-inner { flex-direction: column; text-align: center; align-items: center; }
  .social-wrap { align-items: center; }
}

@media (max-width: 480px), (max-device-width: 480px) and (pointer: coarse) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px 10px; }
  .card { flex-basis: 130px; }
  .ae-action-row { flex-direction: column; }
  .server-grid { grid-template-columns: 1fr; }
}
