/* =========================================================
   VARIABLES & THEME CONFIGURATION
   ========================================================= */
:root {
    --bg: #FAFAFA; 
    --fg: #1A1A1A; 
    --accent: #1F4788; 
    --border: #E0E0E0;
    --highlight: #FFF9E6; 
    --serif: 'Georgia', serif;
    --sans: 'Plus Jakarta Sans', -apple-system, sans-serif;
    --sidebar-width: 330px; 
    --header-height: 60px;
}

body.dark-mode {
    --bg: #0A0A0A; 
    --fg: #E5E5E5;
    --accent: #5B8FD9;
    --border: #2A2A2A;
    --highlight: #1A1A00;
}

/* =========================================================
   GLOBAL RESET
   ========================================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

html { scroll-behavior: smooth; }

body {
    background-color: var(--bg);
    color: var(--fg);
    font-family: var(--serif);
    line-height: 1.8;
}

/* =========================================================
   LAYOUT & APP CONTAINER
   ========================================================= */
#app-container {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

/* =========================================================
   SIDEBAR NAVIGATION
   ========================================================= */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg);
    border-right: 1px solid var(--border);
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    overflow-y: auto;
    z-index: 100;
}

.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb { background-color: var(--border); border-radius: 10px; }

.sidebar-header {
    padding: 30px 25px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-header h2 {
    font-family: var(--sans);
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.mobile-close-btn {
    display: none;
    background: none;
    border: none;
    font-size: 20px;
    color: var(--fg);
    cursor: pointer;
}

.nav-links {
    padding: 10px 0;
    display: flex;
    flex-direction: column;
}

.nav-part-label {
    font-family: var(--sans);
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 25px 25px 10px 25px;
    opacity: 0.8;
}

.nav-link {
    padding: 10px 25px;
    color: var(--fg);
    text-decoration: none;
    font-family: var(--sans);
    font-size: 0.9rem;
    font-weight: 600;
    border-left: 3px solid transparent;
    opacity: 0.8;
    line-height: 1.4;
}

.nav-link:hover {
    background-color: rgba(31, 71, 136, 0.05);
    opacity: 1;
}

body.dark-mode .nav-link:hover {
    background-color: rgba(91, 143, 217, 0.1);
}

.nav-link.active {
    border-left-color: var(--accent);
    color: var(--accent);
    opacity: 1;
    background-color: rgba(31, 71, 136, 0.05);
}

body.dark-mode .nav-link.active {
    background-color: rgba(91, 143, 217, 0.1);
}

.lock-sm {
    font-size: 0.85em;
    margin-right: 8px;
    opacity: 0.6;
}

/* =========================================================
   MAIN CONTENT AREA & HEADER
   ========================================================= */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
}

.top-header {
    height: var(--header-height);
    background-color: var(--bg);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 0 30px;
    position: sticky;
    top: 0;
    z-index: 90;
}

.mobile-menu-btn {
    display: none;
    font-size: 22px;
    color: var(--fg);
    cursor: pointer;
    margin-right: auto;
}

.theme-toggle {
    background: none;
    border: none;
    font-size: 20px;
    color: var(--fg);
    cursor: pointer;
    opacity: 0.7;
}

.theme-toggle:hover { opacity: 1; }

.book-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 50px 30px 100px;
    width: 100%;
}

/* Cover Image Styles */
.cover-container {
    text-align: center;
    margin-bottom: 60px;
}

.cover-container img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.2);
    border: 1px solid var(--border);
}

/* =========================================================
   TYPOGRAPHY & CONTENT STYLES
   ========================================================= */
.chapter-content {
    margin-bottom: 80px;
}

.chapter-label {
    font-family: var(--sans);
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 2px;
    display: block;
    margin-bottom: 15px;
}

.chapter-title {
    font-family: var(--sans);
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 40px;
    line-height: 1.2;
    color: var(--fg);
}

/* HIGHLIGHTED UPDATE: Headings ab Accent color (Blue) mein hongi */
.chapter-content h3 {
    font-family: var(--sans);
    font-size: 1.5rem;
    margin: 40px 0 20px;
    color: var(--accent);
    font-weight: 700;
}

.chapter-content h4 {
    font-family: var(--sans);
    font-size: 1.2rem;
    margin: 30px 0 15px;
    color: var(--accent);
}

.chapter-content p {
    font-size: 1.15rem;
    margin-bottom: 25px;
    color: var(--fg);
    text-align: justify;
}

.chapter-content em {
    color: var(--accent);
    font-style: italic;
}

.chapter-content strong {
    font-weight: 700;
    color: var(--fg);
}

/* =========================================================
   FRAMEWORKS & BOXES
   ========================================================= */
.framework-box, .tactical-box, .summary-box {
    background-color: var(--highlight);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 30px;
    margin: 40px 0;
}

.tactical-box {
    background-color: rgba(31, 71, 136, 0.03);
    border-left: 4px solid var(--accent);
}

body.dark-mode .tactical-box {
    background-color: rgba(91, 143, 217, 0.05);
}

.box-title {
    font-family: var(--sans);
    font-weight: 700;
    font-size: 1.1rem;
    display: block;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--accent);
}

/* List Styling (Bullet points with arrows) */
.check-list {
    list-style-type: none;
    margin-bottom: 25px;
}

.check-list li {
    position: relative;
    padding-left: 25px;
    margin-bottom: 12px;
    font-size: 1.1rem;
}

.check-list li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--accent);
    font-weight: bold;
}

/* =========================================================
   PAYWALL & LOCKED CONTENT STYLES
   ========================================================= */
.paywall-banner {
    background: linear-gradient(135deg, rgba(31, 71, 136, 0.05), rgba(31, 71, 136, 0.15));
    border: 1px solid var(--accent);
    border-radius: 12px;
    padding: 50px 20px;
    text-align: center;
    margin: 60px 0;
    backdrop-filter: blur(5px);
}

body.dark-mode .paywall-banner {
    background: linear-gradient(135deg, rgba(91, 143, 217, 0.08), rgba(91, 143, 217, 0.18));
}

.paywall-banner .lock-icon {
    font-size: 45px;
    color: var(--accent);
    margin-bottom: 20px;
}

.paywall-banner h3 {
    font-family: var(--sans);
    font-size: 26px;
    color: var(--fg);
    margin-bottom: 12px;
}

.paywall-banner p {
    color: var(--fg);
    opacity: 0.8;
    margin-bottom: 30px;
    font-size: 16px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
    text-align: center;
}

.buy-button {
    display: inline-block;
    background: var(--accent);
    color: #ffffff !important;
    padding: 14px 35px;
    border-radius: 50px;
    text-decoration: none;
    font-family: var(--sans);
    font-weight: 700;
    font-size: 16px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(31, 71, 136, 0.3);
    border: none;
    cursor: pointer;
}

body.dark-mode .buy-button {
    color: #0A0A0A !important;
    box-shadow: 0 4px 15px rgba(91, 143, 217, 0.3);
}

.buy-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(31, 71, 136, 0.4);
}

body.dark-mode .buy-button:hover {
    box-shadow: 0 6px 20px rgba(91, 143, 217, 0.4);
}

/* Paywall Modal (Popup) */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 1;
    visibility: visible;
    transition: all 0.3s ease;
}

.modal-overlay.hidden {
    opacity: 0;
    visibility: hidden;
}

.modal-card {
    background: var(--bg);
    padding: 50px 40px;
    border-radius: 16px;
    text-align: center;
    max-width: 450px;
    width: 90%;
    position: relative;
    transform: translateY(0);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid var(--border);
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}

.modal-overlay.hidden .modal-card {
    transform: translateY(30px) scale(0.95);
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    font-size: 24px;
    color: var(--fg);
    opacity: 0.5;
    cursor: pointer;
    transition: opacity 0.3s;
}

.close-modal:hover { opacity: 1; }

.modal-lock-icon {
    font-size: 50px;
    color: var(--accent);
    margin-bottom: 25px;
}

.modal-card h3 {
    margin-bottom: 12px;
    font-size: 24px;
    font-family: var(--sans);
    color: var(--fg);
}

.modal-card p {
    margin-bottom: 30px;
    opacity: 0.8;
    line-height: 1.6;
    color: var(--fg);
    text-align: center;
}

/* =========================================================
   MISCELLANEOUS (Back to top, Nav Pill)
   ========================================================= */
.back-to-top-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--accent);
    color: #fff;
    border: none;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    z-index: 1000;
}

.back-to-top-btn.show { opacity: 1; visibility: visible; transform: translateY(0); }

.nav-pill {
    display: none;
    position: fixed;
    bottom: 25px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--fg);
    color: var(--bg);
    padding: 12px 30px;
    border-radius: 50px;
    gap: 30px;
    z-index: 1001;
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
}

.nav-pill i { font-size: 18px; cursor: pointer; }

/* =========================================================
   RESPONSIVE DESIGN
   ========================================================= */
@media (max-width: 1024px) {
    .chapter-title { font-size: 2rem; }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .sidebar.active { transform: translateX(0); }
    
    .main-content { margin-left: 0; }
    
    .top-header { justify-content: space-between; }
    
    .mobile-menu-btn, .mobile-close-btn, .nav-pill {
        display: flex;
        align-items: center;
    }
    
    .theme-toggle { display: none; }
    
    .book-container { padding: 30px 20px 80px; }
    
    .chapter-content p { font-size: 1.05rem; }
    
    .paywall-banner { padding: 40px 15px; }
}