/* ================= LITVIBE DESIGN SYSTEM ================= */

:root {
    /* Color Palette */
    --bg-base: #0B0F19;
    --bg-surface: rgba(22, 28, 45, 0.45);
    --bg-surface-opaque: #161C2D;
    --border-color: rgba(255, 255, 255, 0.08);
    --border-color-hover: rgba(255, 255, 255, 0.16);
    
    --text-primary: #F3F4F6;
    --text-secondary: #9CA3AF;
    --text-muted: #6B7280;
    
    /* Accents & Gradients */
    --primary: #6366F1;
    --primary-light: #818CF8;
    --secondary: #A855F7;
    --accent-pink: #EC4899;
    
    --grad-primary: linear-gradient(135deg, #6366F1 0%, #A855F7 50%, #EC4899 100%);
    --grad-primary-hover: linear-gradient(135deg, #4F46E5 0%, #9333EA 50%, #DB2777 100%);
    --grad-dark-overlay: linear-gradient(to top, #0B0F19 20%, rgba(11, 15, 25, 0.8) 60%, rgba(11, 15, 25, 0) 100%);
    --grad-card-cover: linear-gradient(135deg, #1e1b4b 0%, #311042 50%, #111827 100%);

    /* Fonts */
    --font-ui: 'Inter', sans-serif;
    --font-heading: 'Outfit', sans-serif;
    --font-reader: 'Merriweather', Georgia, serif;
    
    /* Shadows & Glows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.15);
    
    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ================= BASIC RESET & LAYOUT ================= */

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

body {
    background-color: var(--bg-base);
    color: var(--text-primary);
    font-family: var(--font-ui);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    min-height: 100vh;
}

/* Background Glow Effects */
.glow-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.glow-1 {
    position: absolute;
    top: -20%;
    left: 10%;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, rgba(99, 102, 241, 0) 70%);
    filter: blur(80px);
    animation: floating-glow-1 25s infinite alternate ease-in-out;
}

.glow-2 {
    position: absolute;
    bottom: -10%;
    right: 10%;
    width: 800px;
    height: 800px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(236, 72, 153, 0.1) 0%, rgba(236, 72, 153, 0) 70%);
    filter: blur(100px);
    animation: floating-glow-2 30s infinite alternate ease-in-out;
}

@keyframes floating-glow-1 {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(80px, 50px) scale(1.2); }
}

@keyframes floating-glow-2 {
    0% { transform: translate(0, 0) scale(1.1); }
    100% { transform: translate(-100px, -60px) scale(0.9); }
}

a {
    color: var(--primary-light);
    text-decoration: none;
    transition: var(--transition-fast);
}

a:hover {
    color: var(--text-primary);
}

/* ================= TYPOGRAPHY ================= */

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.section-title {
    font-size: 2.25rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    background: linear-gradient(to right, #ffffff, #d1d5db);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.section-subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    font-weight: 400;
}

/* ================= BUTTONS ================= */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    font-family: var(--font-ui);
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 8px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: var(--transition-normal);
}

.btn-primary {
    background: var(--grad-primary);
    color: white;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
}

.btn-primary:hover {
    background: var(--grad-primary-hover);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.45);
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: rgba(255, 255, 255, 0.05);
    border-color: var(--border-color);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: var(--border-color-hover);
}

.btn-large {
    padding: 0.875rem 1.75rem;
    font-size: 1.05rem;
    border-radius: 10px;
}

.btn-full {
    width: 100%;
}

.btn-icon {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    width: 38px;
    height: 38px;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.btn-icon:hover {
    color: var(--text-primary);
    background-color: rgba(255, 255, 255, 0.05);
    border-color: var(--border-color-hover);
}

/* ================= HEADER ================= */

.main-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: rgba(11, 15, 25, 0.75);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-color);
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 800;
    color: white;
}

.logo-subtext {
    font-weight: 400;
    opacity: 0.85;
}

@media (max-width: 768px) {
    .logo-subtext {
        display: none;
    }
}

.logo-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: var(--grad-primary);
    color: white;
    font-size: 1.1rem;
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.4);
}

.nav-menu {
    display: flex;
    gap: 0.5rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 500;
    transition: var(--transition-fast);
}

.nav-link:hover, .nav-link.active {
    color: var(--text-primary);
    background-color: rgba(255, 255, 255, 0.05);
}

.nav-link.active {
    border-bottom: 2px solid var(--primary);
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    background-color: rgba(255, 255, 255, 0.02);
}

/* ================= MAIN SECTIONS ================= */

.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2.5rem 1.5rem 5rem 1.5rem;
}

.app-section {
    display: none;
    animation: fade-in 0.4s ease-out;
}

.app-section.active {
    display: block;
}

@keyframes fade-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.section-header {
    margin-bottom: 2.5rem;
    text-align: left;
}

/* ================= BENEFITS GRID ================= */
.benefits-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.benefit-card {
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    gap: 1.25rem;
    transition: var(--transition-normal);
    box-shadow: var(--shadow-sm);
}

.benefit-card:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.12);
    transform: translateY(-4px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
}

.benefit-icon {
    flex: 0 0 45px;
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.15), rgba(6, 182, 212, 0.15));
    border: 1px solid rgba(79, 70, 229, 0.3);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: #38BDF8;
    transition: var(--transition-normal);
}

.benefit-card:hover .benefit-icon {
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.3), rgba(6, 182, 212, 0.3));
    border-color: rgba(79, 70, 229, 0.6);
    color: #F0F9FF;
    box-shadow: 0 0 15px rgba(6, 182, 212, 0.4);
}

.benefit-content {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.benefit-content h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.benefit-content p {
    font-size: 0.85rem;
    line-height: 1.5;
    color: var(--text-secondary);
    margin: 0;
}

@media (max-width: 1024px) {
    .benefits-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .benefits-container {
        grid-template-columns: 1fr;
        gap: 1rem;
        margin-bottom: 2rem;
    }
}

/* ================= BOOKSHELF (BOOK GRID) ================= */

.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
}

/* Glassmorphism book cards */
.book-card {
    background-color: var(--bg-surface);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: var(--transition-normal);
    box-shadow: var(--shadow-md);
}

.book-card:hover {
    transform: translateY(-8px);
    border-color: var(--border-color-hover);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3), var(--shadow-glow);
}

.book-cover-container {
    position: relative;
    height: 380px;
    width: 100%;
    overflow: hidden;
    background: var(--grad-card-cover);
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid var(--border-color);
}

.book-cover-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-normal);
}

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

.book-cover-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 2rem;
    text-align: center;
    color: rgba(255, 255, 255, 0.85);
    background: var(--grad-primary);
    opacity: 0.85;
}

.book-cover-placeholder i {
    font-size: 3rem;
    text-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.book-placeholder-title {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.5rem;
    line-height: 1.2;
}

.book-badge-paid {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--grad-primary);
    color: white;
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.book-badge-free {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: #10B981;
    color: white;
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.book-card-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.book-card-title {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    font-family: var(--font-heading);
    line-height: 1.3;
    cursor: pointer;
    transition: color 0.2s ease;
}

.book-card-title:hover {
    color: var(--primary);
}

.book-card-author {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.book-card-description {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-grow: 1;
}

.book-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.book-card-price {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.2rem;
}

/* ================= BOOK DETAILS VIEW ================= */

.back-nav {
    margin-bottom: 1.5rem;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.back-link:hover {
    color: var(--text-primary);
}

.book-detail-container {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 3rem;
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 2.5rem;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

@media (max-width: 768px) {
    .book-detail-container {
        grid-template-columns: 1fr;
        gap: 2rem;
        padding: 1.5rem;
    }
    .book-detail-cover {
        max-width: 240px;
        margin: 0 auto;
    }
}

.book-detail-cover {
    width: 100%;
    aspect-ratio: 1 / 1.4;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    background: var(--grad-card-cover);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg);
}

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

.book-detail-cover-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem;
    color: white;
    background: var(--grad-primary);
    opacity: 0.9;
}

.book-detail-cover-placeholder i {
    font-size: 3.5rem;
    margin-bottom: 1rem;
}

.book-detail-info h2 {
    font-size: 2.25rem;
    line-height: 1.2;
    margin-bottom: 0.5rem;
}

.book-detail-author {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.book-detail-price-box {
    display: inline-flex;
    align-items: center;
    gap: 1.5rem;
    background: rgba(255, 255, 255, 0.03);
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    margin-bottom: 2rem;
}

.detail-price-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.detail-price-val {
    font-size: 1.5rem;
    font-weight: 700;
    font-family: var(--font-heading);
}

.book-detail-desc {
    font-size: 1.05rem;
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
}

.book-detail-chapters {
    border-top: 1px solid var(--border-color);
    padding-top: 2rem;
}

.book-detail-chapters h3 {
    margin-bottom: 1.25rem;
    font-size: 1.35rem;
}

.chapters-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.chapter-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    transition: var(--transition-fast);
}

.chapter-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--border-color-hover);
}

.chapter-item-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.chapter-index {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.chapter-title {
    font-weight: 500;
}

.chapter-status-tag {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    font-weight: 500;
}

.tag-free {
    background-color: rgba(16, 185, 129, 0.15);
    color: #10B981;
}

.tag-locked {
    background-color: rgba(239, 68, 68, 0.15);
    color: #EF4444;
}

.tag-unlocked {
    background-color: rgba(99, 102, 241, 0.15);
    color: #818CF8;
}

/* ================= READER INTERFACE ================= */

.reader-section {
    padding-top: 1rem;
    max-width: 800px; /* Centered narrow column for reading */
}

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

.reader-meta {
    text-align: center;
}

.reader-book-title {
    font-size: 1.1rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.reader-chapter-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-primary);
}

.reader-container {
    position: relative;
    min-height: 400px;
    margin-bottom: 3rem;
}

/* Typography for reading */
.reader-article {
    font-family: var(--font-reader);
    font-size: 1.15rem; /* Large and readable */
    line-height: 1.8;
    color: #e5e7eb;
}

.reader-article p {
    margin-bottom: 1.5rem;
    text-indent: 2rem;
    text-align: justify;
}

/* Locked chapters paywall overlay */
.paywall-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 70%;
    background: var(--grad-dark-overlay);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 2rem;
    border-radius: 12px;
}

.paywall-card {
    background: rgba(30, 41, 59, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 20px;
    padding: 2.5rem;
    width: 100%;
    max-width: 500px;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0,0,0,0.5);
    transform: translateY(20px);
    animation: paywall-slide-up 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes paywall-slide-up {
    to { transform: translateY(0); }
}

.paywall-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.15);
    color: #EF4444;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    margin-bottom: 1rem;
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.2);
}

.paywall-card h3 {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
}

.paywall-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 1.5rem;
    text-indent: 0;
}

.price-tag {
    margin-bottom: 1.5rem;
}

.price-value {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 800;
    color: white;
}

.price-currency {
    font-size: 1.25rem;
    color: var(--text-secondary);
}

.payment-safety-note {
    margin-top: 1rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
}

.reader-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.chapter-progress {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ================= AUTHOR DASHBOARD ================= */

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.stat-card {
    background-color: var(--bg-surface);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    box-shadow: var(--shadow-sm);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.icon-blue { background: rgba(59, 130, 246, 0.15); color: #3B82F6; }
.icon-purple { background: rgba(168, 85, 247, 0.15); color: #A855F7; }
.icon-pink { background: rgba(236, 72, 153, 0.15); color: #EC4899; }
.icon-orange { background: rgba(249, 115, 22, 0.15); color: #F97316; }

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.stat-number {
    font-size: 1.5rem;
    font-family: var(--font-heading);
    font-weight: 700;
}

/* Dashboard Layout */
.dashboard-layout {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 2rem;
}

@media (max-width: 992px) {
    .dashboard-layout {
        grid-template-columns: 1fr;
    }
}

.dashboard-main-panel {
    background-color: var(--bg-surface);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
}

.panel-title {
    font-size: 1.25rem;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dashboard-books-table-wrapper {
    overflow-x: auto;
}

.dashboard-books-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.dashboard-books-table th {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.85rem;
}

.dashboard-books-table td {
    padding: 1.2rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    vertical-align: middle;
}

.table-book-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.table-book-cover {
    width: 42px;
    height: 56px;
    border-radius: 4px;
    overflow: hidden;
    background: var(--grad-card-cover);
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.table-book-cover-placeholder {
    width: 100%;
    height: 100%;
    background: var(--grad-primary);
    color: white;
    font-size: 0.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.table-book-title {
    font-weight: 600;
    font-size: 0.95rem;
}

.table-actions {
    display: flex;
    gap: 0.5rem;
}

/* Side panel elements */
.panel-card {
    background-color: var(--bg-surface);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.payment-status-card {
    border-left: 4px solid var(--primary);
}

.status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    margin-bottom: 1rem;
}

.status-indicator.warning {
    background-color: rgba(249, 115, 22, 0.15);
    color: #F97316;
}

.status-indicator.success {
    background-color: rgba(16, 185, 129, 0.15);
    color: #10B981;
}

.status-indicator .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: currentColor;
    display: inline-block;
}

.payment-setup-summary {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 1.25rem;
    line-height: 1.4;
}

.activity-list {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.activity-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.activity-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.activity-meta {
    display: flex;
    flex-direction: column;
}

.activity-book-title {
    font-weight: 500;
    color: var(--text-primary);
}

.activity-time {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.activity-amount {
    font-weight: 600;
    color: #10B981;
}

.empty-state {
    color: var(--text-muted);
    font-size: 0.85rem;
    text-align: center;
    padding: 1rem 0;
}

/* ================= EDITORS (FORMS) ================= */

.editor-container {
    background-color: var(--bg-surface);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 2.5rem;
    max-width: 900px;
    margin: 0 auto;
}

.editor-header {
    margin-bottom: 2rem;
}

.editor-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
}

@media (max-width: 576px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group.flex-2 { flex: 2; }
.form-group.flex-1 { flex: 1; }

.form-group label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
}

.required {
    color: var(--accent-pink);
}

.form-group input, .form-group textarea, .form-group select {
    background-color: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    font-family: var(--font-ui);
    font-size: 0.95rem;
    transition: var(--transition-fast);
}

.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
    outline: none;
    border-color: var(--primary);
    background-color: rgba(255, 255, 255, 0.05);
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.15);
}

.form-help {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 1rem;
}

/* Chapters Manager Inside Book Metadata */
.chapters-manager-container {
    margin-top: 3rem;
    border-top: 1px solid var(--border-color);
    padding-top: 2rem;
}

.chapters-manager-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.chapters-list-wrapper {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    padding: 0.5rem;
}

.chapters-edit-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.chapter-edit-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    border: 1px solid transparent;
}

.chapter-edit-item:hover {
    background: rgba(255, 255, 255, 0.04);
}

.chapter-edit-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.chapter-edit-title {
    font-weight: 500;
    font-size: 0.95rem;
}

/* ================= PAYMENTS & SETTINGS SECTION ================= */

.settings-container {
    max-width: 1000px;
    margin: 0 auto;
}

.settings-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 2rem;
}

@media (max-width: 768px) {
    .settings-grid {
        grid-template-columns: 1fr;
    }
}

.settings-card {
    background-color: var(--bg-surface);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 2rem;
}

.card-intro {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.settings-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Custom Switch Toggle */
.alert-box-settings {
    background: rgba(99, 102, 241, 0.05);
    border: 1px dashed rgba(99, 102, 241, 0.25);
    border-radius: 12px;
    padding: 1.25rem;
}

.toggle-container {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
    flex-shrink: 0;
}

.switch input { 
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.1);
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
}

input:checked + .slider {
    background: var(--grad-primary);
}

input:checked + .slider:before {
    transform: translateX(24px);
}

.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

.toggle-text strong {
    display: block;
    font-size: 0.95rem;
    color: var(--text-primary);
    margin-bottom: 0.15rem;
}

.toggle-text p {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.guide-card h3 {
    font-size: 1.15rem;
    margin-bottom: 1.25rem;
}

.setup-steps {
    list-style-type: none;
    counter-reset: steps-counter;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.setup-steps li {
    position: relative;
    padding-left: 2.25rem;
    counter-increment: steps-counter;
}

.setup-steps li::before {
    content: counter(steps-counter);
    position: absolute;
    left: 0;
    top: 2px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--grad-primary);
    color: white;
    font-weight: 700;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.setup-steps li strong {
    display: block;
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
}

.setup-steps li p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.info-alert {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.info-alert i {
    color: var(--primary-light);
    margin-top: 0.15rem;
}

.info-alert p {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.45;
}

/* ================= MODAL WINDOW ================= */

.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(5, 8, 16, 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-backdrop.active {
    display: flex;
}

.modal-card {
    background-color: var(--bg-surface-opaque);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    width: 100%;
    max-width: 480px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    animation: modal-enter 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes modal-enter {
    from { opacity: 0; transform: scale(0.9) translateY(20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

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

.modal-body {
    padding: 2rem 1.5rem;
}

.text-center {
    text-align: center;
}

.close-modal {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.25rem;
    transition: var(--transition-fast);
}

.close-modal:hover {
    color: var(--text-primary);
}

/* MonoPay Sim Brand Logo */
.mono-logo-sim {
    margin-bottom: 1.5rem;
    font-size: 2.25rem;
    font-weight: 800;
}
.mono-brand { color: white; }
.mono-pay {
    background: #e11d48;
    color: white;
    padding: 0.1rem 0.5rem;
    border-radius: 6px;
    margin-left: 0.15rem;
}

.sim-book-title {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.sim-price {
    font-size: 2rem;
    font-weight: 800;
    color: white;
    margin-bottom: 1.5rem;
    font-family: var(--font-heading);
}

/* Card Mockup in Simulator */
.sim-card-box {
    width: 260px;
    height: 160px;
    margin: 0 auto 2rem auto;
    perspective: 1000px;
}

.sim-card-front {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #111 0%, #333 100%);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 1.25rem;
    text-align: left;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
}

.card-chip {
    width: 36px;
    height: 26px;
    background: linear-gradient(135deg, #fbbf24 0%, #d97706 100%);
    border-radius: 4px;
}

.card-number-placeholder {
    font-family: monospace;
    font-size: 1.1rem;
    letter-spacing: 2px;
    color: white;
    margin-top: 1rem;
}

.card-name-placeholder {
    font-size: 0.75rem;
    color: var(--text-secondary);
    letter-spacing: 1px;
}

.sim-info-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.4;
    margin-bottom: 2rem;
}

.modal-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

/* ================= TOAST SYSTEM ================= */

.toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    z-index: 2000;
}

.toast {
    background: rgba(30, 41, 59, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    border-radius: 8px;
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
    min-width: 280px;
    transform: translateX(120%);
    animation: toast-enter 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes toast-enter {
    to { transform: translateX(0); }
}

.toast.toast-success { border-left: 4px solid #10B981; }
.toast.toast-error { border-left: 4px solid #EF4444; }
.toast.toast-info { border-left: 4px solid #3B82F6; }

.toast-icon {
    font-size: 1.1rem;
}
.toast-icon-success { color: #10B981; }
.toast-icon-error { color: #EF4444; }
.toast-icon-info { color: #3B82F6; }

/* Custom Woodcarving Integrations & Premium Elements */
.wood-nav-link {
    color: #10B981 !important;
    font-weight: 600;
}
.wood-nav-link:hover {
    color: #34D399 !important;
    background-color: rgba(16, 185, 129, 0.08) !important;
}

.woodcarving-promo-card {
    margin-top: 4rem;
    padding: 2.5rem;
    background: linear-gradient(135deg, rgba(20, 83, 45, 0.4) 0%, rgba(43, 27, 23, 0.4) 100%);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 1.25rem;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    flex-wrap: wrap;
    backdrop-filter: blur(10px);
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.woodcarving-promo-card:hover {
    transform: translateY(-2px);
    border-color: rgba(16, 185, 129, 0.4);
}

.author-bio-card-premium {
    display: flex;
    gap: 3rem;
    background: linear-gradient(135deg, rgba(22, 28, 45, 0.6) 0%, rgba(15, 23, 42, 0.8) 100%);
    border: 1px solid rgba(99, 102, 241, 0.15);
    border-radius: 1.25rem;
    padding: 3.5rem;
    align-items: flex-start;
    flex-wrap: wrap;
    box-shadow: var(--shadow-lg), 0 0 30px rgba(99, 102, 241, 0.05);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.author-bio-card-premium:hover {
    border-color: rgba(99, 102, 241, 0.3);
    box-shadow: var(--shadow-lg), 0 0 40px rgba(99, 102, 241, 0.1);
}
