/*
Theme Name: VREAD.TOP
Theme URI: https://vread.top
Author: NTN
Description: Giao diện WordPress cao cấp dành cho website Tiểu thuyết, Truyện chữ và Light Novel. Hỗ trợ hệ thống VIP, VietQR và tối ưu hóa trải nghiệm đọc.
Version: 1.1.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: vread-top
Tags: manga, webtoon, dark-mode, responsive, comic
*/

:root {
    /* Color Palette */
    --primary-color: #ff3d5a;
    --primary-hover: #e6354f;
    --background-dark: #0f0f0f;
    --surface-dark: #1a1a1a;
    --surface-lighter: #2a2a2a;
    --text-main: #ffffff;
    --text-muted: #b0b0b0;
    --border-color: #333333;
    
    /* Light Mode Variables (to be toggled) */
    --bg-light: #f4f4f4;
    --surface-light: #ffffff;
    --text-light: #333333;
    --text-muted-light: #666666;
    
    /* Layout Constants */
    --container-width: 1200px;
    --header-height: 70px;
    --border-radius: 8px;
    --transition: all 0.3s ease;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--background-dark);
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

body.light-mode {
    background-color: var(--bg-light);
    color: var(--text-light);
}

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

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

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* Anti-Copy Protection */
.chapter-content {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    font-size: 20px;
    line-height: 1.8;
}

/* Comments Section Styling */
.comments-area {
    margin-top: 40px;
    padding: 30px;
    border-top: 1px solid var(--border-color);
}
.reader-container.theme-sepia .comments-area { border-color: #d8cfb3; }
.reader-container.theme-dark .comments-area { border-color: #333; }

.comment-list { list-style: none; padding: 0; }
.comment { margin-bottom: 20px; padding-bottom: 20px; border-bottom: 1px dashed rgba(128,128,128,0.2); }
.comment-author cite { font-weight: bold; font-style: normal; }
.comment-meta { font-size: 12px; opacity: 0.7; margin-bottom: 10px; }

.comment-respond { margin-top: 30px; }
.comment-form textarea { width: 100%; padding: 15px; border-radius: 8px; border: 1px solid rgba(128,128,128,0.3); background: rgba(128,128,128,0.05); color: inherit; }
.form-submit input { background: var(--primary-color); color: #fff; border: none; padding: 10px 25px; border-radius: 4px; cursor: pointer; font-weight: bold; }

/* ===== Reader Footer Navigation ===== */
.reader-footer-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 190;
    background: rgba(15, 15, 15, 0.97);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding: 8px 16px;
    padding-bottom: max(8px, env(safe-area-inset-bottom));
}

.footer-nav-buttons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    max-width: 400px;
    margin: 0 auto;
}

.btn-chapter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 13px;
    text-decoration: none;
    transition: all 0.25s ease;
    cursor: pointer;
    flex: 1;
    border: 2px solid transparent;
}

.btn-chapter i {
    font-size: 16px;
    line-height: 1;
}

.btn-prev {
    background: rgba(255, 255, 255, 0.08);
    color: #e0e0e0;
    border-color: rgba(255, 255, 255, 0.12);
}
.btn-prev:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.btn-toc {
    background: rgba(255, 61, 90, 0.1);
    color: var(--primary-color);
    border-color: rgba(255, 61, 90, 0.25);
}
.btn-toc:hover {
    background: rgba(255, 61, 90, 0.2);
}

.btn-next {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}
.btn-next:hover {
    background: var(--primary-hover);
}

.btn-chapter[href="#"] {
    opacity: 0.3;
    pointer-events: none;
}

/* Theme overrides for footer nav */
.reader-container.theme-light .reader-footer-nav {
    background: rgba(255, 255, 255, 0.97);
    border-top-color: rgba(0, 0, 0, 0.1);
}
.reader-container.theme-light .btn-prev {
    background: rgba(0, 0, 0, 0.05);
    color: #333;
    border-color: rgba(0, 0, 0, 0.12);
}

.reader-container.theme-sepia .reader-footer-nav {
    background: rgba(235, 225, 200, 0.97);
    border-top-color: rgba(91, 70, 54, 0.12);
}
.reader-container.theme-sepia .btn-prev {
    background: rgba(91, 70, 54, 0.08);
    color: #5b4636;
    border-color: rgba(91, 70, 54, 0.15);
}

/* ===== Mobile Optimizations ===== */
@media screen and (max-width: 768px) {
    /* Hide site header ad on mobile */
    .ad-global-header { display: none !important; }

    /* Hide desktop ads in reader */
    .ad-reader-top { display: none !important; }

    /* Reader - Reduce padding for more reading space */
    .reader-area {
        padding: 16px 0 30px !important;
    }
    .container-narrow {
        padding: 0 16px !important;
    }

    /* Chapter title sizing */
    .chapter-title {
        font-size: 1.2rem !important;
        line-height: 1.4 !important;
        margin-bottom: 8px !important;
    }

    /* Content optimization for mobile reading */
    .chapter-content {
        font-size: 18px !important;
        line-height: 1.85 !important;
    }
    .chapter-content p {
        margin-bottom: 20px !important;
    }

    /* Reader header compact */
    .reader-header {
        margin-bottom: 20px !important;
        padding-bottom: 12px !important;
    }
    .reader-meta {
        gap: 12px !important;
        font-size: 12px !important;
    }

    /* Home - Hero Slider to Horizontal Scroll */
    .hero-slider {
        display: flex !important;
        overflow-x: auto !important;
        scroll-snap-type: x mandatory;
        gap: 15px;
        padding-bottom: 20px;
        -webkit-overflow-scrolling: touch;
        margin: 0 -20px;
        padding: 0 20px 20px;
    }
    .slider-item {
        flex: 0 0 85% !important;
        min-width: 280px;
        height: 180px !important;
        scroll-snap-align: start;
        border-radius: 12px;
    }
    .slider-content {
        padding: 15px !important;
    }
    .slider-content h3 { font-size: 1.2rem !important; }
    .slider-content p { display: none; }
}
