:root {
    --bg-dark: #1e1712;
    --card-bg: rgba(22, 19, 17, 0.94);
    --border-color: #3d332a;
    --accent-crimson: #b33232;
    --accent-crimson-dark: #801818;
    --text-light: #eaecf0;
    --text-muted: #a0a6b0;
    --font-heading: 'Cinzel', serif;
    --font-body: 'Inter', sans-serif;
}

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

html {
    scroll-behavior: smooth;
}

/* DEFAULT DARK LEATHER BACKGROUND */
body {
    background-color: var(--bg-dark);
    background-image: 
        radial-gradient(circle at 50% 30%, rgba(45, 34, 25, 0.25) 0%, rgba(8, 5, 3, 0.92) 100%),
        url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.20'/%3E%3C/svg%3E"),
        repeating-linear-gradient(45deg, rgba(255, 225, 190, 0.035) 0px, rgba(255, 225, 190, 0.035) 1px, transparent 1px, transparent 3px),
        repeating-linear-gradient(-45deg, rgba(0, 0, 0, 0.30) 0px, rgba(0, 0, 0, 0.30) 1px, transparent 1px, transparent 3px);
    background-attachment: fixed;
    color: var(--text-light);
    font-family: var(--font-body);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* HEADER & NAVIGATION */
header {
    background-color: rgba(12, 9, 7, 0.95);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.header-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-title {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: #ffffff;
    text-decoration: none;
}

nav a {
    color: var(--text-muted);
    text-decoration: none;
    margin-left: 2rem;
    font-size: 0.9rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: color 0.2s ease;
}

nav a:hover {
    color: #ffffff;
}

/* HERO SECTION (2-COLUMN GRID LAYOUT) */
.hero {
    max-width: 1000px;
    margin: 0 auto;
    padding: 1.5rem 2rem 1.5rem 2rem;
}

.hero-grid {
    display: grid;
    grid-template-columns: 210px 1fr;
    gap: 0.75rem 2rem;
    align-items: start;
    align-content: start;
}

.hero-left {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    grid-column: 1;
    grid-row: 1;
}

.hero-author-img {
    width: 170px;
    height: 210px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.7);
    background-color: #0b0d0f;
}

.hero-right {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    text-align: center;
    width: 100%;
    grid-column: 2;
    grid-row: 1;
    margin-top: 1em;
    padding-top: 0;
}

/* HISTORICAL FICTION AUTHOR TAGLINE - NO OUTLINE */
.hero-tag {
    display: block;
    font-family: var(--font-heading);
    color: var(--accent-crimson-dark);
    font-size: 1.65rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin: 0 0 0.5rem 0;
    padding: 0;
    font-weight: 700;
    text-align: center;
    width: 100%;
    line-height: 1.1;
    text-shadow: none; /* Outline removed */
}

.hero-quote {
    display: block;
    font-family: var(--font-heading);
    font-size: 1.45rem;
    line-height: 1.35;
    color: #ffffff;
    font-style: normal;
    text-align: center;
    width: 100%;
    margin: 0 auto;
    padding: 0;
}

/* SUBTITLE */
.hero-sub {
    grid-column: 1 / -1;
    grid-row: 2;
    max-width: 460px;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-style: italic;
    line-height: 1.4;
    text-align: left;
    margin-top: 0.25rem;
}

/* MAIN CONTENT */
.main-content {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 2rem 5rem 2rem;
}

.section-header {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 1.5rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-header::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 1.1rem;
    background-color: var(--accent-crimson);
}

/* CARDS & STITCHING */
.card, .book-card, .about-card, .contact-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.65);
    position: relative;
    outline: 1px dashed rgba(255, 255, 255, 0.08);
    outline-offset: -6px;
    margin-bottom: 1.5rem;
}

.card h2 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    color: #ffffff;
    letter-spacing: 1px;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

/* BOOK BOXES */
.book-section {
    padding-top: 1rem;
    margin-bottom: 4rem;
    scroll-margin-top: 80px;
}

.book-list {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.book-card {
    display: flex;
    gap: 1.25rem;
    align-items: flex-start;
    transition: border-color 0.2s ease, transform 0.2s ease;
    margin-bottom: 0;
}

.book-card:hover {
    border-color: #635345;
    transform: translateY(-2px);
}

.book-cover-wrapper {
    width: 126px;
    min-width: 126px;
    height: 182px;
    flex-shrink: 0;
    border-radius: 4px;
    overflow: hidden;
    background-color: #0b0d0f;
    border: 1px solid var(--border-color);
}

.book-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.book-details {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 182px;
}

.book-series {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--accent-crimson);
    margin-bottom: 0.15rem;
}

.book-title {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    color: #ffffff;
    margin-bottom: 0.35rem;
}

.book-synopsis {
    color: var(--text-muted);
    font-size: 0.88rem;
    line-height: 1.48;
    margin-bottom: 0.6rem;
}

/* BUTTONS */
.btn, .btn-buy {
    display: inline-block;
    background-color: var(--accent-crimson);
    color: #ffffff;
    border: 1px solid var(--accent-crimson);
    padding: 0.5rem 1.2rem;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
    text-decoration: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-buy {
    background-color: transparent;
    border-color: var(--border-color);
    align-self: flex-start;
}

.btn-buy:hover, .btn:hover {
    background-color: #c23434;
    border-color: #c23434;
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-light);
}

.btn-secondary:hover {
    background: var(--border-color);
}

.btn-small {
    padding: 0.35rem 0.7rem;
    font-size: 0.75rem;
}

.btn-danger {
    background: #721c24;
    border-color: #721c24;
}

.btn-danger:hover {
    background: #a72835;
    border-color: #a72835;
}

/* ABOUT SECTION */
.about-section {
    padding-top: 1rem;
    margin-bottom: 4rem;
    scroll-margin-top: 80px;
}

.about-card {
    padding: 2rem;
}

.about-bio p {
    color: var(--text-light);
    font-size: 0.98rem;
    line-height: 1.65;
    margin-bottom: 1rem;
}

.about-bio p:last-child {
    margin-bottom: 0;
}

.bio-quote {
    border-left: 3px solid var(--accent-crimson);
    padding-left: 1.25rem;
    margin: 1.25rem 0;
    font-family: var(--font-heading);
    font-size: 1.05rem;
    color: #ffffff;
    line-height: 1.45;
}

/* CONTACT SECTION */
.contact-section {
    padding-top: 1rem;
    margin-bottom: 3rem;
    scroll-margin-top: 80px;
}

.contact-card {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 2rem;
    align-items: flex-start;
}

.contact-author-img {
    width: 100%;
    max-height: 220px;
    object-fit: contain;
    object-position: top center;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background-color: #0b0d0f;
}

.contact-intro {
    color: var(--text-light);
    font-size: 1rem;
    margin-bottom: 1rem;
    line-height: 1.6;
}

.contact-email-link {
    display: inline-block;
    font-family: var(--font-heading);
    font-size: 1.15rem;
    color: #ffffff;
    text-decoration: none;
    border-bottom: 2px solid var(--accent-crimson);
    padding-bottom: 2px;
    margin-bottom: 1.25rem;
    transition: color 0.2s ease;
}

.contact-email-link:hover {
    color: var(--accent-crimson);
}

.signature-img {
    display: block;
    max-width: 90px;
    height: auto;
    margin-top: 0.5rem;
    opacity: 0.92;
}

/* ADMIN PANEL STYLING */
.admin-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}

.admin-header h1 {
    font-family: var(--font-heading);
    color: #fff;
    font-size: 1.6rem;
}

.admin-header a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
}

.admin-header a:hover {
    color: #fff;
}

.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
}

.tab-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 0.8rem 1.2rem;
    font-family: var(--font-heading);
    font-size: 0.95rem;
    cursor: pointer;
    text-decoration: none;
    border-bottom: 2px solid transparent;
}

.tab-btn.active {
    color: #fff;
    border-bottom-color: var(--accent-crimson);
}

.form-group {
    margin-bottom: 2rem;
}

.form-group label {
    display: block;
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 1px;
    color: #ffffff;
    margin-bottom: 0.6rem;
    padding-left: 0.75rem;
    border-left: 4px solid var(--accent-crimson);
}

input[type="text"], input[type="password"], textarea {
    width: 100%;
    background: #120e0b;
    border: 1px solid var(--border-color);
    color: #fff;
    padding: 0.75rem;
    font-family: inherit;
    font-size: 0.95rem;
    border-radius: 4px;
}

input[type="text"]:focus, input[type="password"]:focus, textarea:focus {
    border-color: var(--accent-crimson);
    outline: none;
}

textarea {
    resize: vertical;
    min-height: 100px;
}

select {
    width: 50%;
    min-width: 320px;
    max-width: 500px;
    background: #120e0b;
    border: 1px solid var(--border-color);
    color: #fff;
    padding: 0.65rem;
    font-family: inherit;
    border-radius: 4px;
    margin-top: 0.3rem;
    display: block;
}

.picker-row {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 0.4rem;
}

.picker-row > div {
    width: 100%;
}

.alert {
    background: #1b2e23;
    border: 1px solid #275238;
    color: #85d6a2;
    padding: 0.8rem 1rem;
    border-radius: 4px;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.alert-error {
    background: #33171a;
    border: 1px solid #632328;
    color: #f19da4;
}

.book-item {
    display: grid;
    grid-template-columns: 70px 1fr auto;
    gap: 1.25rem;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
}

.book-item:last-child {
    border-bottom: none;
}

.book-item img {
    width: 60px;
    height: 85px;
    object-fit: cover;
    background: #000;
    border-radius: 2px;
}

.book-info h3 {
    font-size: 1.1rem;
    color: #fff;
    margin-bottom: 0.2rem;
}

.book-info p {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.actions {
    display: flex;
    gap: 0.4rem;
    align-items: center;
}

.login-box {
    max-width: 400px;
    margin: 4rem auto;
}

.preview-img {
    width: 100px;
    max-height: 120px;
    object-fit: contain;
    object-position: top center;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    background: #120e0b;
    margin-top: 0.5rem;
    display: block;
}

.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.media-card {
    background: #120e0b;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.5rem;
    text-align: center;
}

.media-card img {
    width: 100%;
    height: 100px;
    object-fit: cover;
    border-radius: 4px;
    background: #000;
}

.media-card .filename {
    font-size: 0.7rem;
    color: var(--text-muted);
    word-break: break-all;
    margin: 0.4rem 0;
    max-height: 2rem;
    overflow: hidden;
}

/* FOOTER */
footer {
    border-top: 1px solid var(--border-color);
    text-align: center;
    padding: 2.5rem 2rem;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* RESPONSIVE DESIGN */
@media (max-width: 800px) {
    .hero-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero-left {
        align-items: center;
        grid-column: 1;
        grid-row: 1;
    }

    .hero-right {
        margin-top: 0;
        grid-column: 1;
        grid-row: 2;
    }

    .hero-sub {
        grid-column: 1;
        grid-row: 3;
        text-align: center;
        max-width: 100%;
    }

    .book-card {
        flex-direction: column;
    }

    .book-cover-wrapper {
        width: 140px;
        height: 200px;
        margin: 0 auto;
    }

    .contact-card {
        grid-template-columns: 1fr;
    }

    .contact-author-img {
        max-width: 200px;
        margin: 0 auto;
    }
}