
:root {
    --bg-body: var(--theme-body-bg, #141414);
    --bg-dark: var(--theme-header-bg, #1a1a1a);
    --bg-card: var(--theme-card-bg, #1f1f1f);
    --bg-accent: var(--theme-primary, #e5484d);
    --border-color: var(--theme-border, #2a2a2a);
    --text-primary: var(--theme-text-primary, #f2f2f2);
    --text-secondary: var(--theme-text-secondary, #9a9a9a);
    --shadow-color: rgba(0, 0, 0, 0.45);
    --bg-hover: rgba(255, 255, 255, 0.06);
}

/* ===== LIGHT THEME ===== */
.light-theme {
    --bg-body: #f0f2f5;
    --bg-dark: #ffffff;
    --bg-card: #ffffff;
    --bg-accent: var(--theme-primary, #2563eb);
    --border-color: #e2e8f0;
    --text-primary: #1a202c;
    --text-secondary: #4a5568;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --bg-hover: rgba(0, 0, 0, 0.05);
}

/* ===== BODY ===== */
body {
    background-color: var(--bg-body);
    color: var(--text-primary);
    -webkit-tap-highlight-color: transparent;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* ===== CURSOR / TEXT SELECTION =====
   By default the browser shows an I-beam (text) cursor over any plain text,
   and lets it be highlighted/selected - that's what was showing up as a
   "text insert cursor" almost everywhere you clicked. Make the site feel
   like an app: default arrow cursor + no text selection everywhere, then
   opt individual readable blocks (descriptions, etc.) back in below. Real
   <input>/<textarea> fields are unaffected - they keep their normal caret. */
body {
    cursor: default;
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
}
input, textarea {
    cursor: text;
    -webkit-user-select: text;
    -moz-user-select: text;
    user-select: text;
}
/* Readable/copyable text blocks - selection intentionally kept */
p, .selectable-text, .wi-desc-text {
    cursor: text;
    -webkit-user-select: text;
    -moz-user-select: text;
    user-select: text;
}

/* ===== BACKGROUND CLASSES ===== */
.bg-custom-body { background-color: var(--bg-body); transition: background-color 0.3s ease; }
.bg-custom-dark { background-color: var(--bg-dark); transition: background-color 0.3s ease; }
.bg-custom-card { background-color: var(--bg-card); transition: background-color 0.3s ease; }
.bg-custom-hover { background-color: var(--bg-hover); transition: background-color 0.3s ease; }
.border-custom { border-color: var(--border-color); transition: border-color 0.3s ease; }

/* ===== TEXT COLORS ===== */
.theme-text { color: var(--text-primary); transition: color 0.3s ease; }
.theme-text-muted { color: var(--text-secondary); transition: color 0.3s ease; }

/* ===== THEME-SPECIFIC CLASSES ===== */
.bg-theme-primary { background-color: var(--theme-primary); }
.text-theme-primary { color: var(--theme-primary); }
.border-theme-primary { border-color: var(--theme-primary); }

.bg-theme-header { background-color: var(--theme-header-bg); }
.bg-theme-footer { background-color: var(--theme-footer-bg); }
.bg-theme-card { background-color: var(--theme-card-bg); }
.bg-theme-body { background-color: var(--theme-body-bg); }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-dark); }
::-webkit-scrollbar-thumb { background: var(--theme-primary); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--theme-secondary); }

.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* ===== SHELF ROWS (kisskh-style horizontal scroll sections) =====
   To change how many tiles show per row, just edit --shelf-cols below.
   Use a ".5" value (e.g. 6.5) so the next tile peeks in at the edge -
   that's the visual hint that the row scrolls. */
.shelf-track {
    --shelf-gap: 6px;
    --shelf-cols: 3.3;
}
@media (min-width: 640px) {
    .shelf-track { --shelf-gap: 8px; --shelf-cols: 4.3; }
}
@media (min-width: 768px) {
    .shelf-track { --shelf-cols: 5.3; }
}
@media (min-width: 1024px) {
    .shelf-track { --shelf-cols: 6.5; }
}

.shelf-wrap {
    display: flex;
    align-items: center;
    gap: 4px;
}
.shelf-track {
    display: flex;
    flex: 1 1 auto;
    min-width: 0;
    overflow-x: auto;
    scroll-behavior: smooth;
    gap: var(--shelf-gap);
    scroll-snap-type: x proximity;
}
.shelf-tile {
    flex: 0 0 calc((100% - (var(--shelf-cols) - 1) * var(--shelf-gap)) / var(--shelf-cols));
    scroll-snap-align: start;
}

.shelf-arrow {
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    /*border-radius: 50%;*/
    /*background: var(--bg-card);*/
    /*border: 1px solid var(--border-color);*/
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 20px;
    /*transition: background 0.2s ease, color 0.2s ease, opacity 0.2s ease;*/
}
.shelf-arrow:hover { color: var(--theme-primary);}
.shelf-arrow[disabled] { opacity: 0.35; cursor: default; pointer-events: none; }

@media (max-width: 639px) {
    .shelf-arrow { display:none; width: 26px; height: 26px; font-size: 10px; }
}

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}
.animate-fade-in { animation: fadeIn 0.3s ease-out; }

@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.7); }
}

/* ===== LINE CLAMP ===== */
.line-clamp-1 { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.line-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.line-clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* ===== DRAMA CARDS ===== */
.drama-card {
    border-radius: 10px;
    overflow: hidden;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.drama-card img {
    border-radius: inherit;
}
.drama-card:hover {
    box-shadow: 0 4px 20px var(--shadow-color);
    transform: translateY(-4px);
}

/* ===== STATUS BADGES ===== */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 8px;
    font-weight: bold;
    padding: 2px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    border: 1px solid transparent;
}
@media (min-width: 640px) { .status-badge { font-size: 9px; padding: 2px 10px; } }
@media (min-width: 768px) { .status-badge { font-size: 10px; padding: 3px 12px; } }

.status-ongoing {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border-color: rgba(16, 185, 129, 0.3);
}
.status-ongoing .dot {
    display: inline-block;
    width: 5px;
    height: 5px;
    background: #34d399;
    border-radius: 50%;
    animation: pulse-dot 1.5s ease-in-out infinite;
}
.status-completed {
    background: rgba(59, 130, 246, 0.15);
    color: var(--theme-primary);
    border-color: rgba(59, 130, 246, 0.3);
}
.status-upcoming {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border-color: rgba(245, 158, 11, 0.3);
}

/* ===== FILTER BUTTONS ===== */
.filter-btn {
    padding: 6px 14px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    transition: all 0.2s ease;
    cursor: pointer;
    border: 1px solid transparent;
    background: var(--bg-card);
    color: var(--text-primary);
    text-decoration: none;
}
.filter-btn:hover {
    color: white;
}
/*.filter-btn.active {*/
/*    background: var(--theme-accent);*/
/*    color: white;*/
/*}*/

/* ===== EPISODE BUTTONS ===== */
.episode-btn {
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 8px 4px;
    text-align: center;
    transition: all 0.2s ease;
    cursor: pointer;
    min-height: 42px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}
.episode-btn:hover {
    border-color: var(--theme-primary);
}
.episode-btn.active {
    border-color: var(--theme-primary);
    background: rgba(14, 165, 233, 0.15);
}
.episode-btn .ep-number {
    font-weight: bold;
    color: var(--text-primary);
}
.episode-btn .ep-cc {
    font-size: 7px;
    color: var(--text-secondary);
    text-transform: uppercase;
}

/* ===== PAGINATION ===== */
.pagination-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.2s ease;
    cursor: pointer;
    text-decoration: none;
    background: var(--bg-card);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}
.pagination-btn:hover {
    border-color: var(--theme-primary);
    color: var(--theme-secondary);
    background: var(--bg-hover);
}
.pagination-btn.active {
    background: var(--theme-primary) !important;
    color: white !important;
    border-color: var(--theme-primary) !important;
}
@media (max-width: 640px) {
    .pagination-btn { min-width: 28px; height: 28px; padding: 0 8px; font-size: 11px; }
}

/* ===== SHARE BUTTONS ===== */
.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
    white-space: nowrap;
}
.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}
.share-btn.facebook { background: #1877f2; color: white; }
.share-btn.twitter { background: #000000; color: white; border: 1px solid #333; }
.share-btn.copy { background: var(--bg-dark); color: var(--text-primary); border: 1px solid var(--border-color); }

/* ===== NOTIFICATION ===== */
.notification-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 12px 20px;
    border-radius: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    box-shadow: 0 8px 32px var(--shadow-color);
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 500;
    z-index: 9999;
    animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    max-width: 400px;
}
.notification-toast.success { border-color: #34d399; background: rgba(16, 185, 129, 0.1); }
.notification-toast.error { border-color: #f87171; background: rgba(248, 113, 113, 0.1); }
.notification-toast.info { border-color: var(--theme-primary); background: rgba(14, 165, 233, 0.1); }

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============================================
   KISSKH-STYLE VISUAL LAYER
   ============================================ */

/* ===== TYPOGRAPHY ===== */
body {
    font-family: "Inter", "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif;
    letter-spacing: 0.1px;
}

/* ===== CONTENT CARDS (kisskh-style: image on top, solid title bar below) ===== */
.kk-tile {
    background: var(--bg-card);
    border: 1px solid var(--border-color, rgba(255,255,255,0.06));
}
.kk-tile-ep {
    position: absolute;
    right: 6px;
    bottom: 6px;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    text-shadow: 0 1px 3px rgba(0,0,0,0.8);
    background: rgba(0,0,0,0.65);
    padding: 2px 7px;
    border-radius: 4px;
    z-index: 2;
}
@media (min-width: 640px) { .kk-tile-ep { font-size: 11px; right: 8px; bottom: 8px; padding: 2px 8px; } }
.kk-tile-titlebar {
    background: var(--bg-card);
    padding: 8px 10px;
    border-top: 1px solid var(--border-color, rgba(255,255,255,0.06));
}
.kk-tile-title {
    display: block;
    color: var(--text-primary, #e5e7eb);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.3;
}
@media (min-width: 640px) { .kk-tile-title { font-size: 13px; } }

/* Poster hover play button (kisskh/Netflix-style) */
.poster-play-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, rgba(10,10,15,0) 40%, rgba(10,10,15,0.85) 100%);
    opacity: 0;
    transition: opacity 0.25s ease;
    pointer-events: none;
}
.group:hover .poster-play-overlay {
    opacity: 1;
}
.poster-play-overlay .play-circle {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--theme-primary);
    color: #06060a;
    box-shadow: 0 6px 18px rgba(0,0,0,0.5);
    transform: scale(0.8);
    transition: transform 0.25s ease;
}
.group:hover .poster-play-overlay .play-circle {
    transform: scale(1);
}

/* ===== SECTION HEADINGS ===== */
.section-heading {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: 13px;
    color: var(--text-primary);
}
.section-heading::before {
    content: "";
    display: block;
    width: 4px;
    height: 16px;
    border-radius: 2px;
    background: var(--theme-primary);
}

/* ===== FILTER / PILL BUTTONS ===== */
.filter-btn {
    border-radius: 999px !important;
}

/* ===== EPISODE BUTTONS (pill/rounded, kisskh-style dense grid) ===== */
.episode-btn {
    border-radius: 6px;
}
.episode-btn:hover {
    transform: translateY(-1px);
}

/* ===== NAV UNDERLINE ACCENT ===== */
#navMenu {
    position: relative;
}
#navMenu .menu-item a {
    position: relative;
}
#navMenu .menu-item a::after {
    content: "";
    position: absolute;
    left: 16px;
    right: 16px;
    bottom: 0;
    height: 2px;
    background: var(--theme-primary);
    transform: scaleX(0);
    transition: transform 0.2s ease;
}
#navMenu .menu-item a:hover::after {
    transform: scaleX(1);
}

/* ===== SCROLLBAR (glow accent) ===== */
::-webkit-scrollbar-thumb { background: var(--theme-primary); }

/* ===== RESPONSIVE ===== */
@media (max-width: 480px) {
    .grid-cols-3 { grid-template-columns: repeat(3, 1fr); gap: 8px; }
    .grid-cols-4 { grid-template-columns: repeat(4, 1fr); gap: 6px; }
    .episode-btn { min-height: 36px; padding: 6px 2px; }
    .episode-btn .ep-number { font-size: 11px; }
}
@media (min-width: 481px) and (max-width: 640px) {
    .grid-cols-3 { grid-template-columns: repeat(3, 1fr); gap: 10px; }
    .grid-cols-4 { grid-template-columns: repeat(4, 1fr); gap: 8px; }
}
@media (min-width: 641px) and (max-width: 768px) {
    .grid-cols-3 { grid-template-columns: repeat(3, 1fr); gap: 12px; }
    .grid-cols-6 { grid-template-columns: repeat(6, 1fr); gap: 8px; }
}
@media (min-width: 769px) and (max-width: 1024px) {
    .grid-cols-5 { grid-template-columns: repeat(5, 1fr); gap: 16px; }
    .grid-cols-8 { grid-template-columns: repeat(8, 1fr); gap: 8px; }
}
@media (min-width: 1025px) {
    .grid-cols-5 { grid-template-columns: repeat(5, 1fr); gap: 16px; }
    .grid-cols-10 { grid-template-columns: repeat(10, 1fr); gap: 10px; }
}
