/**
 * Wiz Book - Headway Premium Design System
 */

:root {
    --wizm-book-primary: #109957; /* Headway Green */
    --wizm-book-primary-soft: rgba(16, 153, 87, 0.1);
    --wizm-book-dark: #1A1A1A;
    --wizm-book-gray: #717171;
    --wizm-book-light: #F9F9F9;
    --wizm-book-white: #FFFFFF;
    --wizm-book-radius: 20px;
    --wizm-book-shadow: 0 10px 40px rgba(0, 0, 0, 0.06);
    --wizm-book-glass: rgba(255, 255, 255, 0.8);
}

/* Base Styles */
.wizm-headway-wrap {
    font-family: 'Outfit', 'Inter', system-ui, -apple-system, sans-serif;
    color: var(--wizm-book-dark);
    -webkit-font-smoothing: antialiased;
    background: var(--wizm-book-light);
    min-height: 100vh;
}

/* --- ARCHIVE: HEADWAY STYLE --- */

.wizm-headway-archive {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* HERO SECTION */
.wizm-headway-hero {
    position: relative;
    background: var(--wizm-book-dark);
    border-radius: 30px;
    padding: 60px;
    margin-bottom: 40px;
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 40px;
    color: var(--wizm-book-white);
}

.wizm-headway-hero::before {
    content: '';
    position: absolute;
    top: -50%; right: -20%;
    width: 80%; height: 200%;
    background: radial-gradient(circle, var(--wizm-book-primary) 0%, transparent 70%);
    opacity: 0.2;
    z-index: 1;
}

.wizm-headway-hero-content {
    z-index: 2;
    flex: 1;
}

.wizm-headway-hero-badge {
    background: var(--wizm-book-primary);
    color: white;
    padding: 6px 16px;
    border-radius: 30px;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    display: inline-block;
    margin-bottom: 20px;
}

.wizm-headway-hero h1 {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 20px;
    letter-spacing: -2px;
}

.wizm-headway-hero p {
    font-size: 1.2rem;
    opacity: 0.8;
    margin-bottom: 30px;
    max-width: 500px;
}

.wizm-headway-hero-viz {
    flex: 0 0 300px;
    z-index: 2;
}

.wizm-headway-hero-viz img {
    width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    transform: rotate(5deg);
}

/* FILTERS */
.wizm-headway-filters {
    display: flex;
    gap: 12px;
    margin-bottom: 40px;
    overflow-x: auto;
    padding-bottom: 10px;
}

.wizm-headway-filter-chip {
    padding: 10px 24px;
    background: var(--wizm-book-white);
    border-radius: 30px;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--wizm-book-gray);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.3s ease;
    border: 1px solid rgba(0,0,0,0.05);
}

.wizm-headway-filter-chip:hover, 
.wizm-headway-filter-chip.active {
    background: var(--wizm-book-primary);
    color: var(--wizm-book-white);
    border-color: var(--wizm-book-primary);
    transform: translateY(-2px);
}

/* BOOK GRID */
.wizm-headway-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
}

.wizm-headway-card {
    background: var(--wizm-book-white);
    border-radius: var(--wizm-book-radius);
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid rgba(0,0,0,0.03);
    box-shadow: var(--wizm-book-shadow);
    display: flex;
    flex-direction: column;
}

.wizm-headway-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 60px rgba(16, 153, 87, 0.1);
}

.wizm-headway-cover {
    height: 220px;
    position: relative;
    overflow: hidden;
}

.wizm-headway-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: scale 0.5s ease;
}

.wizm-headway-card:hover .wizm-headway-cover img {
    scale: 1.05;
}

.wizm-headway-meta {
    padding: 25px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.wizm-headway-category {
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--wizm-book-primary);
    margin-bottom: 8px;
    letter-spacing: 1px;
}

.wizm-headway-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 12px;
    line-height: 1.3;
}

.wizm-headway-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 15px;
    border-top: 1px solid #f0f0f0;
}

.wizm-headway-audio-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--wizm-book-gray);
}

.wizm-headway-audio-status.has-audio {
    color: var(--wizm-book-primary);
}

/* --- SINGLE: HEADWAY STYLE --- */

.wizm-headway-single {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px 80px;
}

/* STICKY HEADER */
.wizm-headway-single-header {
    position: sticky;
    top: 20px;
    z-index: 100;
    background: var(--wizm-book-glass);
    backdrop-filter: blur(12px);
    border-radius: 40px;
    padding: 10px 25px;
    border: 1px solid rgba(255,255,255,0.3);
    margin-bottom: 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
}

.wizm-headway-progress-bar {
    position: absolute;
    bottom: -2px; left: 20px; right: 20px;
    height: 3px;
    background: #eee;
    border-radius: 10px;
    overflow: hidden;
}

.wizm-headway-progress-fill {
    height: 100%;
    background: var(--wizm-book-primary);
    width: 0%;
    transition: width 0.3s ease;
}

/* SINGLE CONTENT */
.wizm-headway-single-intro {
    display: flex;
    gap: 60px;
    margin-bottom: 80px;
    align-items: center;
}

.wizm-headway-single-cover {
    flex: 0 0 350px;
}

.wizm-headway-single-cover img {
    width: 100%;
    border-radius: 20px;
    box-shadow: 0 30px 60px rgba(0,0,0,0.15);
}

.wizm-headway-single-details h1 {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 20px;
    letter-spacing: -2px;
}

.wizm-headway-single-details .author {
    font-size: 1.2rem;
    color: var(--wizm-book-gray);
    margin-bottom: 30px;
}

.wizm-headway-actions {
    display: flex;
    gap: 20px;
}

.wizm-headway-btn {
    padding: 16px 36px;
    border-radius: 40px;
    font-weight: 700;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.wizm-headway-btn-primary {
    background: var(--wizm-book-primary);
    color: white;
}

.wizm-headway-btn-secondary {
    background: var(--wizm-book-dark);
    color: white;
}

.wizm-headway-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

/* INSIGHTS TIMELINE */
.wizm-headway-insights-wrap {
    margin-top: 60px;
}

.wizm-headway-insights-title {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 40px;
    text-align: center;
}

.wizm-headway-insight-card {
    background: var(--wizm-book-white);
    border-radius: 24px;
    padding: 40px;
    margin-bottom: 30px;
    box-shadow: var(--wizm-book-shadow);
    border: 1px solid rgba(0,0,0,0.03);
    position: relative;
    opacity: 0.6;
    transition: opacity 0.4s ease;
}

.wizm-headway-insight-card.active {
    opacity: 1;
    border-left: 6px solid var(--wizm-book-primary);
}

.wizm-headway-insight-num {
    font-size: 0.9rem;
    font-weight: 900;
    color: var(--wizm-book-primary);
    margin-bottom: 15px;
    display: block;
}

.wizm-headway-insight-card h3 {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 20px;
}

.wizm-headway-insight-card p {
    font-size: 1.1rem;
    line-height: 1.7;
    color: #444;
}

/* RESPONSIVE */
@media (max-width: 900px) {
    .wizm-headway-hero { padding: 40px; flex-direction: column; text-align: center; }
    .wizm-headway-hero h1 { font-size: 2.5rem; }
    .wizm-headway-single-intro { flex-direction: column; text-align: center; }
    .wizm-headway-single-details h1 { font-size: 2.5rem; }
    .wizm-headway-actions { justify-content: center; flex-direction: column; }
    .wizm-headway-hero-viz { flex: 0 0 auto; display: none; }
}

/* --- PROFILE PAGES (AUTHOR & SUMMARIZER) --- */

.wizm-profile-header {
    background: var(--wizm-book-white);
    border-radius: 30px;
    padding: 60px;
    margin-bottom: 40px;
    display: flex;
    align-items: center;
    gap: 50px;
    box-shadow: var(--wizm-book-shadow);
}

.wizm-profile-avatar {
    flex: 0 0 200px;
    height: 200px;
    border-radius: 100px;
    overflow: hidden;
    border: 5px solid var(--wizm-book-primary-soft);
}

.wizm-profile-avatar img {
    width: 100%; height: 100%; object-fit: cover;
}

.wizm-profile-info h1 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 10px;
    letter-spacing: -1.5px;
}

.wizm-profile-role {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--wizm-book-primary);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 25px;
    display: block;
}

.wizm-profile-socials {
    display: flex;
    gap: 15px;
}

.wizm-social-link {
    width: 45px; height: 45px;
    background: var(--wizm-book-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--wizm-book-dark);
    transition: all 0.3s ease;
    text-decoration: none;
}

.wizm-social-link:hover {
    background: var(--wizm-book-primary);
    color: white;
    transform: translateY(-3px);
}

.wizm-profile-body {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 40px;
}

.wizm-profile-section {
    background: var(--wizm-book-white);
    padding: 40px;
    border-radius: 20px;
    box-shadow: var(--wizm-book-shadow);
    margin-bottom: 40px;
}

.wizm-profile-section h2 {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 25px;
    position: relative;
    padding-bottom: 10px;
}

.wizm-profile-section h2::after {
    content: ''; position: absolute; bottom: 0; left: 0; width: 40px; height: 4px; background: var(--wizm-book-primary); border-radius: 2px;
}

.wizm-achievement-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.wizm-achievement-item {
    display: flex;
    gap: 15px;
    align-items: center;
    background: var(--wizm-book-light);
    padding: 15px 20px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1.05rem;
}

.wizm-achievement-icon {
    width: 24px; height: 24px; color: var(--wizm-book-primary);
}

.wizm-author-books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

@media (max-width: 900px) {
    .wizm-profile-header { flex-direction: column; text-align: center; padding: 40px 20px; }
    .wizm-profile-socials { justify-content: center; }
    .wizm-profile-body { grid-template-columns: 1fr; }
}

/* Wisdom Highlights */
.wizm-quote-card {
    transition: transform 0.3s ease;
}
.wizm-quote-card:hover {
    transform: translateY(-5px);
}

/* Zen Reader 2.0 Split Screen */
#wizm-zen-reader {
    font-family: 'Inter', sans-serif;
}
.wizm-sidebar-item {
    border-left: 3px solid transparent !important;
}
.wizm-sidebar-item.active {
    border-left-color: var(--wizm-book-primary) !important;
}
.wizm-sidebar-item:hover:not(.active) {
    background: rgba(0,0,0,0.02) !important;
}

/* Scrollbars for Sidebar and Content */
#wizm-reader-sidebar::-webkit-scrollbar,
#wizm-reader-content::-webkit-scrollbar {
    width: 6px;
}
#wizm-reader-sidebar::-webkit-scrollbar-track,
#wizm-reader-content::-webkit-scrollbar-track {
    background: transparent;
}
#wizm-reader-sidebar::-webkit-scrollbar-thumb,
#wizm-reader-content::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.1);
    border-radius: 10px;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

#wizm-dynamic-insight {
    animation: fadeIn 0.5s ease forwards;
}

/* Mobile Adjustments for Split Screen */
@media (max-width: 992px) {
    #wizm-zen-reader div[style*="display:flex"] {
        flex-direction: column !important;
    }
    aside[style*="width:350px"] {
        width: 100% !important;
        height: 200px !important;
        border-right: none !important;
        border-bottom: 1px solid #eee !important;
    }
    main[id="wizm-reader-content"] {
        padding: 30px !important;
    }
}

/* --- Reader 4.0 Social & Feedback --- */
.wizm-star-rating span {
    transition: color 0.2s, transform 0.2s;
    display: inline-block;
}
.wizm-star-rating span:hover {
    transform: scale(1.2);
    color: #f39c12 !important;
}

.wizm-like-btn {
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.wizm-like-btn:hover {
    transform: translateY(-3px);
    border-color: #e74c3c !important;
}
.wizm-like-btn:active {
    transform: scale(0.9);
}

.wizm-reader-reviews {
    animation: fadeIn 1s ease-out;
}

.wizm-sidebar-item.final-step:hover {
    background: rgba(16, 153, 87, 0.05) !important;
    border-color: var(--wizm-book-primary) !important;
}

/* Animations */
@keyframes heartPop {
    0% { transform: scale(1); }
    50% { transform: scale(1.4); }
    100% { transform: scale(1); }
}

.wizm-liked-animation {
    animation: heartPop 0.4s ease-out;
}


