/* --- PREMIUM DARK THEME VARIABLES --- */
:root {
    --primary: #0f172a;    /* Deep Navy Header/Footer */
    --secondary: #1e293b;  /* Slate for Cards/Containers */
    --accent: #f59e0b;     /* Gold/Amber for Buttons & Highlights */
    --bg: #020617;         /* Near-Black Background */
    --text-main: #f1f5f9;  /* Crisp Off-White */
    --text-dim: #94a3b8;   /* Muted Gray */
    --border: #334155;     /* Subtle depth borders */
    --shadow: 0 10px 30px rgba(0,0,0,0.6);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- BASE STYLES --- */
* { box-sizing: border-box; }

body {
    font-family: 'Inter', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    background-color: var(--bg);
    color: var(--text-main);
    line-height: 1.6;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

h1, h2, h3 { line-height: 1.2; margin-top: 0; }

/* --- HEADER & NAVIGATION --- */
header {
    background: var(--primary);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 15px 0;
}

.header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo h1 { font-size: 1.5rem; letter-spacing: 1px; text-transform: uppercase; margin: 0; }
.logo span { color: var(--accent); }

.logo a {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.logo-img {
    height: 40px; /* Adjust this value to fit your header height */
    width: auto;  /* Maintains the original aspect ratio */
    display: block;
    transition: var(--transition);
}

.logo-img:hover {
    opacity: 0.8;
}

/* Mobile Tweak: Make the logo a bit smaller on phones if needed */
@media (max-width: 850px) {
    .logo-img {
        height: 32px;
    }
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 25px;
    margin: 0;
    padding: 0;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-main);
    font-weight: 600;
    font-size: 0.95rem;
    transition: var(--transition);
}

.nav-links a:hover { color: var(--accent); }

/* --- DROPDOWN NAVIGATION --- */
.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--primary);
    border: 1px solid var(--border);
    border-radius: 8px;
    min-width: 200px;
    list-style: none;
    padding: 10px 0;
    box-shadow: var(--shadow);
    display: none; /* Hidden by default */
    z-index: 1001;
}

.dropdown-menu li {
    padding: 0;
}

.dropdown-menu li a {
    padding: 10px 20px;
    display: block;
    font-size: 0.9rem;
    font-weight: 400;
}

.dropdown-menu li a:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--accent);
}

/* Show on Hover (Desktop) */
@media (min-width: 851px) {
    .dropdown:hover .dropdown-menu {
        display: block;
    }
}

.chevron {
    display: inline-block;
    width: 0;
    height: 0;
    margin-left: 5px;
    vertical-align: middle;
    border-top: 4px solid var(--text-dim);
    border-right: 4px solid transparent;
    border-left: 4px solid transparent;
}

/* Mobile Adjustments */
@media (max-width: 850px) {
    .dropdown-menu {
        position: static;
        display: block; /* Show nested in the mobile tray */
        background: rgba(0,0,0,0.2);
        border: none;
        box-shadow: none;
        padding-left: 20px;
    }
    
    .dropdown-toggle {
        color: var(--accent) !important;
        pointer-events: none; /* Category label acts as a header on mobile */
    }
}

/* Add breathing room between the sticky header and the main content */
main.container {
    padding-top: 40px;
}

/* Specifically ensure the grid title has space if the hero section is missing */
.grid-title {
    margin-top: 20px;
    margin-bottom: 30px;
    font-size: 2rem;
}

/* --- HERO SECTION --- */
.featured-hero {
    display: flex;
    gap: 40px;
    background: linear-gradient(145deg, #1e293b, #0f172a);
    padding: 50px;
    border-radius: 16px;
    margin: 40px 0 60px 0;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    align-items: center;
}

.featured-hero img {
    width: 280px;
    border-radius: 8px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.7);
}

.featured-info { flex: 1; }
.featured-info h2 { font-size: 2.8rem; margin: 10px 0; }

.featured-subtitle {
    font-size: 1.3rem;
    color: var(--accent);
    margin: -10px 0 20px 0;
    font-weight: 600;
    font-style: italic;
    opacity: 0.9;
}

/* --- BUTTONS --- */
.btn {
    display: inline-block;
    background: var(--accent);
    color: #000;
    padding: 14px 30px;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 800;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 1px;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    text-align: center;
}

.btn:hover {
    background: #fbbf24;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(245, 158, 11, 0.4);
}

/* --- GRID & CARDS --- */
.grid-title { margin-bottom: 30px; font-size: 2rem; }

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 30px;
}

.book-card {
    background: var(--secondary);
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    transition: var(--transition);
    border: 1px solid var(--border);
}

.book-card:hover {
    transform: translateY(-10px);
    border-color: var(--accent);
    box-shadow: var(--shadow);
}

.book-card img {
    width: 100%;
    height: 380px;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 15px;
}

.category-tag {
    color: var(--accent);
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 1.5px;
    display: block;
    margin-bottom: 8px;
}

/* --- BOOK DETAILS PAGE --- */
.book-details-layout {
    display: flex;
    gap: 40px;
    margin-top: 40px;
    align-items: flex-start;
}

.book-visuals { flex: 1; max-width: 450px; }
.main-cover { width: 100%; height: auto; border-radius: 12px; box-shadow: var(--shadow); }

.book-text { flex: 1.2; min-width: 300px; }
.book-text h1 { font-size: 2.2rem; margin: 0 0 10px 0; line-height: 1.1; }

.details-subtitle {
    font-size: 1.4rem;
    color: var(--accent);
    margin: 0 0 20px 0;
    font-weight: 600;
    font-style: italic;
}

.description {
    font-size: 1.05rem;
    color: var(--text-dim);
    margin-bottom: 25px;
}

.purchase-area {
	margin-top: 30px;
	display: flex;
	flex-direction: column;
	gap: 15px;
}

.purchase-action {
	display: flex;
	align-items: center;
	gap: 15px;
}

.series-label {
    font-weight: 700;
    color: var(--accent); /* Makes the 'Volume' text stand out */
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

hr { display: none; }

/* --- ABOUT PAGE STYLES --- */
.about-layout {
    display: flex;
    gap: 60px;
    margin-top: 40px;
    align-items: flex-start;
}

.about-visuals {
    flex: 1;
    max-width: 400px;
}

.author-img {
    width: 100%;
    border-radius: 16px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.about-text {
    flex: 1.5;
}

.about-text h1 {
    font-size: 3rem;
    margin-bottom: 20px;
}

.social-links {
    margin-top: 30px;
    background: var(--secondary);
    padding: 20px;
    border-radius: 12px;
    border: 1px solid var(--border);
}

.social-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.social-item {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: var(--transition);
}

.social-item:hover {
    text-decoration: underline;
}

.cta-box {
    margin-top: 40px;
    padding: 30px;
    background: linear-gradient(145deg, #1e293b, #0f172a);
    border-radius: 12px;
    border: 1px solid var(--border);
    text-align: center;
}

/* Mobile responsive */
@media (max-width: 850px) {
    .about-layout {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .about-visuals {
        max-width: 100%;
    }
}

/* --- CONTACT PAGE --- */
.contact-wrapper {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 80px;
    margin-top: 40px;
    align-items: start;
}

.display-title {
    font-size: 3.5rem;
    line-height: 1.1;
    margin: 20px 0;
}

.contact-lead {
    font-size: 1.1rem;
    color: var(--text-dim);
    line-height: 1.6;
    margin-bottom: 40px;
}

.contact-methods {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.method-item strong {
    display: block;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-size: 0.8rem;
    color: var(--accent);
    margin-bottom: 5px;
}

/* Form Container Styling */
.contact-form-container {
    background: rgba(255, 255, 255, 0.02);
    padding: 50px;
    border: 1px solid var(--border);
    border-radius: 12px;
}

.input-group {
    margin-bottom: 25px;
}

.input-group label {
    display: block;
    font-size: 0.85rem;
    margin-bottom: 8px;
    color: var(--text-dim);
}

.input-group input, 
.input-group textarea {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border);
    padding: 15px;
    color: white;
    border-radius: 6px;
    font-family: inherit;
    transition: var(--transition);
}

.input-group input:focus, 
.input-group textarea:focus {
    outline: none;
    border-color: var(--accent);
    background: rgba(0, 0, 0, 0.5);
}

.input-group textarea {
    height: 150px;
    resize: vertical;
}

.btn-wide {
    width: 100%;
    padding: 18px;
    font-weight: 700;
}

/* Mobile Adjustments */
@media (max-width: 900px) {
    .contact-wrapper {
        grid-template-columns: 1fr;
        gap: 50px;
    }
    .display-title { font-size: 2.5rem; }
    .contact-form-container { padding: 30px; }
}

/* --- SITE FOOTER --- */
.site-footer {
    background: var(--primary);
    border-top: 1px solid var(--border);
    padding: 80px 0 0 0; /* Top padding for breathing room */
    margin-top: 100px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr;
    gap: 60px;
    margin-bottom: 60px;
}

.footer-column h3 {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--accent);
    margin-bottom: 25px;
}

.footer-bio {
    color: var(--text-dim);
    font-size: 0.95rem;
    max-width: 300px;
    margin-top: 20px;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 12px;
}

.footer-links a {
    color: var(--text-dim);
    text-decoration: none;
    font-size: 0.95rem;
    transition: var(--transition);
}

.footer-links a:hover {
    color: var(--accent);
    padding-left: 5px; /* Subtle hover effect */
}

.footer-logo {
    height: 35px; /* Slightly smaller for footer */
}

.footer-bottom {
    background: rgba(0, 0, 0, 0.2);
    padding: 30px 0;
    text-align: center;
    border-top: 1px solid var(--border);
}

.footer-bottom p {
    font-size: 0.85rem;
    color: var(--text-dim);
    margin: 0;
}

/* Mobile Footer */
@media (max-width: 850px) {
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 40px;
        text-align: center;
    }

    .footer-bio {
        margin: 20px auto 0 auto;
    }

    .footer-links a:hover {
        padding-left: 0;
    }
}

.recommendations { padding-bottom: 60px; }

/* --- ADMIN PANEL --- */
.admin-container {
    background: var(--secondary);
    padding: 30px;
    border-radius: 12px;
    border: 1px solid var(--border);
    margin-top: 20px;
}

.admin-container h1 { border-bottom: 2px solid var(--accent); padding-bottom: 10px; }

input[type="text"], input[type="number"], select, textarea {
    background: var(--primary);
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 12px;
    border-radius: 4px;
    width: 100%;
    margin-bottom: 15px;
}

input:focus, textarea:focus { outline: none; border-color: var(--accent); }

table { width: 100%; border-collapse: collapse; margin-top: 20px; }
th { background: var(--primary); color: var(--accent); text-transform: uppercase; font-size: 0.8rem; padding: 15px; border-bottom: 2px solid var(--border); text-align: left; }
td { padding: 15px; border-bottom: 1px solid var(--border); }
tr:hover { background: rgba(255, 255, 255, 0.03); }

/* --- MOBILE RESPONSIVE --- */
.menu-toggle { display: none; flex-direction: column; justify-content: space-between; width: 26px; height: 18px; background: transparent; border: none; cursor: pointer; z-index: 10; }
.menu-toggle .bar { width: 100%; height: 2px; background-color: var(--text-main); border-radius: 2px; transition: var(--transition); }

@media (max-width: 850px) {
    .menu-toggle { display: flex; }

    .nav-container {
        display: block;
        position: absolute;
        top: 70px;
        left: 0;
        width: 100%;
        background-color: var(--primary);
        border-bottom: 1px solid var(--border);
        box-shadow: var(--shadow);
        opacity: 0;
        transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
        pointer-events: none;
        max-height: calc(100vh - 70px); 
        overflow-y: auto;
    }

    .nav-container.active { max-height: 100vh; opacity: 1; pointer-events: auto; }

    .nav-links {
        display: flex;
        flex-direction: column;
        gap: 0;
        padding: 0; /* Removed padding to allow full-width borders */
        text-align: left; /* Better for lists */
    }

    /* Main links (Home, About, Categories, Contact) */
    .nav-links li { 
        width: 100%; 
        border-bottom: 1px solid rgba(255,255,255,0.05); 
    }

    .nav-links li a {
        padding: 12px 25px; /* Significantly reduced vertical padding */
        display: block;
        font-size: 1rem;
    }

    /* Nested Category Links */
    .dropdown-menu {
        position: static;
        display: block; /* Nested view on mobile */
        background: rgba(0, 0, 0, 0.2);
        padding: 0;
    }

    .dropdown-menu li {
        border-bottom: 1px solid rgba(255,255,255,0.02);
    }

    .dropdown-menu li a {
        padding: 8px 25px 8px 45px; /* Indented and much tighter */
        font-size: 0.9rem;
        opacity: 0.8;
    }

    .dropdown-toggle {
        background: rgba(255, 255, 255, 0.03);
    }

    .nav-links li:last-child { border-bottom: none; }
    
    .header-search { margin-right: 10px; }
    .header-search input:focus { width: 140px; }

    .featured-hero { flex-direction: column; padding: 30px; text-align: center; }
    .featured-hero img { width: 220px; }

    .book-details-layout { flex-direction: column; align-items: center; }
    .book-text { width: 100%; text-align: center; }
    .purchase-action { justify-content: center; }

    .menu-toggle.is-active .bar:nth-child(2) { opacity: 0; }
    .menu-toggle.is-active .bar:nth-child(1) { transform: translateY(8px) rotate(45deg); }
    .menu-toggle.is-active .bar:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }
}