:root {
    /* New Theme: Leafy Emerald */
    --primary-color: #10b981; 
    --primary-hover: #059669;
    --primary-light: #ecfdf5;
    --blue-primary: #2563eb;
    --bg-main: #f3f4f6;
    --bg-card: #ffffff;
    --text-main: #111827;
    --text-muted: #6b7280;
    --border-color: #e5e7eb;
    
    --shadow-card: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.01);
    --radius-xl: 24px;
    --radius-md: 16px;
}

body.dark-mode {
    --primary-color: #10b981;
    --primary-light: #064e3b;
    --bg-main: #040c1e;
    --bg-card: #1f2937;
    --text-main: #f9fafb;
    --text-muted: #9ca3af;
    --border-color: #374151;
    --shadow-card: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
    --blue-primary: #3b82f6;
}

section { padding: 0 !important; }

.leafy-main-container {
    min-height: 90vh;
    padding: 2rem 1rem;
    background-color: var(--bg-main);
    font-family: 'Inter', system-ui, sans-serif; /* Cleaner font stack */
}

/* Card Layout */
.book-details-wrapper {
    background-color: var(--bg-card);
    width: 100%;
    max-width:95%;
    margin: 0 auto;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-card);
    padding: 3rem;
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 3.5rem;
    align-items: start;
    border: 1px solid var(--border-color);
}

/* --- SIDEBAR --- */
.cover-container {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15); /* Softer shadow */
    aspect-ratio: 2 / 3;
    width: 100%;
    transition: transform 0.3s ease;
    height: 300px;
}

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

.cover-container:hover { transform: translateY(-5px); }

.badge-overlay {
    position: absolute;
    top: 12px; right: 12px;
    background: var(--primary-color);
    color: white;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

/* Stats Box */
.book-stats {
    margin-top: 1.5rem;
    display: flex;
    justify-content: space-between;
    padding: 1rem;
    background-color: var(--bg-main);
    border-radius: var(--radius-md);
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    flex: 1;
    border-right: 1px solid var(--border-color);
}
.stat-item:last-child { border-right: none; }

.stat-item .count {
    font-weight: 800;
    color: var(--text-main);
    font-size: 1.1rem;
}

.stat-item .label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 4px;
    font-weight: 600;
}

/* Share Button Area */
.share-row {
    display: flex;
    gap: 10px;
    margin-top: 1.5rem;
    width: 100%;
}

.btn-chip {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-main);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
}

.share-btn {
    background-color: var(--bg-main);
}

.btn-chip:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background-color: var(--primary-light);
}

/* --- MAIN CONTENT --- */
.book-header {
    margin-bottom: 2rem;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 1.5rem;
}

.book-title {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
    background: linear-gradient(to right, var(--text-main), var(--blue-primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

/* Metadata Grid */
.book-credits {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
    background-color: #eff6ff;
    border-radius: 12px;
    padding: 15px;
   
}

body.dark-mode .book-credits{
    background-color: #23354d;
    
}

.credit-row { display: flex; flex-direction: column; }

.credit-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 700;
    margin-bottom: 6px;
    letter-spacing: 0.5px;
}

.credit-value {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-main);
}

/* Description */
.book-description h4 {
    font-size: 1.2rem;
    color: var(--text-main);
    margin-bottom: 1rem;
    font-weight: 700;
    display: flex;
    padding: 5px;
    align-items: center;
    border-left: 5px solid #12c543;
    border-radius: 4px;
}


.book-description p {
    color: var(--text-muted);
    line-height: 1.8;
    font-size: 1.05rem;
    margin-bottom: 2.5rem;
}

/* CTA Button */
.action-area { margin-top: 1rem; }

.btn-primary.btn-lg {
    background-color: var(--primary-color);
    color: white;
    padding: 16px 48px;
    font-size: 1.1rem;
    border-radius: 12px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3); /* Green shadow */
    transition: transform 0.2s;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-3px);
}

/* Explore Section */
.explore-section {
    width: 100%;
    max-width: 95%;
    margin: 3rem auto 0;
}

.explore-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.explore-header h3 {
    font-size: 1.6rem;
    color: var(--text-main);
    font-weight: 700;
}

.explore-link {
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: none;
}

/* --- RESPONSIVE --- */
@media (max-width: 900px) {
    .book-details-wrapper {
        grid-template-columns: 1fr;
        padding: 2rem;
        gap: 2.5rem;
    }

    .book-sidebar {
        max-width: 400px;
        margin: 0 auto;
        width: 100%;
        text-align: center;
    }
    
    .cover-container {
        max-width: 260px;
        margin: 0 auto;
    }

    .book-header { text-align: center; }
    
    .book-title { font-size: 2rem; }
}

@media (max-width: 600px) {
    .leafy-main-container { padding: 1rem 0.5rem; }
    .book-details-wrapper { padding: 1.5rem; border-radius: 16px; }
    
    .share-row { flex-wrap: wrap; }
    .btn-chip { width: 100%; }
    
    .btn-primary.btn-lg { width: 100%; justify-content: center; }
    
    .book-credits {
        grid-template-columns: 1fr 1fr;
        gap: 1.5rem;
    }
}