/* =========================================
   ELITE GUIDE GLOBAL STYLES | Adeshjeet Official
   ========================================= */
/* =========================================
   GLOBAL RESET & SCROLL FIX
   ========================================= */
html, body {
    max-width: 100%;
    overflow-x: hidden; /* This absolutely kills the horizontal scrolling */
    margin: 0;
    padding: 0;
}

/* Ensures padding and borders don't increase the width of elements */
*, *::before, *::after {
    box-sizing: border-box; 
}

/* Prevents images from stretching outside their boxes */
img {
    max-width: 100%;
    height: auto;
}
/* --- NATIVE APP FEEL --- */
* {
    -webkit-tap-highlight-color: transparent; /* Removes blue box on Android/iOS */
    outline: none; /* Removes focus outline on Windows */
}

/* --- 1. RESET & BASE --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: var(--font-body);
    line-height: 1.6;
    font-size: 16px;
    /* The core transition for the "Vibe Switch" */
    transition: background-color 0.4s cubic-bezier(0.25, 0.8, 0.25, 1),
                color 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- 2. TYPOGRAPHY --- */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: var(--text-primary);
    margin-bottom: 0.5em;
    font-weight: 600;
    line-height: 1.2;
}

h1 { font-size: 2.5rem; letter-spacing: -1px; }
h2 { font-size: 2rem; letter-spacing: -0.5px; }
h3 { font-size: 1.5rem; }

p {
    margin-bottom: 1.5rem;
    color: var(--text-secondary); /* Slightly softer text for reading */
}

a {
    text-decoration: none;
    color: var(--accent);
    transition: 0.2s;
    font-weight: 500;
}

a:hover {
    text-decoration: underline;
    opacity: 0.8;
}

/* --- 3. CUSTOM SCROLLBAR (The "Elite" Polish) --- */
/* Works on Chrome, Edge, Safari */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent; 
}

::-webkit-scrollbar-thumb {
    background-color: rgba(128, 128, 128, 0.3);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background-color: var(--accent);
}

/* --- 4. LAYOUT HELPERS --- */
.wrapper {
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.main-content {
    flex: 1; /* Pushes footer down */
}

/* Center Content (for Login/Signup pages) */
.center-screen {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

/* --- 5. RESPONSIVE UTILITIES --- */
@media (max-width: 768px) {
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    
    /* --- FIXED CONTAINER --- */
.container {
    width: 100%;
    max-width: 1000px; /* Limits width so it doesn't stretch to corners */
    margin: 0 auto;    /* Centers it */
    padding: 20px;     /* Adds breathing room on sides */
    box-sizing: border-box;
    overflow-x: hidden; /* Prevents side-scrolling glitches */
}

/* Mobile Tweak */
@media (max-width: 768px) {
    .container {
        padding: 15px;
        width: 95%; /* Keeps a small gap on phones */
    }
}
}

/* --- 6. LOADING SKELETON (For data fetching) --- */
.skeleton {
    background: rgba(128, 128, 128, 0.1);
    border-radius: 4px;
    animation: skeleton-pulse 1.5s infinite ease-in-out;
}

@keyframes skeleton-pulse {
    0% { opacity: 0.6; }
    50% { opacity: 0.3; }
    100% { opacity: 0.6; }
}
/* --- SUBJECT PAGE FIXES --- */
/* Ensures content doesn't touch edges on any screen */
body {
    overflow-x: hidden; /* Stops horizontal scroll spread */
}

.container {
    width: 90%; /* Forces a 5% margin on both sides */
    max-width: 1000px;
    margin: 20px auto !important; /* Forces vertical spacing */
    padding: 0; /* Let the inner elements handle padding */
}

/* Fix for the Hero Section in Subjects */
.hero-section {
    border-radius: 20px;
    margin-bottom: 30px;
    box-shadow: var(--shadow-soft);
}

/* --- PDF ENGINE STYLES --- */
.pdf-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    margin-bottom: 50px;
}

.pdf-page {
    width: 100%;
    max-width: 800px;
    height: auto;
    box-shadow: var(--shadow-soft);
    border-radius: 8px;
    transition: filter 0.5s ease;
}

/* --- THEME MAGIC FOR PDFs --- */

/* 1. Light Mode (Default) - No change */
body.light-mode .pdf-page {
    filter: none;
}

/* 2. Hacker Mode (Invert Colors + Green Tint) */
body.amoled-mode .pdf-page {
    /* Inverts White to Black, then rotates hue to make text Greenish */
    filter: invert(1) hue-rotate(180deg) grayscale(0.2) contrast(1.2);
    box-shadow: 0 0 15px rgba(0, 255, 65, 0.2);
}

/* 3. Storybook Mode (Sepia + Soft) */
body.storybook-mode .pdf-page {
    filter: sepia(0.6) contrast(0.95) brightness(0.95);
}

/* Loading & Error States */
.loading-spinner { padding: 40px; text-align: center; color: var(--accent); font-weight: bold; }
.error-msg { padding: 40px; text-align: center; color: #EF4444; border: 1px dashed #EF4444; border-radius: 10px; }