/* ==========================================================================
   PRODUCTION-READY WEBTOON / MANGA PLATFORM STYLESHEET (CSS3)
   Clean, modern, light-theme interface with vibrant warm orange/amber accents
   ========================================================================== */

:root {
    --primary: #c2410c;
    --primary-hover: #9a3412;
    --primary-light: #fff7ed;
    --secondary: #0f172a;
    --secondary-hover: #1e293b;
    --accent: #d97706;
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --text-main: #0f172a;
    --text-muted: #475569;
    --text-sub: #334155;
    --border-color: #e2e8f0;
    --border-subtle: #f1f5f9;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-full: 9999px;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.6;
    font-size: 15px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

button, input, select, textarea {
    font-family: inherit;
    font-size: inherit;
}

.container {
    width: 100%;
    max-width: 1240px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 20px;
    padding-right: 20px;
}

/* --------------------------------------------------------------------------
   HEADER & NAVIGATION
   -------------------------------------------------------------------------- */
.site-header {
    background: rgba(9, 13, 22, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
    gap: 16px;
}

.header-brand-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
}

.site-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #ffffff;
    text-decoration: none;
    line-height: 1;
    transition: transform 0.2s ease;
}

.site-logo-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.site-logo-text {
    font-size: 24px;
    font-weight: 900;
    letter-spacing: -0.5px;
    color: #ffffff;
    line-height: 1;
}

.site-logo-text .logo-accent,
.site-logo span {
    color: var(--primary);
}

.site-logo-text .logo-main {
    color: #ffffff;
}

.site-logo img,
.site-logo-img {
    height: 46px;
    max-height: 50px;
    width: auto;
    max-width: 220px;
    object-fit: contain;
    vertical-align: middle;
    display: block;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.site-logo-img-mobile {
    height: 38px;
    max-height: 42px;
    width: auto;
    max-width: 180px;
    object-fit: contain;
    vertical-align: middle;
    display: block;
}

.site-logo:hover img,
.site-logo:hover .site-logo-img {
    transform: scale(1.03);
}

.nav-desktop {
    display: flex;
    align-items: center;
    gap: 6px;
    list-style: none;
}

.nav-desktop a {
    font-size: 14.5px;
    font-weight: 600;
    color: #cbd5e1;
    padding: 7px 14px;
    border-radius: var(--radius-md);
    position: relative;
    text-decoration: none;
    border: 1px solid transparent;
    transition: all 0.15s ease;
}

.nav-desktop a:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
}

.nav-desktop a.active {
    color: #ffffff;
    background: rgba(234, 88, 12, 0.18);
    border-color: rgba(234, 88, 12, 0.35);
    font-weight: 700;
}

.header-search {
    flex: 1;
    max-width: 320px;
    position: relative;
}

.header-search input {
    width: 100%;
    padding: 9px 16px 9px 38px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-full);
    font-size: 13.5px;
    color: #f8fafc;
    outline: none;
    box-sizing: border-box;
    transition: all 0.2s ease;
}

.header-search input::placeholder {
    color: #94a3b8;
}

.header-search input:focus {
    background: #0f172a;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(234, 88, 12, 0.2);
    color: #ffffff;
}

.header-search .search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    pointer-events: none;
    display: flex;
    align-items: center;
}

/* Live Search Autocomplete Dropdown */
.live-search-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    width: 420px;
    max-width: 90vw;
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 12px;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.5);
    z-index: 9999;
    overflow: hidden;
    display: none;
}
.live-search-dropdown.active {
    display: block;
}
.live-search-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: #090d16;
    border-bottom: 1px solid #1e293b;
    font-size: 11px;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.live-search-items {
    max-height: 380px;
    overflow-y: auto;
    padding: 6px;
}
.live-search-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 10px;
    border-radius: 8px;
    text-decoration: none;
    color: #f1f5f9;
    transition: background-color 0.15s ease;
}
.live-search-item:hover, .live-search-item.selected {
    background: #1e293b;
}
.live-search-item img {
    width: 40px;
    height: 56px;
    object-fit: cover;
    border-radius: 6px;
    background: #1e293b;
    flex-shrink: 0;
}
.live-search-item-info {
    flex: 1;
    min-width: 0;
}
.live-search-item-title {
    font-size: 13.5px;
    font-weight: 700;
    color: #f8fafc;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.live-search-item-meta {
    font-size: 11.5px;
    color: #94a3b8;
    margin-top: 2px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.live-search-item-badge {
    background: #ea580c;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 4px;
    text-transform: uppercase;
}
.live-search-footer {
    padding: 8px 12px;
    background: #090d16;
    border-top: 1px solid #1e293b;
    text-align: center;
}
.live-search-footer a {
    color: #ea580c;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
}
.live-search-footer a:hover {
    text-decoration: underline;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #cbd5e1;
    position: relative;
    transition: all 0.15s ease;
    text-decoration: none;
    cursor: pointer;
}

.header-action-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.2);
}

.header-badge {
    position: absolute;
    top: -3px;
    right: -3px;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    border-radius: var(--radius-full);
    font-size: 10px;
    font-weight: 800;
    line-height: 17px;
    text-align: center;
    box-sizing: border-box;
}

.header-badge-pulse {
    background: #ef4444;
    color: #ffffff;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.5);
    animation: headerBadgePulse 2s infinite ease-in-out;
}

.header-badge-library {
    background: var(--primary);
    color: #ffffff;
}

@keyframes headerBadgePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.12); }
}

.mobile-search-toggle-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #cbd5e1;
    cursor: pointer;
    transition: all 0.15s ease;
}

.mobile-search-toggle-btn:hover,
.mobile-search-toggle-btn.active {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
}

.mobile-search-bar {
    background: #090d16;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 10px 0;
    position: sticky;
    top: 60px;
    z-index: 99;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
}

.mobile-search-form {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.mobile-search-form input {
    width: 100%;
    padding: 10px 40px 10px 38px;
    background: #0f172a;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    font-size: 15px;
    color: #ffffff;
    outline: none;
    box-sizing: border-box;
}

.mobile-search-form input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(234, 88, 12, 0.2);
}

.mobile-search-form .search-icon {
    position: absolute;
    left: 12px;
    color: #94a3b8;
    pointer-events: none;
    display: flex;
    align-items: center;
}

.mobile-search-close-btn {
    position: absolute;
    right: 10px;
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
}

.live-search-dropdown.mobile {
    position: static;
    width: 100%;
    max-width: 100%;
    margin-top: 8px;
}

.live-search-dropdown.drawer {
    position: static;
    width: 100%;
    max-width: 100%;
    margin-top: 8px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    border-radius: var(--radius-md);
    cursor: pointer;
    border: 1px solid transparent;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background: var(--primary);
    color: #ffffff !important;
    font-weight: 700;
    box-shadow: 0 1px 3px rgba(194, 65, 12, 0.25);
}

.btn-primary:hover {
    background: var(--primary-hover);
    color: #ffffff !important;
}

.btn-secondary {
    background: var(--secondary);
    color: #ffffff;
}

.btn-secondary:hover {
    background: var(--secondary-hover);
    color: #ffffff;
}

.btn-outline {
    background: transparent;
    border-color: var(--border-color);
    color: var(--text-main);
}

.btn-outline:hover {
    background: var(--bg-main);
    border-color: var(--text-muted);
}

.btn-sm {
    padding: 6px 14px;
    font-size: 13px;
    border-radius: var(--radius-sm);
}

.btn-lg {
    padding: 14px 28px;
    font-size: 16px;
    border-radius: var(--radius-md);
}

/* --------------------------------------------------------------------------
   AUTH PAGES & FORMS (LOGIN / REGISTER / FORGOT / RESET)
   -------------------------------------------------------------------------- */
.auth-wrapper {
    min-height: calc(100vh - 140px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

.auth-card {
    width: 100%;
    max-width: 460px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 40px 32px;
    box-shadow: var(--shadow-md);
}

.auth-header {
    text-align: center;
    margin-bottom: 28px;
}

.auth-header h1 {
    font-size: 26px;
    font-weight: 800;
    color: var(--secondary);
    letter-spacing: -0.5px;
    margin-bottom: 8px;
}

.auth-header p {
    color: var(--text-muted);
    font-size: 14px;
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 6px;
}

.form-input {
    width: 100%;
    padding: 12px 14px;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 14px;
    color: var(--text-main);
    transition: var(--transition);
    outline: none;
}

.form-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(234, 88, 12, 0.15);
}

.form-input.is-invalid {
    border-color: #ef4444;
    background-color: #fef2f2;
}

.form-error {
    font-size: 13px;
    color: #ef4444;
    margin-top: 5px;
    display: block;
}

.form-help {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

.form-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 14px;
    color: var(--text-muted);
    cursor: pointer;
}

.form-checkbox input[type="checkbox"] {
    margin-top: 3px;
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
}

/* Alert notifications */
.alert {
    padding: 14px 16px;
    border-radius: var(--radius-md);
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.alert-danger {
    background: #fef2f2;
    border: 1px solid #fee2e2;
    color: #b91c1c;
}

.alert-success {
    background: #f0fdf4;
    border: 1px solid #dcfce7;
    color: #15803d;
}

.alert-info {
    background: #f0f9ff;
    border: 1px solid #e0f2fe;
    color: #0369a1;
}

.alert-warning {
    background: #fffbeb;
    border: 1px solid #fef3c7;
    color: #b45309;
}

.auth-footer {
    text-align: center;
    margin-top: 24px;
    font-size: 14px;
    color: var(--text-muted);
}

.auth-footer a {
    color: var(--primary);
    font-weight: 600;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* User Avatar dropdown in header */
.user-dropdown {
    position: relative;
}

.user-avatar-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    padding: 3px 10px 3px 3px;
    border-radius: var(--radius-full);
    color: #f8fafc;
    transition: all 0.15s ease;
}

.user-avatar-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.user-avatar-img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary);
    display: block;
}

.user-display-name {
    font-weight: 600;
    font-size: 13.5px;
    color: #f8fafc;
    display: none;
    max-width: 120px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-chevron-icon {
    color: #94a3b8;
    transition: transform 0.2s ease;
}

.user-dropdown.show .user-chevron-icon {
    transform: rotate(180deg);
}

.user-menu-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    width: 230px;
    background: #0f172a;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.5);
    padding: 8px 0;
    display: none;
    z-index: 150;
    animation: fadeInMenu 0.15s ease;
}

.user-menu-dropdown.show {
    display: block;
}

.user-menu-header {
    padding: 10px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.user-menu-header .name {
    font-weight: 700;
    color: #ffffff;
    font-size: 14px;
}

.user-menu-header .role {
    font-size: 11px;
    color: var(--primary);
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.user-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 16px;
    font-size: 13.5px;
    color: #cbd5e1;
    text-decoration: none;
    transition: all 0.15s ease;
}

.user-menu-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

.user-menu-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
    margin: 6px 0;
}

/* --------------------------------------------------------------------------
   FOOTER
   -------------------------------------------------------------------------- */
.site-footer {
    background: var(--secondary);
    color: #94a3b8;
    margin-top: auto;
    padding: 50px 0 24px;
    font-size: 14px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

.footer-brand h2 {
    color: #ffffff;
    font-size: 22px;
    font-weight: 900;
    margin-bottom: 12px;
}

.footer-brand h2 span {
    color: var(--primary);
}

.footer-brand p {
    color: #94a3b8;
    font-size: 14px;
    line-height: 1.6;
    max-width: 320px;
}

.footer-col h3 {
    color: #ffffff;
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    color: #94a3b8;
}

.footer-links a:hover {
    color: #ffffff;
}

.footer-bottom {
    border-top: 1px solid #1e293b;
    padding-top: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
}

/* Hamburger button for mobile */
.hamburger-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    color: var(--text-main);
}

/* ==========================================================================
   GENRE SHOWCASE GRID & COLORFUL CARDS WITH BACKGROUND ARTWORK
   ========================================================================== */
.genres-explore-section {
    margin-top: 36px;
    margin-bottom: 36px;
}

.genres-vibrant-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 14px;
}

@media (max-width: 1200px) {
    .genres-vibrant-grid { grid-template-columns: repeat(4, 1fr); gap: 12px; }
}
@media (max-width: 768px) {
    .genres-vibrant-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
}
@media (max-width: 480px) {
    .genres-vibrant-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
}

.genre-showcase-card {
    position: relative;
    background-color: #0b1120;
    background-size: cover;
    background-position: center;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 16px;
    padding: 14px 15px;
    min-height: 108px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease, border-color 0.3s ease;
    text-decoration: none;
    color: #ffffff;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

/* Thematic Category Background Image Element */
.genre-bg-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transform: scale(1);
    transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1), filter 0.5s ease;
    filter: brightness(0.95) saturate(1.15);
    pointer-events: none;
    z-index: 1;
}

/* Vibrant Multi-stop Color Gradient Overlay */
.genre-card-glow {
    position: absolute;
    inset: 0;
    background: var(--genre-gradient);
    opacity: 0.84;
    mix-blend-mode: multiply;
    transition: opacity 0.35s ease;
    z-index: 2;
    pointer-events: none;
}

/* Bottom Darkening Mask for Text Contrast */
.genre-card-mask {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.88) 0%, rgba(0, 0, 0, 0.35) 60%, rgba(0, 0, 0, 0.08) 100%);
    transition: opacity 0.3s ease;
    z-index: 3;
    pointer-events: none;
}

.genre-card-pattern {
    position: absolute;
    right: -6px;
    bottom: -6px;
    width: 64px;
    height: 64px;
    opacity: 0.18;
    color: var(--genre-accent);
    pointer-events: none;
    transform: rotate(-10deg);
    transition: transform 0.3s ease, opacity 0.3s ease;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
}

.genre-card-pattern svg {
    width: 100%;
    height: 100%;
}

.genre-card-content {
    position: relative;
    z-index: 4;
    display: flex;
    flex-direction: column;
    height: 100%;
    justify-content: space-between;
}

.genre-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}

.genre-icon-pill {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.22);
    color: #ffffff;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.genre-icon-pill svg {
    width: 17px;
    height: 17px;
    color: var(--genre-accent);
}

.genre-series-count {
    font-size: 11px;
    font-weight: 800;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    letter-spacing: 0.3px;
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.genre-card-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    margin-top: 14px;
}

.genre-card-title {
    font-size: 14.5px;
    font-weight: 900;
    color: #ffffff;
    letter-spacing: -0.2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.9);
}

.genre-card-arrow {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    transition: transform 0.25s ease, background 0.25s ease, color 0.25s ease;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

/* Hover States */
.genre-showcase-card:hover {
    transform: translateY(-5px);
    border-color: rgba(255, 255, 255, 0.45);
    box-shadow: 0 16px 28px -6px var(--genre-glow), 0 6px 14px rgba(0, 0, 0, 0.4);
}

.genre-showcase-card:hover .genre-bg-image {
    transform: scale(1.15);
    filter: brightness(1.05) saturate(1.25);
}

.genre-showcase-card:hover .genre-card-glow {
    opacity: 0.95;
}

.genre-showcase-card:hover .genre-icon-pill {
    transform: scale(1.15) rotate(6deg);
    box-shadow: 0 0 14px var(--genre-glow);
}

.genre-showcase-card:hover .genre-card-pattern {
    transform: scale(1.3) rotate(0deg);
    opacity: 0.3;
}

.genre-showcase-card:hover .genre-card-arrow {
    transform: translateX(3px);
    background: #ffffff;
    color: #090d16;
}

.hero-details-btn {
    background: #ffffff !important;
    border: 1px solid #ffffff !important;
    color: #090d16 !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
}

.hero-details-btn:hover {
    background: #f1f5f9 !important;
    border-color: #f1f5f9 !important;
    color: #000000 !important;
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5);
}

/* ==========================================================================
   GOOGLE RECAPTCHA V3 SPAM PROTECTION BADGE STYLING
   ========================================================================== */
.recaptcha-v3-badge-container {
    margin: 14px 0 16px;
    display: block;
    width: 100%;
}

.recaptcha-v3-badge {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: rgba(24, 24, 27, 0.7);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: all 0.2s ease;
}

.recaptcha-v3-badge:hover {
    border-color: rgba(59, 130, 246, 0.6);
    background: rgba(30, 41, 59, 0.85);
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.2);
}

.recaptcha-v3-icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.recaptcha-v3-text {
    flex: 1;
    min-width: 0;
}

.recaptcha-v3-headline {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 2px;
}

.recaptcha-brand {
    font-size: 12px;
    font-weight: 700;
    color: #f4f4f5;
    letter-spacing: -0.1px;
}

.recaptcha-badge-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.28);
    padding: 1px 6px;
    border-radius: 999px;
}

.recaptcha-legal {
    font-size: 11px;
    color: #94a3b8;
    line-height: 1.4;
}

.recaptcha-legal a {
    color: #60a5fa;
    text-decoration: none;
    transition: color 0.15s ease;
}

.recaptcha-legal a:hover {
    color: #93c5fd;
    text-decoration: underline;
}

/* Ensure Google floating badge is always visible and above footer */
.grecaptcha-badge {
    z-index: 999999 !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4) !important;
}

/* ==========================================================================
   Mobile Performance & CLS Prevention Core Rules
   ========================================================================== */
.series-card-cover {
    position: relative;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    background: #0f172a;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    display: block;
}

.series-card-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.hero-slider-section {
    min-height: 320px;
}
@media (max-width: 768px) {
    .hero-slider-section {
        min-height: 280px;
    }

    /* Global touch target sizes for buttons and pagination on mobile */
    .btn {
        min-height: 44px;
        box-sizing: border-box;
    }

    .pagination-wrapper {
        display: flex;
        align-items: center;
        justify-content: center;
        flex-wrap: wrap;
        gap: 6px;
        margin: 24px 0;
    }

    .pagination-btn {
        min-width: 44px;
        min-height: 44px;
        padding: 10px 14px;
        font-size: 14px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border-radius: var(--radius-md);
        box-sizing: border-box;
        text-decoration: none;
    }
}

/* ==========================================================================
   ADVERTISEMENT SLOTS STYLING & DEVICE RESPONSIVENESS
   ========================================================================== */
.ad-slot-wrapper,
.sp-banner-frame {
    margin: 16px auto;
    text-align: center;
    width: 100%;
    max-width: 100%;
    clear: both;
    position: relative;
    box-sizing: border-box;
}

.ad-slot-wrapper .ad-label,
.sp-banner-frame .ad-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted, #94a3b8);
    opacity: 0.7;
    margin-bottom: 5px;
}

.ad-slot-wrapper .ad-banner-link,
.sp-banner-frame .sp-banner-link {
    display: inline-block;
    max-width: 100%;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.ad-slot-wrapper .ad-banner-link:hover,
.sp-banner-frame .sp-banner-link:hover {
    transform: scale(1.01);
    opacity: 0.95;
}

.ad-slot-wrapper .ad-banner-img,
.sp-banner-frame .sp-banner-img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
    display: block;
    margin: 0 auto;
}

.ad-slot-wrapper .ad-code-inner,
.sp-banner-frame .sp-ad-code {
    width: 100% !important;
    max-width: 100% !important;
    display: block !important;
    margin: 0 auto !important;
    text-align: center !important;
    min-height: 40px;
    box-sizing: border-box !important;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
}

/* Ensure any iframe, canvas, ins (AdSense/Adsterra/ExoClick) scales inside mobile viewport */
.ad-slot-wrapper .ad-code-inner iframe,
.ad-slot-wrapper .ad-code-inner ins,
.ad-slot-wrapper .ad-code-inner img,
.sp-banner-frame .sp-ad-code iframe,
.sp-banner-frame .sp-ad-code ins,
.sp-banner-frame .sp-ad-code img {
    max-width: 100% !important;
    box-sizing: border-box !important;
    margin: 0 auto !important;
}

.ad-slot-wrapper.ad-slot-header,
.sp-banner-frame.ad-slot-header {
    margin: 12px auto 16px;
    max-width: 970px;
}

.ad-slot-wrapper.ad-slot-series_page,
.ad-slot-wrapper.ad-slot-sidebar,
.sp-banner-frame.ad-slot-series_page,
.sp-banner-frame.ad-slot-sidebar {
    max-width: 340px;
    margin: 15px auto;
}

.ad-slot-wrapper.ad-slot-reader_top,
.ad-slot-wrapper.ad-slot-reader_middle,
.ad-slot-wrapper.ad-slot-reader_bottom,
.sp-banner-frame.ad-slot-reader_top,
.sp-banner-frame.ad-slot-reader_middle,
.sp-banner-frame.ad-slot-reader_bottom {
    max-width: 800px;
    margin: 20px auto;
}

/* Device Display Rules (Supporting LiteSpeed-Cached Responsive Pages) */
.sp-ad-desktop,
.ad-desktop-only {
    display: block !important;
}
.sp-ad-mobile,
.ad-mobile-only {
    display: none !important;
}

@media (max-width: 767px) {
    .sp-ad-desktop,
    .ad-desktop-only {
        display: none !important;
    }
    .sp-ad-mobile,
    .ad-mobile-only {
        display: block !important;
    }
    .ad-slot-wrapper,
    .sp-banner-frame {
        padding: 0 8px;
        margin: 14px auto;
    }
}

/* ==========================================================================
   MOBILE-FIRST RESPONSIVE ADAPTATIONS (MERGED FOR PEAK WEBVITALS)
   ========================================================================== */
@media (max-width: 1024px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 30px;
    }
}

@media (max-width: 768px) {
    .nav-desktop {
        display: none;
    }

    .site-header {
        height: 60px;
    }

    .header-inner {
        padding: 0 12px;
    }

    .hamburger-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 48px;
        height: 48px;
        min-width: 48px;
        min-height: 48px;
        background: transparent;
        border: none;
        cursor: pointer;
        padding: 10px;
        border-radius: var(--radius-md);
    }

    .hamburger-btn:active {
        background: rgba(0, 0, 0, 0.05);
    }

    .header-search {
        display: none;
    }

    .mobile-search-toggle-btn {
        display: inline-flex;
    }

    .header-actions .btn {
        min-height: 44px;
        min-width: 44px;
        padding: 10px 16px;
        font-size: 13.5px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        box-sizing: border-box;
    }

    .site-logo {
        min-height: 48px;
        display: flex;
        align-items: center;
    }

    .site-logo-img, .site-logo-img-mobile {
        height: 42px;
        max-height: 46px;
        width: auto;
        max-width: 180px;
        object-fit: contain;
        display: block;
    }

    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="search"],
    select,
    textarea {
        font-size: 16px !important;
        min-height: 44px;
        border-radius: var(--radius-md);
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .footer-links a {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        padding: 4px 0;
        font-size: 14.5px;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }

    .auth-card {
        padding: 30px 20px;
    }
}

.mobile-drawer {
    position: fixed;
    top: 0;
    left: -100%;
    width: 290px;
    max-width: 85vw;
    height: 100vh;
    background: var(--bg-card);
    z-index: 999;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.2);
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 20px 16px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.mobile-drawer.open {
    left: 0;
}

#closeDrawerBtn {
    width: 48px;
    height: 48px;
    min-width: 48px;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    transition: background 0.15s ease;
}

#closeDrawerBtn:active {
    background: var(--border-subtle);
}

.mobile-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    z-index: 998;
    display: none;
}

.mobile-overlay.show {
    display: block;
}

.mobile-nav-links {
    list-style: none;
    margin-top: 16px;
}

.mobile-nav-links li {
    margin-bottom: 6px;
}

.mobile-nav-links a {
    display: flex;
    align-items: center;
    min-height: 48px;
    padding: 12px 14px;
    font-size: 15.5px;
    font-weight: 600;
    color: var(--text-main);
    border-radius: var(--radius-md);
    box-sizing: border-box;
    transition: background 0.15s ease, color 0.15s ease;
}

.mobile-nav-links a:hover,
.mobile-nav-links a:active {
    background: var(--primary-light);
    color: var(--primary);
}

@media (max-width: 480px) {
    button, 
    a.btn, 
    .btn,
    .filter-pill,
    .pagination-btn {
        min-height: 44px;
        min-width: 44px;
        box-sizing: border-box;
    }

    .site-header {
        height: 56px;
    }

    .site-logo-img, .site-logo-img-mobile {
        height: 38px;
        max-height: 42px;
        width: auto;
        max-width: 150px;
    }

    .series-card-cover {
        aspect-ratio: 3 / 4;
        contain-intrinsic-size: 160px 213px;
    }

    .series-card-cover img {
        aspect-ratio: 3 / 4;
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
    }
}

/* ==========================================================================
   Popular Tags Showcase Section
   ========================================================================== */
.popular-tags-section {
    margin-top: 36px;
    margin-bottom: 36px;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.7) 0%, rgba(9, 13, 22, 0.95) 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.popular-tags-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
}

.popular-tags-title-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
}

.popular-tags-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: rgba(244, 63, 94, 0.12);
    border: 1px solid rgba(244, 63, 94, 0.28);
    color: #f43f5e;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.popular-tags-title {
    font-size: 20px;
    font-weight: 800;
    color: #ffffff;
    margin: 0;
    letter-spacing: -0.02em;
}

.popular-tags-subtitle {
    font-size: 12.5px;
    color: var(--text-muted);
    margin: 2px 0 0;
}

.popular-tags-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.popular-tag-card {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 12px;
    color: #f1f5f9;
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 600;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    box-sizing: border-box;
}

.popular-tag-card:hover {
    background: rgba(244, 63, 94, 0.12);
    border-color: rgba(244, 63, 94, 0.4);
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(244, 63, 94, 0.2);
}

.popular-tag-hash {
    color: #f43f5e;
    font-weight: 800;
    font-size: 14px;
}

.popular-tag-count {
    font-size: 11px;
    font-weight: 700;
    font-family: monospace;
    padding: 1px 7px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: #94a3b8;
    transition: all 0.2s ease;
}

.popular-tag-card:hover .popular-tag-count {
    background: rgba(244, 63, 94, 0.3);
    color: #fecdd3;
}

.popular-tag-card.is-hot {
    border-color: rgba(245, 158, 11, 0.3);
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.08) 0%, rgba(255, 255, 255, 0.03) 100%);
}

.popular-tag-card.is-hot:hover {
    border-color: rgba(245, 158, 11, 0.5);
    background: rgba(245, 158, 11, 0.15);
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.25);
}

.popular-tag-card.is-hot .popular-tag-hash {
    color: #f59e0b;
}

@media (max-width: 768px) {
    .popular-tags-section {
        padding: 18px 16px;
        margin-top: 24px;
        margin-bottom: 24px;
    }
    .popular-tags-title {
        font-size: 18px;
    }
    .popular-tag-card {
        padding: 7px 12px;
        font-size: 12.5px;
    }
}
