@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Inter:wght@400;500;600&display=swap');

:root {
    --bg-dark: #09090b; /* Zinc 950 for premium dark look */
    --bg-panel: rgba(24, 24, 27, 0.7); /* Zinc 900 */
    --bg-card: rgba(39, 39, 42, 0.6); /* Zinc 800 */
    --glass-border: rgba(157, 0, 255, 0.1);
    
    --primary-blue: #9D00FF;
    --primary-blue-glow: rgba(157, 0, 255, 0.3);
    --primary-blue-hover: #b033ff;

    --accent-orange: #f59e0b;
    --accent-purple: #8b5cf6;
    --accent-green: #10b981;
    --accent-red: #ef4444;

    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --text-dim: #6b7280;

    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    padding-top: 60px;
    padding-bottom: 60px;
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-body);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    /* Cyber grid background */
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.015) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
    background-size: 60px 60px;
    background-position: center top;
}

/* Add a glowing ambient light */
body::before {
    content: "";
    position: fixed;
    top: -20vh;
    left: -10vw;
    width: 60vw;
    height: 60vh;
    background: radial-gradient(circle, rgba(157, 0, 255, 0.08) 0%, transparent 70%);
    border-radius: 50%;
    z-index: -1;
    pointer-events: none;
}

body::after {
    content: "";
    position: fixed;
    bottom: -20vh;
    right: -10vw;
    width: 70vw;
    height: 70vh;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.05) 0%, transparent 70%);
    border-radius: 50%;
    z-index: -1;
    pointer-events: none;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.2;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color var(--transition-fast);
}

button {
    cursor: pointer;
    font-family: var(--font-heading);
    border: none;
    outline: none;
}

/* Glassmorphism Panel Utilities */
.glass-panel {
    background: var(--bg-panel);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* Global Header */
.header {
    position: sticky;
    top: 60px;
    z-index: 100;
    width: 100%;
    background: rgba(9, 9, 11, 0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.logo {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 5.4rem;
    letter-spacing: 2px;
    background: linear-gradient(90deg, #fff, var(--primary-blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 20px var(--primary-blue-glow);
    transition: transform var(--transition-bounce);
}

.logo:hover {
    transform: scale(1.05);
}

/* Cyber Button */
.cyber-btn {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(59, 130, 246, 0.05));
    border: 1px solid var(--primary-blue);
    color: var(--primary-blue);
    padding: 10px 24px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    transition: all var(--transition-smooth);
    position: relative;
    overflow: hidden;
}

.cyber-btn::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left var(--transition-smooth);
}

.cyber-btn:hover {
    background: var(--primary-blue);
    color: #fff;
    box-shadow: 0 0 15px var(--primary-blue-glow);
    transform: translateY(-2px);
}

.cyber-btn:hover::before {
    left: 100%;
}

.cyber-btn.variant-orange {
    border-color: var(--accent-orange);
    color: var(--accent-orange);
}
.cyber-btn.variant-orange:hover {
    background: var(--accent-orange);
    color: #fff;
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.4);
}

/* Scrollbar Customization */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-dark);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--primary-blue);
}

/* Footer Placeholder */
.site-footer {
    text-align: center;
    padding: 40px 20px;
    margin-top: 60px;
    border-top: 1px solid var(--glass-border);
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Mobile Utilities */
@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        justify-content: center;
    }
    .logo {
        font-size: 1.5rem;
    }
    .cyber-btn {
        padding: 8px 16px;
        font-size: 0.9rem;
    }
}


/* ADS SYSTEM */
.ads-flex-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0 !important;
    margin: 0 auto !important;
    width: 100%;
    padding: 0 !important;
}

.ad-link {
    pointer-events: auto;
    display: block;
    overflow: hidden;
    width: 100%;
    max-width: 1000px;
}

.ad-link:hover {
    transform: translateY(-2px);
}

.ad-link img {
    max-width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

/* Banner sizing constraints */
.top-banner img, .bottom-banner img {
    max-width: 1000px;
    width: 100%;
    height: 30px !important;
    object-fit: cover;
    display: block;
    border-radius: 0 !important;
}

.sidebar-ad img {
    max-width: 160px;
    margin: 0 auto;
}

.in-feed-ad {
    margin: 10px 0;
    width: 100%;
    text-align: center;
    display: flex;
    justify-content: center;
}

.end-chapter-ad {
    margin: 20px auto;
    display: block;
    max-width: 800px;
    text-align: center;
}
.end-chapter-ad img {
    width: 100%;
    border-radius: 12px;
}

.mid-chapter-ad {
    margin: 15px auto;
    display: block;
    max-width: 800px;
    text-align: center;
}
.mid-chapter-ad img {
    width: 100%;
    border-radius: 12px;
}


/* Sticky Sidebar Ads */
.sticky-sidebar-left, .sticky-sidebar-right {
    position: fixed;
    top: 60px;
    width: 160px;
    display: none; /* hidden by default on small screens */
    z-index: 10;
}
.sticky-sidebar-left { left: 15px; }
.sticky-sidebar-right { right: 15px; }

/* Responsive adjustments for sidebars */
@media (min-width: 1500px) {
    .sticky-sidebar-left, .sticky-sidebar-right { display: block; }
}

.sticky-sidebar-left, .sticky-sidebar-right { display: none !important; }

/* FIXED ADS CONTAINERS */
#top-ads-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 99999;
    pointer-events: none;
}
#bottom-ads-container {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    pointer-events: none;
}
.ad-link {
    pointer-events: auto;
    display: block;
    overflow: hidden;
    width: 100%;
    max-width: 1000px;
}

/* ADS CLOSE BUTTON & TOGGLE */
.ads-flex-container {
    position: relative;
}
.close-ads-btn {
    position: absolute;
    right: 5px;
    top: 5px;
    background: rgba(0,0,0,0.6);
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    z-index: 10;
    pointer-events: auto;
    display: flex;
    align-items: center;
    justify-content: center;
}
.close-ads-btn:hover {
    background: red;
}
body.top-ads-closed {
    padding-top: 0 !important;
}
body.bottom-ads-closed {
    padding-bottom: 0 !important;
}
body.top-ads-closed .header {
    top: 0 !important;
}

/* Logo Styling Global */
.ph-logo { display: flex; align-items: center; font-family: Arial, sans-serif; font-weight: 900; font-size: 26px; text-decoration: none; letter-spacing: -1px; cursor: pointer; border: 1px solid rgba(255,255,255,0.1); padding: 4px 6px; border-radius: 8px; background: rgba(0,0,0,0.5); }
.ph-gm { color: #fff !important; padding-right: 2px; }
.ph-hentai { color: #000 !important; background-color: #f9a826 !important; padding: 2px 6px; border-radius: 4px; margin-left: 2px; }

@media (max-width: 768px) {
    .ph-logo {
        display: flex !important;
        font-size: 20px !important;
        background: transparent !important;
        border: none !important;
    }
    .ph-gm { color: #fff !important; }
    .ph-hentai { color: #000 !important; background-color: #f9a826 !important; }
}

.vietsub-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    background-color: red;
    color: white;
    font-size: 10px;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 4px;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0,0,0,0.5);
    letter-spacing: 0.5px;
}
