@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@300;400;700&family=Plus+Jakarta+Sans:wght@300;400;600;800&display=swap');

:root {
    --accent: #104E4F;
    --accent-light: #1a7a7b;
    --bg-dark: #010101;
    --bg-card: rgba(255, 255, 255, 0.03);
    --border-glass: rgba(255, 255, 255, 0.08);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.6);
}

/* Themes */
body.theme-default {
    --accent: #104E4F;
    --accent-light: #1a7a7b;
    --bg-dark: #010101;
    --bg-card: rgba(255, 255, 255, 0.03);
    --border-glass: rgba(255, 255, 255, 0.08);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.6);
}

body.theme-midnight {
    --accent: #3730a3;
    --accent-light: #4338ca;
    --accent-glow: rgba(55, 48, 163, 0.4);
    --bg-dark: #020617;
}

body.theme-crimson {
    --accent: #7f1d1d;
    --accent-light: #991b1b;
    --accent-glow: rgba(127, 29, 29, 0.4);
    --bg-dark: #1e0000;
}

body.theme-emerald {
    --accent: #064e3b;
    --accent-light: #065f46;
    --accent-glow: rgba(6, 78, 59, 0.4);
    --bg-dark: #000c0a;
}

body.theme-cyberpunk {
    --accent: #ff0055;
    --accent-light: #ff3377;
    --accent-glow: rgba(255, 0, 85, 0.4);
    --bg-dark: #0d001a;
}

body.theme-classic {
    --accent: #1e1e1e;
    --accent-light: #333333;
    --accent-glow: rgba(30, 30, 30, 0.4);
    --bg-dark: #0f172a;
}

/* New Atmospheric Themes with Backgrounds */
body.theme-hazy-morning {
    --accent: #94a3b8;
    --accent-light: #cbd5e1;
    --accent-glow: rgba(148, 163, 184, 0.4);
    --bg-dark: #0f172a;
}

body.theme-early-sunrise {
    --accent: #f59e0b;
    --accent-light: #fbbf24;
    --accent-glow: rgba(245, 158, 11, 0.4);
    --bg-dark: #1a1001;
}

body.theme-summer-evening {
    --accent: #8b5cf6;
    --accent-light: #a78bfa;
    --accent-glow: rgba(139, 92, 246, 0.4);
    --bg-dark: #12002b;
}

body.theme-starry-night {
    --accent: #1e293b;
    --accent-light: #334155;
    --accent-glow: rgba(30, 41, 59, 0.4);
    --bg-dark: #020617;
}

body.theme-rainy-day {
    --accent: #475569;
    --accent-light: #64748b;
    --accent-glow: rgba(71, 85, 105, 0.4);
    --bg-dark: #0c111a;
}

body.theme-velvet-sky {
    --accent: #be123c;
    --accent-light: #e11d48;
    --accent-glow: rgba(190, 18, 60, 0.4);
    --bg-dark: #120101;
}

body.theme-cotton-candy {
    --accent: #f472b6;
    --accent-light: #fbcfe8;
    --accent-glow: rgba(244, 114, 182, 0.4);
    --bg-dark: #1a011a;
}

body.theme-winter-night {
    --accent: #0ea5e9;
    --accent-light: #38bdf8;
    --accent-glow: rgba(14, 165, 233, 0.4);
    --bg-dark: #010c1a;
}

body.theme-bright-day {
    --accent: #d97706; /* Deeper amber for contrast */
    --accent-light: #f59e0b;
    --accent-glow: rgba(217, 119, 6, 0.2);
    --bg-dark: #fbfbfb; /* Light Background */
    --text-primary: #1e293b; /* Dark Text */
    --text-secondary: #475569;
    --bg-card: rgba(0, 0, 0, 0.04);
    --border-glass: rgba(0, 0, 0, 0.08);
}

body.theme-bright-day .glass {
    background: rgba(0, 0, 0, 0.02) !important;
    border-color: rgba(0, 0, 0, 0.08) !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05) !important;
    color: var(--text-primary) !important;
}

body.theme-bright-day .nav-pill {
    background: rgba(255, 255, 255, 0.8) !important;
    border-color: rgba(0, 0, 0, 0.1) !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1) !important;
}

body.theme-bright-day .nav-link {
    color: var(--text-secondary) !important;
}

body.theme-bright-day .nav-link.active,
body.theme-bright-day .nav-link:hover {
    background: var(--accent) !important;
    color: #ffffff !important;
}

body.theme-pastel-dreams {
    --accent: #a78bfa;
    --accent-light: #c4b5fd;
    --accent-glow: rgba(167, 139, 250, 0.4);
    --bg-dark: #0c011a;
}

body.theme-midnight-thunder {
    --accent: #4f46e5;
    --accent-light: #6366f1;
    --accent-glow: rgba(79, 70, 229, 0.4);
    --bg-dark: #00021a;
}

body.theme-warm-days {
    --accent: #ea580c;
    --accent-light: #f97316;
    --accent-glow: rgba(234, 88, 12, 0.4);
    --bg-dark: #1a0800;
}

body.theme-bright-day .text-white {
    color: var(--text-primary) !important;
}

/* Re-allow white text for dark elements/buttons in Bright Day theme */
body.theme-bright-day .bg-accent .text-white,
body.theme-bright-day .bg-indigo-600,
body.theme-bright-day .bg-indigo-500,
body.theme-bright-day .bg-gray-600,
body.theme-bright-day .bg-gray-700,
body.theme-bright-day .btn-primary,
body.theme-bright-day .bg-blue-600,
body.theme-bright-day .bg-green-600 {
    color: #ffffff !important;
}

body.theme-bright-day .text-secondary {
    color: var(--text-secondary) !important;
}

body.theme-bright-day .text-white\/40,
body.theme-bright-day .text-white\/50,
body.theme-bright-day .text-white\/60,
body.theme-bright-day .text-gray-300,
body.theme-bright-day .text-gray-400 {
    color: var(--text-secondary) !important;
}

body.theme-bright-day h1, 
body.theme-bright-day h2, 
body.theme-bright-day h3,
body.theme-bright-day h4,
body.theme-bright-day h5 {
    color: var(--text-primary) !important;
}

/* Background & Border Overrides for Light Mode */
body.theme-bright-day,
body.theme-bright-day.bg-\[\#010101\],
body.theme-bright-day .bg-\[\#010101\],
body.theme-bright-day.bg-gray-900,
body.theme-bright-day .bg-black,
body.theme-bright-day .bg-gray-900,
body.theme-bright-day .bg-gray-800,
body.theme-bright-day .bg-\[\#050505\],
body.theme-bright-day .bg-\[\#080808\],
body.theme-bright-day section.bg-black,
body.theme-bright-day footer.bg-black {
    background-color: var(--bg-dark) !important;
}

body.theme-bright-day .bg-white\/5,
body.theme-bright-day .bg-white\/10 {
    background-color: rgba(0, 0, 0, 0.03) !important;
}

body.theme-bright-day .border-white\/10,
body.theme-bright-day .border-white\/5 {
    border-color: rgba(0, 0, 0, 0.1) !important;
}

body.theme-bright-day .glass {
    background: rgba(255, 255, 255, 0.7) !important;
    border-color: rgba(0, 0, 0, 0.1) !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05) !important;
}

/* Component Specific Fixes */
body.theme-bright-day .pub-card {
    background: #ffffff !important;
    border-color: rgba(0, 0, 0, 0.08) !important;
}

body.theme-bright-day .pub-card.expanded {
    background: #f8fafc !important;
}

body.theme-bright-day .sw-card {
    background: #ffffff !important;
}

body.theme-bright-day header,
body.theme-bright-day nav.sticky {
    background: rgba(255, 255, 255, 0.85) !important;
    backdrop-filter: blur(20px) !important;
    border-color: rgba(0, 0, 0, 0.1) !important;
}

body.theme-bright-day header a,
body.theme-bright-day header .text-secondary {
    color: var(--text-primary) !important;
}

body.theme-bright-day .text-indigo-300,
body.theme-bright-day .text-indigo-400 {
    color: #4338ca !important; /* Darker indigo for better contrast on light */
}

.text-accent {
    color: var(--accent) !important;
}

.bg-accent {
    background-color: var(--accent) !important;
}

.border-accent {
    border-color: var(--accent) !important;
}

.border-accent {
    border-color: var(--accent) !important;
}

.decoration-accent {
    text-decoration-color: var(--accent) !important;
}

.text-primary {
    color: var(--text-primary) !important;
}

.text-secondary {
    color: var(--text-secondary) !important;
}

.bg-dark {
    background-color: var(--bg-dark) !important;
}

.bg-card {
    background-color: var(--bg-card) !important;
}

.border-glass {
    border-color: var(--border-glass) !important;
}

body {
    transition: background-color 0.3s ease;
}

* {
    transition: border-color 0.3s ease, background-color 0.3s ease, color 0.3s ease;
}

.transition-none {
    transition: none !important;
}

body {
    background-color: var(--bg-dark) !important;
    color: var(--text-primary) !important;
    font-family: 'Plus Jakarta Sans', sans-serif;
    margin: 0;
    padding: 0;
}

.font-mono {
    font-family: 'JetBrains Mono', monospace;
}

/* Glassmorphism */
.glass {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    backdrop-filter: blur(25px) saturate(200%);
    -webkit-backdrop-filter: blur(25px) saturate(200%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
}

.glass:hover {
    border-color: var(--accent);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.07));
}

/* Navigation Pill */
.nav-pill {
    position: fixed;
    bottom: 2.5rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem;
    border-radius: 100px;
    z-index: 5000;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(10, 10, 10, 0.4);
    backdrop-filter: blur(30px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 80px rgba(0, 0, 0, 0.6);
}

.nav-link {
    padding: 0.7rem 1.4rem;
    border-radius: 100px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.7rem;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    transition: all 0.3s ease;
}

.nav-link:hover, .nav-link.active {
    background: white;
    color: black;
}

#auth-button {
    background: transparent;
    border: none;
    cursor: pointer;
}

/* Animations */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Accent elements */
.text-accent {
    color: var(--accent);
}

.bg-accent {
    background-color: var(--accent);
}

.border-accent {
    border-color: var(--accent);
}

/* Typography */
h1,
h2,
h3,
h4,
h5 {
    font-weight: 800;
    letter-spacing: -0.02em;
}

.section-title {
    font-size: 3.5rem;
    font-weight: 900;
    margin-bottom: 3rem;
    text-transform: uppercase;
    line-height: 0.9;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 10px;
}

/* Buttons */
.btn-primary {
    background: var(--accent);
    color: white;
    padding: 0.8rem 2rem;
    border-radius: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(16, 78, 79, 0.3);
}

/* Internal Page Specific Adjustments */
header {
    background: rgba(5, 5, 5, 0.8) !important;
    border-bottom: 1px dashed var(--border-glass);
}

.scroll-spy-nav a.active {
    color: var(--accent) !important;
}

.scroll-spy-nav a.active::before {
    background-color: var(--accent) !important;
}

/* Framer-style Stacked Book Gallery */
.book-gallery-container {
    perspective: 2000px;
}

.book-stack-framer {
    transform-style: preserve-3d;
}

.book-card-framer {
    will-change: transform;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.book-card-framer:hover {
    box-shadow: 0 40px 80px -12px rgba(0, 0, 0, 0.7);
}

#book-modal {
    transition: backdrop-filter 0.5s ease;
}

#modal-book-img {
    box-shadow: 0 50px 100px -20px rgba(0,0,0,0.8);
    border: 1px solid rgba(255,255,255,0.1);
}