/* ================================
   BOOKCUBICLE CUSTOM STYLES
   Organized following DX/CX architecture
   ================================ */

/* ---- Body content: align with header/footer container ---- */
/* Uses direct-child selector so only the outermost container-fluid per page
   is constrained; nested ones (e.g. Writer sidebar content) are unaffected. */
main.bc-content > .container-fluid {
    margin-left: auto;
    margin-right: auto;
}
main.bc-content > .container-fluid.bc-full-width {
    max-width: none;
    margin-left: 0;
    margin-right: 0;
}
@media (min-width: 576px)  { main.bc-content > .container-fluid { max-width: 540px; } }
@media (min-width: 768px)  { main.bc-content > .container-fluid { max-width: 720px; } }
@media (min-width: 992px)  { main.bc-content > .container-fluid { max-width: 960px; } }
@media (min-width: 1200px) { main.bc-content > .container-fluid { max-width: 1140px; } }
@media (min-width: 1400px) { main.bc-content > .container-fluid { max-width: 1320px; } }

/* ---- Footer: reduce padding and polish alignment ---- */
.filmoja-footer-area .section_70 {
    padding: 40px 0;
}
.filmoja-footer-area .single-footer-widget {
    padding-right: 20px;
}
.filmoja-footer-area .copyright-area {
    padding: 12px 0;
}

/* ---- Main Header ---- */
.main-header-area {
    position: relative;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}
.main-header-area .row {
    align-items: center;
    min-height: 72px;
}

/* ---- Hamburger menu: anchor to white header, vertically centred ---- */
.filmoja-responsive-menu {
    top: 50%;
    transform: translateY(-50%);
    right: 15px;
    width: auto;
}
/* Slicknav dropdown should still span full width */
.filmoja-responsive-menu .slicknav_nav {
    position: absolute;
    right: -15px;
    width: 100vw;
    top: 100%;
}

/* ---- Site Logo ---- */
.site-logo {
    margin: 8px 0;
}
.site-logo img {
    width: auto;
    height: 58px;
    max-width: 100%;
}

/* ---- Nav Links ---- */
.mainmenu ul > li > a {
    padding: 14px 12px;
    font-size: 0.875rem;
    font-weight: 500;
    letter-spacing: 0.03em;
}

/* ---- Search Bar ---- */
.header-main-search {
    margin: 0;
}
.header-main-search form {
    background: #ffffff;
    border: 1.5px solid #dee2e6;
    border-radius: 24px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.header-main-search form:focus-within {
    border-color: #ec7532;
    box-shadow: 0 0 0 3px rgba(236, 117, 50, 0.12);
}
.header-main-search form input {
    color: #495057;
    font-size: 0.875rem;
    padding: 5px 46px 5px 18px;
}
.header-main-search form button {
    color: #ec7532;
    font-size: 0.95rem;
}

/* ================================
   1. CSS CUSTOM PROPERTIES (VARIABLES)
   ================================ */
:root {
    /* Primary Colors */
    --primary-color: #ec7532;
    --primary-hover: #d66429;
    --primary-light: #f4935c;
    --primary-dark: #bf5a28;
    
    /* Semantic Colors */
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --info-color: #17a2b8;
    
    /* Neutral Colors */
    --white: #ffffff;
    --gray-50: #f8f9fa;
    --gray-100: #f1f3f4;
    --gray-200: #e9ecef;
    --gray-300: #dee2e6;
    --gray-400: #ced4da;
    --gray-500: #6c757d;
    --gray-600: #495057;
    --gray-700: #333333;
    --gray-800: #212529;
    --gray-900: #1a1a1a;
    
    /* Background Colors */
    --bg-primary: #f8f9fa;
    --bg-secondary: #ffffff;
    --bg-accent: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    
    /* Typography */
    --font-family-base: 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 1.875rem;
    --font-size-4xl: 2.25rem;
    
    /* Line Heights */
    --line-height-tight: 1.25;
    --line-height-normal: 1.5;
    --line-height-relaxed: 1.625;
    
    /* Font Weights */
    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
    
    /* Spacing Scale */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 2.5rem;
    --spacing-3xl: 3rem;
    
    /* Border Radius */
    --border-radius-sm: 4px;
    --border-radius-md: 8px;
    --border-radius-lg: 12px;
    --border-radius-xl: 16px;
    --border-radius-full: 50%;
    
    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07), 0 1px 3px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1), 0 4px 6px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.1), 0 10px 10px rgba(0, 0, 0, 0.04);
    
    /* Transitions */
    --transition-fast: 0.15s ease-in-out;
    --transition-normal: 0.2s ease-in-out;
    --transition-slow: 0.3s ease-in-out;
    
    /* Z-Index Scale */
    --z-index-dropdown: 1000;
    --z-index-sticky: 1020;
    --z-index-fixed: 1030;
    --z-index-modal: 1050;
    --z-index-popover: 1060;
    --z-index-tooltip: 1070;
}

/* ================================
   2. UTILITY CLASSES
   ================================ */

/* Animation Utilities */
/* Initial hidden state for elements that will be animated */
.fade-in-prepare {
    opacity: 0;
    transform: translateY(10px);
}

/* Animation class that overrides the prepare state */
.fade-in {
    animation: fadeInUp var(--transition-slow) ease-out forwards;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.fade-out {
    opacity: 0;
    transform: translateY(-10px);
    transition: all var(--transition-slow);
}

/* Loading States */
.loading {
    position: relative;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--gray-200);
    border-top: 2px solid var(--primary-color);
    border-radius: var(--border-radius-full);
    animation: spin 1s linear infinite;
}

/* Spacing Utilities */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-xl);
    padding-bottom: var(--spacing-md);
    border-bottom: 1px solid var(--gray-200);
    flex-wrap: wrap;
    gap: var(--spacing-md);
}

.page-title {
    font-size: var(--font-size-3xl);
    font-weight: var(--font-weight-semibold);
    margin: 0 0 var(--spacing-sm) 0;
    color: var(--gray-700);
}

.page-description {
    margin-top: var(--spacing-sm);
    color: var(--gray-500);
    margin-bottom: 0;
}

.page-actions {
    display: flex;
    gap: var(--spacing-sm);
}

/* ================================
   3. COMPONENT LIBRARY
   ================================ */

/* Book Card Component */
.book-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius-md);
    transition: all var(--transition-normal);
    overflow: hidden;
    height: 100%;
    position: relative;
}

.book-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.book-card__cover {
    position: relative;
    overflow: hidden;
}

.book-card__cover-image {
    width: 100%;
    aspect-ratio: 2/3;
    max-height: 220px;
    object-fit: cover;
    transition: transform var(--transition-normal);
    display: block;
}

.book-card:hover .book-card__cover-image {
    transform: scale(1.05);
}

/* Dark overlay on hover so action buttons are legible over any cover */
.book-card__cover::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0);
    transition: background var(--transition-normal);
    z-index: 1;
    pointer-events: none;
}

.book-card:hover .book-card__cover::before {
    background: rgba(0, 0, 0, 0.38);
}

.book-card__badges {
    position: absolute;
    top: var(--spacing-sm);
    right: var(--spacing-sm);
    z-index: 3;
}

.book-card__badge {
    display: block;
    margin-bottom: var(--spacing-xs);
    font-size: var(--font-size-xs);
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--border-radius-sm);
}

.book-card__badge--featured {
    background: var(--warning-color);
    color: var(--gray-800);
}

.book-card__badge--completed {
    background: var(--success-color);
    color: var(--white);
}

.book-card__badge--ongoing {
    background: var(--info-color);
    color: var(--white);
}

.book-card__badge--translation {
    background: var(--gray-500);
    color: var(--white);
}

.book-card__actions {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-sm);
    opacity: 0;
    transition: opacity var(--transition-normal);
    z-index: 2;
    white-space: nowrap;
}

.book-card:hover .book-card__actions {
    opacity: 1;
}

.book-card__info {
    padding: var(--spacing-md);
    display: flex;
    flex-direction: column;
    flex: 1;
}

.book-card__title {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
    line-height: var(--line-height-tight);
    margin-bottom: var(--spacing-sm);
    color: var(--gray-800);
}

.book-card__title a {
    color: inherit;
    text-decoration: none;
    transition: color var(--transition-normal);
}

.book-card__title a:hover {
    color: var(--primary-color);
}

.book-card__description {
    color: var(--gray-600);
    font-size: var(--font-size-sm);
    line-height: var(--line-height-normal);
    margin-bottom: var(--spacing-md);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.book-card__meta {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.book-card__meta-row {
    display: flex;
    align-items: center;
    font-size: var(--font-size-sm);
    color: var(--gray-500);
}

.book-card__meta-label {
    margin-right: var(--spacing-sm);
}

.book-card__meta-value {
    font-weight: var(--font-weight-medium);
}


.book-card__dates {
    margin-top: var(--spacing-md);
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--gray-200);
}

/* Author Card Component */
.author-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-normal);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.author-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.author-card__avatar {
    padding: var(--spacing-xl) var(--spacing-xl) var(--spacing-sm);
    text-align: center;
}

.author-card__avatar-image {
    width: 120px;
    height: 120px;
    border-radius: var(--border-radius-full);
    object-fit: cover;
    margin: 0 auto;
    display: block;
    border: 2px solid var(--gray-200);
    transition: transform var(--transition-normal);
}

.author-card:hover .author-card__avatar-image {
    transform: scale(1.05);
}

.author-card__avatar-placeholder {
    width: 120px;
    height: 120px;
    border-radius: var(--border-radius-full);
    margin: 0 auto;
    border: 2px solid var(--gray-300);
    background: var(--gray-50);
}

.author-card__info {
    padding: var(--spacing-sm) var(--spacing-xl) var(--spacing-xl);
    flex: 1;
    display: flex;
    flex-direction: column;
}

.author-card__name {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
    margin-bottom: var(--spacing-sm);
    text-align: center;
}

.author-card__name a {
    color: var(--gray-700);
    text-decoration: none;
    transition: color var(--transition-normal);
}

.author-card__name a:hover {
    color: var(--primary-color);
}

.author-card__bio {
    font-size: var(--font-size-sm);
    line-height: var(--line-height-normal);
    color: var(--gray-600);
    text-align: center;
    margin-bottom: var(--spacing-md);
    flex: 1;
}

.author-card__actions {
    margin-top: auto;
    text-align: center;
}

/* Button Component */
.btn {
    display: inline-block;
    padding: var(--spacing-sm) var(--spacing-lg);
    border: 1px solid transparent;
    border-radius: var(--border-radius-sm);
    font-weight: var(--font-weight-medium);
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: all var(--transition-normal);
    font-size: var(--font-size-base);
    line-height: var(--line-height-normal);
}

.btn--primary {
    background: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
}

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

.btn--outline-primary {
    background: transparent;
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn--outline-primary:hover {
    background: var(--primary-color);
    color: var(--white);
}

.btn--success {
    background: var(--success-color);
    color: var(--white);
    border-color: var(--success-color);
}

.btn--lg {
    padding: var(--spacing-md) var(--spacing-xl);
    font-size: var(--font-size-lg);
}

.btn--sm {
    padding: var(--spacing-xs) var(--spacing-md);
    font-size: var(--font-size-sm);
}

/* Form Components */
.form-input,
.form-select {
    width: 100%;
    padding: var(--spacing-sm) var(--spacing-md);
    border: 1px solid var(--gray-300);
    border-radius: var(--border-radius-sm);
    font-size: var(--font-size-base);
    transition: border-color var(--transition-normal);
    background: var(--white);
}

.form-input:focus,
.form-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(236, 117, 50, 0.1);
}

.form-label {
    display: block;
    margin-bottom: var(--spacing-xs);
    font-weight: var(--font-weight-medium);
    color: var(--gray-700);
}

.form-validation {
    display: block;
    margin-top: var(--spacing-xs);
    font-size: var(--font-size-sm);
    color: var(--danger-color);
}

/* Card Component */
.card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-sm);
}

.card__header {
    padding: var(--spacing-lg);
    border-bottom: 1px solid var(--gray-200);
    background: var(--gray-50);
}

.card__title {
    margin: 0;
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-semibold);
    color: var(--gray-800);
}

.card__body {
    padding: var(--spacing-lg);
}

/* Rating Component */
.rating {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.rating__stars {
    display: flex;
    color: var(--warning-color);
}

.rating__value {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
    color: var(--gray-700);
}

.rating__count {
    font-size: var(--font-size-sm);
    color: var(--gray-500);
}

/* Badge Component */
.badge {
    display: inline-block;
    padding: var(--spacing-xs) var(--spacing-sm);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium);
    border-radius: var(--border-radius-sm);
    text-decoration: none;
    transition: all var(--transition-normal);
}

.badge--light {
    background: var(--gray-100);
    color: var(--gray-700);
}

.badge--light:hover {
    background: var(--gray-200);
    color: var(--gray-800);
}

/* ================================
   4. PAGE-SPECIFIC STYLES
   ================================ */

/* Authentication Pages */
.auth-area,
.login-area,
.register-area {
    padding: 80px 0;
    position: relative;
}

.auth-box-left,
.auth-box-right {
    margin-bottom: 40px;
}

.register-area .login-box,
body.register-page .login-box {
    min-height: 400px;
    height: auto;
}

.login-box {
    background: var(--white);
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-md);
    padding: var(--spacing-2xl);
}

.login-box .form-input,
.login-box .form-select {
    margin-bottom: var(--spacing-sm);
}

.login-box .field-validation {
    display: block;
    margin-bottom: var(--spacing-md);
    font-size: var(--font-size-sm);
    color: var(--danger-color);
}

.login-box .checkbox-label {
    display: block;
    margin-bottom: var(--spacing-md);
    line-height: var(--line-height-normal);
    font-size: var(--font-size-sm);
}

.auth-submit-btn {
    background: var(--primary-color) !important;
    border: none !important;
    border-radius: var(--border-radius-sm) !important;
    color: var(--white) !important;
    cursor: pointer;
    display: inline-block;
    font-weight: var(--font-weight-medium) !important;
    padding: var(--spacing-md) var(--spacing-xl) !important;
    text-transform: capitalize;
    width: 100% !important;
    margin-top: var(--spacing-md);
    transition: background var(--transition-normal) !important;
}

.auth-submit-btn:hover {
    background: var(--primary-hover) !important;
}

.auth-page-wrapper {
    min-height: calc(100vh - 200px);
}

.validation-summary {
    margin-bottom: var(--spacing-lg);
    padding: var(--spacing-md);
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: var(--border-radius-sm);
    color: #721c24;
}

/* Profile Pages */
.profile-area {
    background: var(--bg-primary);
    min-height: 100vh;
}

/* Profile Sidebar Cards - Phase 1 Redesign */
.profile-sidebar {
    position: sticky;
    top: 100px;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

/* Shared card style for all sidebar cards */
.profile-card,
.stats-card,
.links-card {
    background: var(--white);
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--gray-200);
}

/* Profile Card */
.profile-card {
    overflow: hidden;
}

.profile-card-avatar {
    display: flex;
    justify-content: center;
    padding-top: var(--spacing-xl);
}

.avatar-wrap {
    position: relative;
    display: inline-block;
}

.profile-card-avatar .avatar-image {
    width: 88px;
    height: 88px;
    border-radius: var(--border-radius-full);
    border: 3px solid #fbd8bc;
    object-fit: cover;
}

.profile-card-avatar .avatar-placeholder {
    width: 88px;
    height: 88px;
    border-radius: var(--border-radius-full);
    background: var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid #fbd8bc;
}

.profile-card-avatar .avatar-placeholder i {
    font-size: 32px;
    color: var(--gray-500);
}

.avatar-camera-btn {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 26px;
    height: 26px;
    border-radius: var(--border-radius-full);
    background: var(--primary-color);
    border: 2px solid var(--white);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background var(--transition-normal);
}

.avatar-camera-btn:hover {
    background: var(--primary-hover);
}

.avatar-camera-btn i {
    font-size: 12px;
}

.profile-card-body {
    padding: var(--spacing-lg) var(--spacing-lg);
    text-align: center;
}

.profile-card-name {
    margin: 0 0 var(--spacing-xs) 0;
    font-size: 18px;
    font-weight: var(--font-weight-bold);
    color: var(--gray-900);
}

.profile-card-handle {
    margin: 0 0 var(--spacing-sm) 0;
    font-size: 13px;
    color: var(--gray-500);
}

.profile-card-role {
    margin: 0 0 var(--spacing-sm) 0;
}

.profile-card-role .badge {
    font-size: var(--font-size-xs);
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: 12px;
}

.badge-reader {
    background: var(--success-color);
    color: var(--white);
}

.badge-writer {
    background: var(--info-color);
    color: var(--white);
}

.badge-admin {
    background: var(--danger-color);
    color: var(--white);
}

.badge-moderator {
    background: var(--gray-600);
    color: var(--white);
}

.profile-card-joined {
    margin: 0 0 var(--spacing-lg) 0;
    font-size: 12px;
    color: var(--gray-400);
}

.profile-card-joined i {
    margin-right: 4px;
}

.btn-edit-profile,
.btn-view-all,
.btn-empty-cta {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    border-radius: 24px;
    color: var(--white);
    font-weight: var(--font-weight-semibold);
    text-decoration: none;
    text-align: center;
    transition: all var(--transition-normal);
    border: none;
}

.btn-edit-profile:hover,
.btn-view-all:hover,
.btn-empty-cta:hover {
    background: linear-gradient(135deg, var(--primary-hover), var(--primary-color));
    color: var(--white);
    transform: translateY(-1px);
}

.btn-edit-profile {
    display: block;
    width: 100%;
    padding: var(--spacing-sm) var(--spacing-lg);
    font-size: 13px;
}

/* Statistics Card */
.stats-card {
    padding: var(--spacing-lg);
}

.stats-card-title,
.links-card-title {
    margin: 0 0 var(--spacing-md) 0;
    font-size: 13px;
    font-weight: var(--font-weight-bold);
    color: var(--gray-600);
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.stats-card-body {
}

.stats-grid-row {
    display: flex;
    gap: var(--spacing-md);
    justify-content: space-between;
}

.stats-grid-row .stat-item {
    flex: 1;
}

.stats-grid-2x2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-md);
}

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

.stat-item .stat-value {
    font-size: 24px;
    font-weight: var(--font-weight-bold);
    color: var(--primary-color);
    line-height: 1.2;
    margin-bottom: 2px;
}

.stat-item .stat-value i {
    font-size: 16px;
    margin-left: 4px;
}

.stat-item .stat-label {
    font-size: 11px;
    color: var(--gray-400);
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

/* Quick Links Card */
.links-card {
    padding: var(--spacing-md) 0;
}

.links-card-title {
    padding-left: 20px;
}

.links-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.link-item {
    padding: 10px 20px;
    border-left: 3px solid transparent;
    transition: all var(--transition-fast);
}

.link-item a {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-size: 13px;
    color: var(--gray-600);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.link-item a i {
    font-size: 14px;
    width: 20px;
    text-align: center;
    color: var(--gray-400);
    transition: color var(--transition-fast);
}

.link-item:not(:first-child) {
    border-top: 1px solid var(--gray-50);
}

.link-item:hover {
    background: #fef3ec;
    border-left-color: var(--primary-color);
}

.link-item:hover a {
    color: var(--primary-color);
}

.link-item:hover a i {
    color: var(--primary-color);
}

/* Profile Content Cards - Phase 2 Redesign */
.profile-content {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

/* Content Card - shared style */
.content-card {
    background: var(--white);
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--gray-200);
    overflow: hidden;
}

.content-card-header {
    padding: 16px 20px 12px;
    border-bottom: 1px solid var(--gray-100);
    background: var(--gray-50);
}

.content-card-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: var(--font-weight-bold);
    color: var(--gray-900);
}

.content-card-body {
    padding: 20px;
}

.content-card-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--gray-100);
    text-align: center;
}

/* About Section */
.bio-text {
    font-size: 14px;
    color: var(--gray-600);
    line-height: 1.6;
    margin: 0;
}

.empty-text {
    font-size: 14px;
    color: var(--gray-400);
    margin: 0;
}

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

.empty-link:hover {
    text-decoration: underline;
}

/* Books Grid - 3 column layout */
.books-grid-3col {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

@media (max-width: 991px) {
    .books-grid-3col {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 575px) {
    .books-grid-3col {
        grid-template-columns: 1fr;
    }
}

/* Book Mini Card */
.book-mini {
    background: var(--white);
    border-radius: 8px;
    border: 1px solid var(--gray-200);
    overflow: hidden;
    transition: all var(--transition-normal);
}

.book-mini:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.10);
    border-color: var(--primary-light);
}

.book-mini a {
    text-decoration: none;
    color: inherit;
    display: block;
}

.book-mini-cover {
    position: relative;
    height: 110px;
    background: var(--gray-100);
    overflow: hidden;
}

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

.book-mini-cover-placeholder {
    width: 100%;
    height: 100%;
    background: var(--gray-200);
}

.book-mini-info {
    padding: 8px 10px;
}

.book-mini-title {
    font-size: 13px;
    font-weight: var(--font-weight-semibold);
    color: var(--gray-900);
    margin: 0 0 6px 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.book-mini-meta {
    font-size: 11px;
    color: var(--gray-400);
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.book-mini-meta i {
    margin-right: 2px;
}

.book-mini-meta span {
    display: inline-flex;
    align-items: center;
}

/* View All Button */
.btn-view-all {
    display: inline-block;
    padding: var(--spacing-sm) var(--spacing-lg);
    font-size: 14px;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: var(--spacing-xl) var(--spacing-md);
}

.empty-state-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto var(--spacing-md);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--border-radius-full);
    background: var(--gray-100);
    opacity: 0.25;
}

.empty-state-icon i {
    font-size: 48px;
}

.empty-state-title {
    font-size: 18px;
    font-weight: var(--font-weight-bold);
    color: var(--gray-600);
    margin: 0 0 var(--spacing-sm) 0;
}

.empty-state-subtitle {
    font-size: 14px;
    color: var(--gray-400);
    margin: 0 0 var(--spacing-lg) 0;
}

.btn-empty-cta {
    display: inline-block;
    padding: var(--spacing-sm) var(--spacing-xl);
    font-size: 14px;
}

/* Settings & ChangePassword Forms */
.settings-field {
    margin-bottom: var(--spacing-lg);
}

.settings-label {
    display: block;
    font-size: 13px;
    font-weight: var(--font-weight-semibold);
    color: var(--gray-700);
    margin-bottom: var(--spacing-xs);
}

.settings-optional {
    font-weight: var(--font-weight-normal);
    color: var(--gray-400);
    font-size: 12px;
}

.settings-input {
    display: block;
    width: 100%;
    padding: 10px 14px;
    font-size: 14px;
    color: var(--gray-800);
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius-md);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    appearance: none;
}

.settings-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(236, 117, 50, 0.12);
}

.settings-input--readonly {
    background: var(--gray-50);
    color: var(--gray-500);
    cursor: not-allowed;
}

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

.settings-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%236b7280' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.settings-hint {
    font-size: 12px;
    color: var(--gray-400);
    margin-top: 4px;
    display: block;
}

.field-error {
    font-size: 12px;
    color: var(--danger-color);
    margin-top: 4px;
    display: block;
}

.settings-actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding-top: var(--spacing-sm);
}

.btn-settings-cancel {
    font-size: 14px;
    color: var(--gray-500);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.btn-settings-cancel:hover {
    color: var(--gray-700);
}

.settings-avatar-preview {
    display: flex;
    flex-direction: column;
}

.settings-avatar-img {
    width: 72px;
    height: 72px;
    border-radius: var(--border-radius-full);
    border: 3px solid #fbd8bc;
    object-fit: cover;
}

/* Profile Page Responsive - Phase 3 */
@media (max-width: 991px) {
    /* Sidebar stacks above content on tablets */
    .profile-sidebar {
        position: static;
        margin-bottom: var(--spacing-lg);
    }

    /* Adjust stats card for smaller screens */
    .stats-grid-2x2 {
        gap: var(--spacing-sm);
    }

    .stat-item .stat-value {
        font-size: 20px;
    }

    .stat-item .stat-label {
        font-size: 10px;
    }

    /* Content card adjustments */
    .content-card-body {
        padding: 16px;
    }

    /* Book grid stays 2 columns on tablet */
    .books-grid-3col {
        gap: 12px;
    }
}

@media (max-width: 767px) {
    /* Profile card adjustments */
    .profile-card-avatar .avatar-image,
    .profile-card-avatar .avatar-placeholder {
        width: 72px;
        height: 72px;
    }

    .profile-card-name {
        font-size: 16px;
    }

    .profile-card-handle {
        font-size: 12px;
    }

    .btn-edit-profile {
        font-size: 12px;
        padding: 8px 16px;
    }

    /* Stats card - stack vertically on mobile */
    .stats-grid-row {
        flex-direction: column;
        gap: var(--spacing-md);
    }

    .stats-grid-2x2 {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Quick links - full width touch targets */
    .link-item {
        padding: 12px 16px;
    }

    .link-item a {
        font-size: 14px;
    }

    /* Content cards */
    .content-card-header {
        padding: 12px 16px;
    }

    .content-card-header h3 {
        font-size: 14px;
    }

    .content-card-body {
        padding: 16px;
    }

    /* Empty state */
    .empty-state-icon {
        width: 56px;
        height: 56px;
        font-size: 28px;
    }

    .empty-state-icon i {
        font-size: 40px;
    }

    .empty-state-title {
        font-size: 16px;
    }

    .empty-state-subtitle {
        font-size: 13px;
    }
}

@media (max-width: 575px) {
    /* Sidebar */
    .profile-sidebar {
        top: 0;
        position: static;
    }

    /* Stats grid - keep 2 columns for Writer, stack for Reader */
    .stats-grid-2x2 {
        grid-template-columns: 1fr 1fr;
        gap: var(--spacing-sm);
    }

    .stats-grid-row {
        gap: var(--spacing-sm);
    }

    .stat-item .stat-value {
        font-size: 18px;
    }

    .stat-item .stat-label {
        font-size: 9px;
    }

    /* Book grid - single column */
    .books-grid-3col {
        gap: 10px;
    }

    .book-mini-cover {
        height: 140px;
    }

    .book-mini-title {
        font-size: 14px;
    }

    .book-mini-meta {
        font-size: 12px;
    }

    /* Buttons */
    .btn-view-all,
    .btn-empty-cta {
        width: 100%;
        padding: 10px 20px;
    }
}

/* Old profile styles - deprecated, kept for backwards compatibility */
.profile-header {
    padding: var(--spacing-2xl);
    text-align: center;
    background: var(--bg-accent);
    color: var(--white);
    position: relative;
}

.profile-avatar {
    margin-bottom: var(--spacing-lg);
}

.avatar-image {
    width: 120px;
    height: 120px;
    border-radius: var(--border-radius-full);
    border: 4px solid rgba(255, 255, 255, 0.2);
    object-fit: cover;
    transition: transform var(--transition-slow);
}

.avatar-image:hover {
    transform: scale(1.05);
}

.avatar-placeholder {
    width: 120px;
    height: 120px;
    border-radius: var(--border-radius-full);
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    border: 4px solid rgba(255, 255, 255, 0.2);
}

.avatar-placeholder i {
    font-size: 48px;
    color: rgba(255, 255, 255, 0.8);
}

.profile-name {
    margin: 0 0 var(--spacing-sm) 0;
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-semibold);
}

.profile-role .badge {
    font-size: var(--font-size-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: 20px;
}

.profile-join-date {
    margin: var(--spacing-md) 0 0 0;
    opacity: 0.9;
    font-size: var(--font-size-sm);
}

.profile-bio {
    padding: var(--spacing-xl) var(--spacing-2xl);
    border-bottom: 1px solid var(--gray-200);
}

.profile-bio h4 {
    margin-bottom: var(--spacing-md);
    color: var(--gray-700);
    font-size: var(--font-size-lg);
}

/* Chapter Pages */
.chapter-row {
    transition: all var(--transition-normal);
    cursor: pointer;
    padding: var(--spacing-md);
    border-bottom: 1px solid var(--gray-200);
}

.chapter-row:hover {
    background-color: var(--gray-50);
    transform: translateX(2px);
}

.chapter-item {
    border-bottom: 1px solid var(--gray-200);
    transition: background-color var(--transition-normal);
}

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

.chapter-item:hover {
    background-color: var(--gray-50);
}

.chapter-title {
    font-weight: var(--font-weight-semibold);
    color: var(--gray-800);
    margin: 0;
}

.chapter-meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-md);
}

.chapter-actions .btn {
    min-width: 80px;
}

.chapter-content-wrapper {
    background: var(--white);
    border-radius: var(--border-radius-md);
    padding: var(--spacing-2xl);
    box-shadow: var(--shadow-md);
    margin-bottom: var(--spacing-2xl);
}

.chapter-text-content {
    font-family: var(--font-family-base);
    line-height: var(--line-height-relaxed);
    color: var(--gray-700);
}

/* Book Details Pages */
.book-detail-cover-image {
    width: 100%;
    max-width: 300px;
    height: 400px;
    object-fit: cover;
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-xl);
}

.book-status-badges {
    position: absolute;
    top: var(--spacing-md);
    right: var(--spacing-md);
    z-index: var(--z-index-dropdown);
}

.book-actions {
    gap: var(--spacing-sm);
}

.book-title {
    font-weight: var(--font-weight-bold);
    color: var(--gray-800);
    line-height: var(--line-height-tight);
}

.book-authors a {
    color: var(--gray-500);
    text-decoration: none;
    transition: color var(--transition-normal);
}

.book-authors a:hover {
    color: var(--primary-color);
}

.book-stats {
    background: var(--gray-50);
    border-radius: var(--border-radius-md);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-md);
}

.metadata-item {
    margin-bottom: var(--spacing-sm);
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

.metadata-label {
    display: inline-block;
    min-width: 120px;
    font-weight: var(--font-weight-medium);
    margin-right: var(--spacing-sm);
}

.metadata-value {
    flex: 1;
}

.metadata-value .badge {
    margin-right: var(--spacing-xs);
    margin-bottom: var(--spacing-xs);
}

.book-progress {
    background: var(--gray-50);
    border-radius: var(--border-radius-md);
    padding: var(--spacing-md);
}

.book-description {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius-md);
    padding: var(--spacing-xl);
    margin-top: var(--spacing-xl);
}

.description-content {
    line-height: var(--line-height-relaxed);
    color: var(--gray-600);
}

/* Book Details Tabs */
.book-details-tabs {
    margin-top: var(--spacing-xl);
}

.book-details-tabs .nav-tabs {
    border-bottom: 2px solid var(--gray-200);
}

.book-details-tabs .nav-link {
    border: none;
    border-bottom: 3px solid transparent;
    background: transparent;
    color: var(--gray-500);
    font-weight: var(--font-weight-medium);
    padding: var(--spacing-sm) var(--spacing-xl);
    transition: all var(--transition-normal);
}

.book-details-tabs .nav-link:hover {
    border-color: var(--gray-300);
    background: var(--gray-50);
    color: var(--gray-600);
}

.book-details-tabs .nav-link.active {
    background: var(--white);
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    font-weight: var(--font-weight-semibold);
}

.tab-content {
    background: var(--white);
    border-radius: 0 0 var(--border-radius-md) var(--border-radius-md);
    min-height: 300px;
}

/* Chapters List */
.chapters-list {
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius-md);
    overflow: hidden;
}

/* Reviews Section */
.write-review-section {
    background: var(--gray-50);
    border-radius: var(--border-radius-md);
    padding: var(--spacing-xl);
    border: 1px solid var(--gray-200);
}

.reviews-list {
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius-md);
    overflow: hidden;
}

.review-item {
    border-bottom: 1px solid var(--gray-200);
    transition: background-color var(--transition-normal);
}

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

.review-item:hover {
    background-color: var(--gray-50);
}

.reviewer-name {
    font-weight: var(--font-weight-semibold);
    color: var(--gray-800);
    margin: 0;
}

.review-rating {
    margin-top: var(--spacing-xs);
}

.review-rating .fa-star,
.review-rating .fa-star-o {
    font-size: 0.9rem;
    margin-right: 0.1rem;
}

.review-comment {
    color: var(--gray-600);
    line-height: var(--line-height-normal);
}

.review-helpful {
    font-size: var(--font-size-sm);
}

/* Related Books Section */
.related-section .book-card {
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius-md);
    transition: all var(--transition-normal);
    overflow: hidden;
    height: 100%;
}

.related-section .book-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary-color);
}

.related-section .book-card__cover {
    position: relative;
    overflow: hidden;
}

.related-section .book-card__cover-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform var(--transition-normal);
}

.related-section .book-card:hover .book-card__cover-image {
    transform: scale(1.05);
}

.related-section .book-card__info {
    padding: var(--spacing-md);
}

.related-section .book-card__title {
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-semibold);
    line-height: var(--line-height-tight);
    margin-bottom: var(--spacing-sm);
}

.related-section .book-card__title a {
    color: var(--gray-800);
    text-decoration: none;
}

.related-section .book-card__title a:hover {
    color: var(--primary-color);
}

.related-section .book-authors {
    font-size: var(--font-size-sm);
    margin-bottom: var(--spacing-sm);
}

.related-section .book-card__meta {
    font-size: var(--font-size-xs);
}

.related-section .book-card__meta > div {
    margin-bottom: var(--spacing-xs);
}

/* Empty States */
.empty-state {
    text-align: center;
    padding: var(--spacing-3xl) var(--spacing-xl);
    color: var(--gray-500);
}

.empty-state .fa {
    opacity: 0.5;
}

.empty-state h5 {
    color: var(--gray-600);
    margin-bottom: var(--spacing-md);
}

.empty-icon {
    color: var(--gray-300);
    margin-bottom: var(--spacing-lg);
}

.empty-title {
    color: var(--gray-600);
    font-weight: var(--font-weight-semibold);
    margin-bottom: var(--spacing-md);
}

.empty-description {
    color: var(--gray-500);
    margin-bottom: var(--spacing-xl);
}

.empty-actions {
    display: flex;
    gap: var(--spacing-sm);
    justify-content: center;
    flex-wrap: wrap;
}

/* Writer Dashboard */
.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--spacing-lg);
}

.cover-preview {
    max-width: 200px;
    max-height: 300px;
    object-fit: cover;
    border-radius: var(--border-radius-sm);
}

/* Filter Dropdowns */
/* Force light-mode rendering on native selects so their option list
   matches the white background of the custom filter dropdowns */
select.form-select {
    color-scheme: light;
}

select.form-select option {
    background-color: #ffffff;
    color: #212529;
}

.filters-toggle-header {
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
    padding: 0.75rem 1rem;
}

.filters-toggle-header:hover {
    background-color: var(--gray-50);
}

.filters-toggle-title {
    font-weight: var(--font-weight-semibold);
    color: var(--gray-700);
}

.filters-toggle-icon {
    transition: transform 0.2s ease;
    color: var(--gray-500);
}

.filters-toggle-header[aria-expanded="true"] .filters-toggle-icon {
    transform: rotate(180deg);
}

.filter-dropdown {
    position: relative;
}

.filter-dropdown-toggle {
    cursor: pointer;
    color: var(--gray-800);
    text-align: left;
}

.filter-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1040;
    background: var(--white);
    border: 1px solid var(--gray-300);
    border-radius: var(--border-radius-sm);
    margin-top: var(--spacing-xs);
    box-shadow: var(--shadow-lg);
    padding: var(--spacing-xs) 0;
}

.filter-dropdown-menu .form-check {
    padding: 0.5rem 1rem 0.5rem 2.25rem;
    margin-bottom: 0;
}

.filter-dropdown-menu .form-check:hover {
    background-color: var(--gray-50);
}

.filter-dropdown-menu .form-check-label {
    cursor: pointer;
    width: 100%;
}

.filter-dropdown-menu .filter-single-item {
    padding: 0.5rem 1rem;
    cursor: pointer;
    color: var(--gray-800);
    font-size: 0.875rem;
    white-space: nowrap;
    transition: background-color 0.1s ease, color 0.1s ease;
}

.filter-dropdown-menu .filter-single-item:hover {
    background-color: var(--gray-100);
    color: var(--gray-800);
}

.filter-dropdown-menu .filter-single-item.active {
    background-color: var(--primary-color);
    color: #fff;
}

.filter-dropdown-menu .form-check-label {
    color: var(--gray-800);
}

/* ================================
   5. RESPONSIVE OVERRIDES
   ================================ */

/* Large tablets and small desktops */
@media (max-width: 1199px) {
    .books-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: var(--spacing-md);
    }
}

/* Tablets */
@media (max-width: 991px) {
    /* Auth pages */
    .auth-area,
    .login-area,
    .register-area {
        padding: 60px 0;
    }

    .auth-box-left,
    .auth-box-right {
        margin-bottom: var(--spacing-2xl);
    }

    /* Book details */
    .book-detail-cover-image {
        max-width: 250px;
        height: 350px;
        margin: 0 auto;
    }
    
    .metadata-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .metadata-label {
        min-width: auto;
        margin-bottom: var(--spacing-xs);
    }

    /* Books grid */
    .books-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
}

/* Mobile devices */
@media (max-width: 767px) {
    :root {
        --spacing-md: 0.75rem;
        --spacing-lg: 1rem;
        --spacing-xl: 1.5rem;
        --spacing-2xl: 2rem;
    }

    /* Auth pages */
    .auth-area,
    .login-area,
    .register-area {
        padding: 40px 0;
    }

    .login-box {
        padding: var(--spacing-lg);
        margin-top: var(--spacing-md);
        min-height: 250px;
    }

    .register-area .login-box,
    body.register-page .login-box {
        min-height: 350px;
    }

    /* Book details */
    .book-detail-cover-image {
        height: 300px;
        max-width: 200px;
    }
    
    .book-title.display-4 {
        font-size: var(--font-size-2xl);
    }
    
    .book-stats {
        text-align: center;
    }
    
    .book-actions {
        justify-content: center;
    }
    
    .chapter-item {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-md);
    }
    
    .chapter-actions {
        align-self: flex-end;
    }
    
    .review-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-sm);
    }
    
    .related-section .book-card__cover-image {
        height: 150px;
    }
    
    .metadata-item {
        margin-bottom: var(--spacing-md);
    }
    
    .book-details-tabs .nav-link {
        padding: var(--spacing-sm) var(--spacing-md);
        font-size: var(--font-size-sm);
    }

    /* Books grid */
    .books-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }

    .book-card__actions {
        opacity: 1;
        position: static;
        transform: none;
        justify-content: center;
        margin-top: var(--spacing-md);
        padding: 0 var(--spacing-md) var(--spacing-md);
        background: var(--gray-50);
    }
    
    .book-card__cover {
        position: static;
    }
    
    .book-card__meta-row {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-xs);
    }
    
    .book-card__meta-value {
        text-align: left;
    }

    .page-title {
        font-size: var(--font-size-2xl);
    }
}

/* Small mobile devices */
@media (max-width: 575px) {
    .book-detail-cover-image {
        max-width: 180px;
        height: 250px;
    }
    
    .book-title.display-4 {
        font-size: var(--font-size-xl);
        text-align: center;
    }
    
    .book-authors {
        text-align: center;
    }
    
    .book-stats .col-auto {
        flex: 1;
        text-align: center;
    }
    
    .chapter-meta {
        flex-direction: column;
        gap: var(--spacing-sm);
    }
    
    .related-section .row {
        --bs-gutter-x: 0.75rem;
    }

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

/* Print styles */
@media print {
    .book-card__actions,
    .chapter-actions,
    .review-actions,
    .book-actions {
        display: none;
    }

    .book-card,
    .card {
        box-shadow: none;
        border: 1px solid var(--gray-300);
    }

    .book-detail-cover-image {
        max-width: 200px;
        height: auto;
    }
}

/* ================================
   HEADER TOP MENU DROPDOWN FIX
   Fix for user dropdown menu in header
   ================================ */
.header-top-menu .dropdown {
    position: relative;
}

.header-top-menu .dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    left: auto;
    min-width: 270px;
    background: #fff;
    border: 1px solid rgba(0,0,0,.15);
    border-radius: 4px;
    box-shadow: 0 6px 12px rgba(0,0,0,.175);
    padding: 5px 0;
    margin: 2px 0 0;
    z-index: var(--z-index-fixed);
    display: none;
}

.header-top-menu .dropdown.show .dropdown-menu,
.header-top-menu .dropdown-menu.show {
    display: block;
}

.header-top-menu .dropdown-menu li {
    display: block;
    margin: 0;
}

.header-top-menu .dropdown-menu li a {
    display: block;
    padding: 7px 18px;
    color: #333;
    font-size: 0.825rem;
    text-align: left;
    text-decoration: none;
    white-space: nowrap;
}

.header-top-menu .dropdown-menu li a:hover {
    background-color: #f5f5f5;
    color: var(--primary-color);
}

.header-top-menu .dropdown-menu li.divider {
    height: 1px;
    margin: 9px 0;
    overflow: hidden;
    background-color: #e5e5e5;
}

.header-top-menu .dropdown-menu li a i {
    margin-right: 10px;
    width: 16px;
    text-align: center;
}

.header-top-menu .dropdown-toggle::after {
    display: none;
}

.header-top-menu .dropdown-menu button {
    width: 100%;
    text-align: left;
    font-size: 0.825rem;
}

/* ================================
   TEAMS MODULE
   ================================ */

/* Team Card */
.team-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius-md);
    transition: all var(--transition-normal);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
}

.team-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.team-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-md) var(--spacing-md) 0;
}

.team-card__avatar {
    width: 48px;
    height: 48px;
    border-radius: var(--border-radius-full);
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: var(--font-size-lg);
}

.team-card__role-badge {
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
    letter-spacing: 0.03em;
}

.team-card__body {
    padding: var(--spacing-md);
    flex: 1;
}

.team-card__name {
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-semibold);
    margin-bottom: var(--spacing-xs);
    line-height: var(--line-height-tight);
}

.team-card__name a {
    color: var(--gray-700);
}

.team-card__name a:hover {
    color: var(--primary-color);
}

.team-card__description {
    font-size: var(--font-size-sm);
    line-height: var(--line-height-normal);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 0;
}

.team-card__footer {
    padding: var(--spacing-sm) var(--spacing-md);
    border-top: 1px solid var(--gray-100);
    background: var(--gray-50);
}

.team-card__stats {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    font-size: var(--font-size-sm);
    flex-wrap: wrap;
}

.team-card__stat {
    display: flex;
    align-items: center;
}

/* Team Stats Bar */
.team-stats-bar {
    display: flex;
    align-items: center;
    gap: var(--spacing-xl);
    padding: var(--spacing-md) var(--spacing-lg);
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius-md);
    flex-wrap: wrap;
}

.team-stat-item {
    display: flex;
    align-items: center;
    font-size: var(--font-size-sm);
}

/* Team Member Table */
.team-members-table th {
    font-size: var(--font-size-xs);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-500);
    font-weight: var(--font-weight-semibold);
    border-bottom: 1px solid var(--gray-200);
    padding: var(--spacing-sm) var(--spacing-md);
}

.team-members-table td {
    padding: var(--spacing-sm) var(--spacing-md);
    vertical-align: middle;
    border-bottom: 1px solid var(--gray-100);
}

.team-member-row--pending {
    opacity: 0.7;
    background-color: var(--gray-50);
}

/* Team Member Avatar */
.team-member-avatar {
    flex-shrink: 0;
}

.team-member-avatar__img {
    width: 36px;
    height: 36px;
    border-radius: var(--border-radius-full);
    object-fit: cover;
}

.team-member-avatar__placeholder {
    width: 36px;
    height: 36px;
    border-radius: var(--border-radius-full);
    background: var(--primary-color);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
}

/* Invite Form */
.team-invite-form .form-control,
.team-invite-form .form-select {
    border-color: var(--gray-300);
}

.team-invite-form .form-control:focus,
.team-invite-form .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(236, 117, 50, 0.25);
}

/* =========================================================
   Reader Hub — card polish & empty state
   ========================================================= */
.reader-card { transition: transform .15s ease, box-shadow .15s ease; }
.reader-card:hover { transform: translateY(-2px); box-shadow: 0 .5rem 1rem rgba(0,0,0,.08); }
.reader-card .progress { background-color: #eef0f3; }
.reader-card .progress-bar { background-color: var(--primary-color, #ec7532); }

/* Skeleton loader for reader hub async refreshes */
.reader-skeleton {
    background: linear-gradient(90deg, #eef0f3 25%, #f7f8fa 37%, #eef0f3 63%);
    background-size: 400% 100%;
    animation: rdSk 1.4s ease infinite;
    border-radius: .5rem;
}
@keyframes rdSk {
    0%   { background-position: 100% 50%; }
    100% { background-position:   0% 50%; }
}

/* ================================
   === UI Redesign Additions ===
   Phase 1: Reading Experience + Book Discovery
   ================================ */

/* --- Reading Page Components --- */

.reading-top-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-md);
    height: 52px;
    padding: 0 var(--spacing-md);
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    position: sticky;
    top: 0;
    z-index: var(--z-index-sticky);
}

.reading-top-nav__breadcrumb {
    flex-shrink: 0;
    max-width: 25%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: var(--font-size-sm);
}

.reading-top-nav__breadcrumb ol {
    margin: 0;
    padding: 0;
    display: flex;
    gap: var(--spacing-xs);
}

.reading-top-nav__breadcrumb .breadcrumb-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.reading-top-nav__breadcrumb .breadcrumb-item + .breadcrumb-item::before {
    content: '/';
    color: var(--gray-400);
    padding-right: var(--spacing-xs);
}

.reading-top-nav__title {
    flex: 1;
    text-align: center;
    font-weight: var(--font-weight-semibold);
    font-size: var(--font-size-base);
    color: var(--gray-800);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.reading-top-nav__actions {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.reading-chapter-dropdown {
    min-width: 180px;
    max-width: 320px;
}

.reading-chapter-select {
    min-width: 180px;
    max-width: 320px;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: left;
    font-size: 0.875rem;
}

.reading-chapter-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(236, 117, 50, 0.15);
}

.reading-chapter-menu {
    min-width: 280px;
    max-width: 400px;
}

.reading-progress-bar {
    position: sticky;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: var(--primary-color);
    z-index: calc(var(--z-index-sticky) + 1);
    transition: width 0.1s ease-out;
}

.reading-column {
    max-width: 900px;
    margin: 0 auto;
    padding: var(--spacing-2xl) var(--spacing-md);
    padding-bottom: 64px;
}

.reading-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md) 0;
    margin-bottom: var(--spacing-lg);
    font-size: var(--font-size-sm);
    color: var(--gray-500);
    border-bottom: 1px solid var(--gray-200);
}

.reading-meta__info {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.reading-text {
    font-size: var(--font-size-lg);
    line-height: var(--line-height-relaxed);
    color: var(--gray-700);
}

.reading-text p {
    margin-bottom: var(--spacing-lg);
}

.reading-sticky-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 52px;
    background: var(--white);
    border-top: 1px solid var(--gray-200);
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.07);
    z-index: var(--z-index-sticky);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-md);
    padding: 0 var(--spacing-md);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-normal);
}

.reading-sticky-nav.is-visible {
    opacity: 1;
    pointer-events: auto;
}

.reading-sticky-nav .reading-top-nav__actions {
    margin: 0 auto;
}

/* Compact access-state sections within reading column */
.reading-column .auth-state,
.reading-column .subscription-state,
.reading-column .error-state {
    max-width: 480px;
    margin: 0 auto;
    padding: var(--spacing-2xl) var(--spacing-md);
}

/* Access-state icon rings */
.access-state-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: var(--spacing-md);
}
.access-state-icon--warning {
    background: rgba(236, 117, 50, 0.1);
    color: var(--primary-color);
    border: 2px solid rgba(236, 117, 50, 0.2);
}
.access-state-icon--info {
    background: rgba(23, 162, 184, 0.1);
    color: var(--info-color);
    border: 2px solid rgba(23, 162, 184, 0.2);
}
.access-state-icon--danger {
    background: rgba(220, 53, 69, 0.08);
    color: var(--danger-color);
    border: 2px solid rgba(220, 53, 69, 0.15);
}

/* Payment section keeps full width */
.reading-column .payment-state {
    max-width: none;
    padding: var(--spacing-xl) 0;
}

/* ================================
   PAYMENT GATE — Chapter Purchase
   ================================ */
.payment-gate {
    max-width: 580px;
    margin: 0 auto;
    background: var(--white);
    border-radius: var(--border-radius-xl);
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

/* Header */
.payment-gate__header {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
    color: var(--white);
    text-align: center;
    padding: var(--spacing-xl) var(--spacing-lg) var(--spacing-lg);
    position: relative;
    overflow: hidden;
}
.payment-gate__header::before {
    content: '';
    position: absolute;
    top: -50px; right: -50px;
    width: 180px; height: 180px;
    border-radius: 50%;
    background: rgba(255,255,255,0.07);
    pointer-events: none;
}
.payment-gate__header::after {
    content: '';
    position: absolute;
    bottom: -40px; left: -40px;
    width: 140px; height: 140px;
    border-radius: 50%;
    background: rgba(255,255,255,0.05);
    pointer-events: none;
}
.payment-gate__lock-icon {
    width: 52px; height: 52px;
    background: rgba(255,255,255,0.18);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    margin-bottom: var(--spacing-md);
    position: relative; z-index: 1;
}
.payment-gate__title {
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-bold);
    margin: 0 0 4px;
    position: relative; z-index: 1;
}
.payment-gate__subtitle {
    font-size: var(--font-size-sm);
    opacity: 0.82;
    margin: 0;
    position: relative; z-index: 1;
}

/* Info Strip */
.payment-gate__info-strip {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md) var(--spacing-lg);
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
    flex-wrap: wrap;
}
.payment-gate__info-item {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 100px;
}
.payment-gate__info-item--price {
    flex: 0 0 auto;
    align-items: center;
}
.payment-gate__info-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--gray-400);
    font-weight: var(--font-weight-semibold);
    margin-bottom: 2px;
}
.payment-gate__info-value {
    font-size: var(--font-size-sm);
    color: var(--gray-700);
    font-weight: var(--font-weight-medium);
}
.payment-gate__price-badge {
    display: inline-block;
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-bold);
    color: var(--primary-color);
    background: rgba(236, 117, 50, 0.08);
    border: 1.5px solid rgba(236, 117, 50, 0.22);
    border-radius: var(--border-radius-md);
    padding: 2px 14px;
    line-height: 1.8;
    white-space: nowrap;
}

/* Steps */
.payment-gate__steps {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-sm);
    padding: var(--spacing-md) var(--spacing-lg);
    border-bottom: 1px solid var(--gray-200);
}
.payment-gate__step {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-sm);
    flex: 1;
}
.payment-gate__step-num {
    width: 22px; height: 22px;
    flex-shrink: 0;
    background: var(--primary-color);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: var(--font-weight-bold);
    margin-top: 1px;
}
.payment-gate__step-text {
    font-size: var(--font-size-sm);
    color: var(--gray-600);
    line-height: var(--line-height-normal);
}
.payment-gate__step-divider {
    width: 20px;
    flex-shrink: 0;
    height: 1px;
    background: var(--gray-300);
    margin-top: 11px;
}

/* Loading dots */
.payment-gate__loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-xl) var(--spacing-lg);
    gap: 4px;
}
.payment-gate__loading-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--primary-color);
    animation: pgDotPulse 1.4s ease-in-out infinite;
    opacity: 0.25;
    display: inline-block;
}
.payment-gate__loading-dot:nth-child(2) { animation-delay: 0.2s; }
.payment-gate__loading-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes pgDotPulse {
    0%, 80%, 100% { opacity: 0.25; transform: scale(1); }
    40% { opacity: 1; transform: scale(1.35); }
}

/* Error state inside gate */
.payment-gate__error {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-md);
    margin: var(--spacing-md) var(--spacing-lg);
    padding: var(--spacing-md);
    background: #fffbf0;
    border: 1px solid #f5e0a8;
    border-radius: var(--border-radius-md);
    color: var(--gray-700);
    font-size: var(--font-size-sm);
}
.payment-gate__error > i {
    color: #d97706;
    font-size: 1rem;
    margin-top: 1px;
    flex-shrink: 0;
}

/* Section Labels */
.payment-gate__section-label {
    padding: var(--spacing-md) var(--spacing-lg) var(--spacing-xs);
    font-size: 10px;
    font-weight: var(--font-weight-semibold);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--gray-400);
    border-top: 1px solid var(--gray-200);
}

/* Bank tiles */
.payment-gate__banks {
    padding: 0 var(--spacing-lg) var(--spacing-sm);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}
.bank-tile {
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius-md);
    overflow: hidden;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.bank-tile:hover {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(236, 117, 50, 0.08);
}
.bank-tile--primary {
    border-color: rgba(236, 117, 50, 0.35);
}
.bank-tile__head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 7px var(--spacing-md);
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
}
.bank-tile--primary .bank-tile__head {
    background: rgba(236, 117, 50, 0.05);
    border-bottom-color: rgba(236, 117, 50, 0.15);
}
.bank-tile__name {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    color: var(--gray-800);
}
.bank-tile__body {
    padding: var(--spacing-sm) var(--spacing-md);
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px var(--spacing-md);
}
.bank-field {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.bank-field--full {
    grid-column: 1 / -1;
}
.bank-field__label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--gray-400);
    font-weight: var(--font-weight-semibold);
    margin-bottom: 1px;
}
.bank-field__value {
    font-size: var(--font-size-sm);
    color: var(--gray-800);
    font-weight: var(--font-weight-medium);
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    word-break: break-all;
}
.bank-field__value--text {
    font-family: var(--font-family-base);
}
.bank-tile__qr {
    padding: 4px var(--spacing-md) var(--spacing-sm);
    border-top: 1px solid var(--gray-200);
}
.bank-tile__qr img {
    max-width: 110px;
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--gray-200);
}

/* Recipient group label */
.payment-gate__recipient-label {
    padding: var(--spacing-xs) 0 var(--spacing-xs);
    font-size: var(--font-size-xs);
    color: var(--gray-500);
    font-weight: var(--font-weight-medium);
}

/* CTA and upload */
.payment-gate__cta {
    padding: var(--spacing-md) var(--spacing-lg);
}
.payment-gate__upload-body {
    padding: 0 var(--spacing-lg) var(--spacing-lg);
}
.payment-gate .form-select:focus,
.payment-gate .form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(236, 117, 50, 0.15);
}

/* --- Book Detail Page Components --- */

.book-badges {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-xs);
    margin: var(--spacing-md) 0;
}

.book-badges .badge {
    font-size: var(--font-size-sm);
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--border-radius-sm);
}

.original-book-callout {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-left: 4px solid var(--info-color);
    border-radius: var(--border-radius-md);
    padding: var(--spacing-md);
    margin: var(--spacing-xl) 0;
}

.original-book-callout__label {
    font-size: var(--font-size-xs);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-500);
    margin-bottom: var(--spacing-sm);
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.original-book-callout__body {
    display: flex;
    gap: var(--spacing-md);
    align-items: flex-start;
}

.original-book-thumb {
    flex-shrink: 0;
    width: 60px;
    height: 80px;
    object-fit: cover;
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--gray-200);
}

.original-book-info {
    flex: 1;
    min-width: 0;
}

.original-book-info h6 {
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-semibold);
    margin-bottom: var(--spacing-xs);
    color: var(--gray-800);
}

.original-book-meta {
    font-size: var(--font-size-sm);
    color: var(--gray-600);
}

.original-book-meta .metadata-item {
    margin-bottom: var(--spacing-xs);
}

.original-book-meta .metadata-label {
    font-weight: var(--font-weight-medium);
    color: var(--gray-500);
}

/* Responsive: stack callout body on mobile */
@media (max-width: 575px) {
    .original-book-callout__body {
        flex-direction: column;
    }

    .original-book-thumb {
        width: 80px;
        height: 120px;
        margin: 0 auto var(--spacing-sm);
        display: block;
    }
}

/* Book Detail Cover Sticky on md+ */
@media (min-width: 768px) {
    .book-detail-cover {
        position: sticky;
        top: var(--spacing-2xl);
    }
}

/* Filter Dropdown Scroll Area */
.filter-dropdown-scroll {
    max-height: 250px;
    overflow-y: auto;
}

/* Search Input Width */
.search-input {
    width: 300px;
}

@media (max-width: 575px) {
    .search-input {
        width: 100%;
    }
}

/* ================================
   === Phase 2 Additions ===
   Writer Dashboard, Teams, Reader Library
   ================================ */

/* --- Writer Dashboard Stats Cards --- */
.writer-stat-card {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.writer-stat-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--border-radius-full);
    background: rgba(236, 117, 50, 0.1);
    color: var(--primary-color);
}

.writer-stat-value {
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-bold);
    color: var(--gray-800);
    line-height: 1.2;
}

.writer-stat-label {
    font-size: var(--font-size-sm);
    color: var(--gray-500);
}

.writer-stat-sublabel {
    font-size: var(--font-size-xs);
    color: var(--gray-500);
    margin-top: var(--spacing-xs);
}

/* --- Chapter Status Badges --- */
.chapter-status-draft {
    background-color: var(--gray-400);
    color: var(--white);
}

.chapter-status-published {
    background-color: var(--success-color);
    color: var(--white);
}

.chapter-status-locked {
    background-color: var(--warning-color);
    color: var(--gray-900);
}

/* --- Team Cards --- */
.team-card {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.team-card__header {
    padding: var(--spacing-md);
    border-bottom: 1px solid var(--gray-200);
}

.team-card__body {
    padding: var(--spacing-md);
    flex: 1;
}

.team-card__footer {
    padding: var(--spacing-md);
    border-top: 1px solid var(--gray-200);
    background: var(--gray-50);
}

.team-member-row {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-sm) 0;
}

.team-member-avatar {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--border-radius-full);
    background: var(--primary-color);
    color: var(--white);
    font-weight: var(--font-weight-semibold);
    font-size: var(--font-size-base);
}

.team-member-info {
    flex: 1;
    min-width: 0;
}

.team-member-name {
    font-weight: var(--font-weight-semibold);
    color: var(--gray-800);
    font-size: var(--font-size-base);
}

.team-member-email {
    font-size: var(--font-size-sm);
    color: var(--gray-500);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.team-member-role {
    flex-shrink: 0;
    margin-right: var(--spacing-sm);
}

.team-member-actions {
    flex-shrink: 0;
}

/* --- Reader Library Cards --- */
.reader-card {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.reader-card__cover {
    position: relative;
    aspect-ratio: 2 / 3;
    overflow: hidden;
    background: var(--gray-100);
}

.reader-card__cover-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.reader-card__progress {
    padding: var(--spacing-sm) 0;
}

.library-progress-bar {
    width: 100%;
    height: 6px;
    background: var(--gray-200);
    border-radius: var(--border-radius-sm);
    overflow: hidden;
}

.library-progress-bar__fill {
    height: 100%;
    background: var(--primary-color);
    transition: width 0.3s ease;
}

/* --- Step Indicator --- */
.step-indicator {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-lg);
    padding: var(--spacing-md) 0;
}

.step-indicator__step {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    flex: 1;
    position: relative;
}

.step-indicator__step:not(:last-child)::after {
    content: '';
    flex: 1;
    height: 2px;
    background: var(--gray-300);
    min-width: 20px;
}

.step-indicator__number {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--border-radius-full);
    font-weight: var(--font-weight-semibold);
    font-size: var(--font-size-sm);
    flex-shrink: 0;
}

.step-indicator__label {
    font-size: var(--font-size-sm);
    white-space: nowrap;
}

.step-indicator__step--completed .step-indicator__number {
    background: var(--success-color);
    color: var(--white);
}

.step-indicator__step--completed .step-indicator__label {
    color: var(--success-color);
    font-weight: var(--font-weight-semibold);
}

.step-indicator__step--current .step-indicator__number {
    background: var(--primary-color);
    color: var(--white);
}

.step-indicator__step--current .step-indicator__label {
    color: var(--primary-color);
    font-weight: var(--font-weight-semibold);
}

.step-indicator__step--future .step-indicator__number {
    background: var(--gray-300);
    color: var(--gray-600);
}

.step-indicator__step--future .step-indicator__label {
    color: var(--gray-500);
}

/* --- Book Thumbnail --- */
.book-thumbnail-sm {
    width: 40px;
    height: 56px;
    object-fit: cover;
}

.book-thumbnail-placeholder-sm {
    width: 40px;
    height: 56px;
}

/* --- Collection Thumbnail Grid --- */
.collection-thumbnail-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-xs);
    width: 80px;
    height: 80px;
}

.collection-thumbnail-item {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--border-radius-sm);
}

/* --- Review Card --- */
.review-card {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.review-card__header {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.review-card__rating {
    color: var(--warning-color);
}

.review-card__book {
    font-size: var(--font-size-sm);
    color: var(--gray-600);
}

/* --- Goal Card --- */
.goal-card {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.goal-card__progress {
    width: 100%;
    height: 8px;
    background: var(--gray-200);
    border-radius: var(--border-radius-full);
    overflow: hidden;
}

.goal-card__progress-fill {
    height: 100%;
    background: var(--primary-color);
    transition: width 0.3s ease;
}

.goal-card__meta {
    display: flex;
    justify-content: space-between;
    font-size: var(--font-size-sm);
    color: var(--gray-500);
}

/* --- Empty State Enhancement --- */
.empty-state {
    padding: var(--spacing-3xl) var(--spacing-md);
    text-align: center;
}

.empty-state__icon {
    width: 80px;
    height: 80px;
    margin: 0 auto var(--spacing-md);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--border-radius-full);
    background: var(--gray-100);
    color: var(--gray-300);
    font-size: 2.5rem;
}

.empty-state__title {
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-semibold);
    color: var(--gray-800);
    margin-bottom: var(--spacing-sm);
}

.empty-state__subtitle {
    font-size: var(--font-size-base);
    color: var(--gray-600);
    margin-bottom: var(--spacing-lg);
}

/* --- Book Card Actions Row --- */
.book-card__actions-row {
    display: flex;
    gap: var(--spacing-xs);
    justify-content: flex-end;
    margin-top: var(--spacing-sm);
}

/* --- Table Enhancements --- */
.table-sticky-header thead {
    position: sticky;
    top: 0;
    background: var(--gray-100);
    z-index: 1;
}

/* --- Form Enhancements --- */
.form-section {
    margin-bottom: var(--spacing-lg);
    padding-bottom: var(--spacing-lg);
    border-bottom: 1px solid var(--gray-200);
}

.form-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.form-section__title {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
    color: var(--gray-800);
    margin-bottom: var(--spacing-md);
}

/* --- Author Card --- */
.author-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: var(--spacing-lg);
    height: 100%;
}

.author-card__avatar {
    width: 80px;
    height: 80px;
    border-radius: var(--border-radius-full);
    background: var(--primary-color);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: var(--font-weight-semibold);
    font-size: var(--font-size-xl);
    margin-bottom: var(--spacing-md);
}

.author-card__name {
    font-weight: var(--font-weight-semibold);
    color: var(--gray-800);
    margin-bottom: var(--spacing-xs);
}

.author-card__actions {
    margin-top: auto;
    padding-top: var(--spacing-md);
}

/* ================================
   === Phase 3 Additions ===
   Account, Author, Support, Legal, Admin pages
   ================================ */

/* --- Account Pages --- */
.feature-check-icon {
    color: var(--primary-color);
}

/* --- Author Profile --- */
.author-profile-avatar {
    width: 80px;
    height: 80px;
    border: 3px solid var(--primary-color);
    border-radius: var(--border-radius-full);
    object-fit: cover;
}

.author-stat-mini {
    text-align: center;
    padding: var(--spacing-sm);
}

.author-stat-mini__value {
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-bold);
    color: var(--gray-800);
    line-height: 1.2;
}

.author-stat-mini__label {
    font-size: var(--font-size-sm);
    color: var(--gray-500);
}

/* --- Chapter Pages --- */
.book-cover-small {
    width: 80px;
    height: 120px;
    object-fit: cover;
    border-radius: var(--border-radius-md);
}

/* --- Author List --- */
.author-card__bio {
    font-size: var(--font-size-sm);
    line-height: var(--line-height-relaxed);
}

/* --- Search Input --- */
.search-input {
    width: 300px;
    max-width: 100%;
}

/* --- Support Pages --- */
.contact-info-row {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-sm);
}

.contact-info-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--border-radius-full);
    background: rgba(236, 117, 50, 0.1);
    color: var(--primary-color);
    flex-shrink: 0;
}

.message-thread {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.message-card {
    border-radius: var(--border-radius-md);
    overflow: hidden;
}

.message-card__header {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    font-weight: var(--font-weight-semibold);
}

.message-card__avatar {
    width: 32px;
    height: 32px;
    border-radius: var(--border-radius-full);
    background: var(--primary-color);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: var(--font-weight-semibold);
    font-size: var(--font-size-sm);
    flex-shrink: 0;
}

.message-card__meta {
    font-size: var(--font-size-sm);
    color: var(--gray-500);
    font-weight: var(--font-weight-normal);
}

.message-card--user {
    background: var(--gray-50);
}

.message-card--support {
    background: var(--white);
    border: 1px solid var(--gray-200);
}

.message-card__body {
    padding: var(--spacing-md);
    white-space: pre-wrap;
}

/* --- Legal Pages --- */
.legal-page {
    padding: var(--spacing-3xl) 0;
}

.legal-page h2 {
    margin-top: var(--spacing-3xl);
    margin-bottom: var(--spacing-md);
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-semibold);
    color: var(--gray-800);
}

.legal-page h3,
.legal-page h4 {
    margin-top: var(--spacing-2xl);
    margin-bottom: var(--spacing-sm);
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
    color: var(--gray-800);
}

.legal-page p {
    font-size: var(--font-size-base);
    line-height: var(--line-height-relaxed);
    color: var(--gray-700);
    margin-bottom: var(--spacing-md);
}

.legal-page ul,
.legal-page ol {
    margin-bottom: var(--spacing-md);
    padding-left: var(--spacing-lg);
}

.legal-page li {
    margin-bottom: var(--spacing-xs);
}

.legal-page table {
    font-size: var(--font-size-sm);
    margin: var(--spacing-lg) 0;
}

.legal-page nav {
    background: var(--gray-50);
    padding: var(--spacing-md) var(--spacing-lg);
    border-radius: var(--border-radius-md);
    margin: var(--spacing-xl) 0;
}

.legal-page nav ol {
    margin: var(--spacing-sm) 0 0;
    padding-left: var(--spacing-lg);
}

.legal-page nav a {
    color: var(--primary-color);
    text-decoration: none;
}

.legal-page nav a:hover {
    text-decoration: underline;
}

.legal-page hr {
    margin: var(--spacing-2xl) 0;
    border-top: 1px solid var(--gray-200);
}

/* --- Admin Pages --- */
.admin-stat-card {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.admin-stat-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--border-radius-full);
    color: var(--white);
    flex-shrink: 0;
}

.admin-stat-info__value {
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-bold);
    color: var(--white);
    line-height: 1.2;
}

.admin-stat-info__label {
    font-size: var(--font-size-sm);
    color: rgba(255, 255, 255, 0.9);
}

/* === Phase 3 Additions — Legal Page Content === */
.legal-page__content {
    background: var(--white);
    padding: 2rem 2.5rem;
    border-radius: var(--border-radius-md);
    line-height: var(--line-height-relaxed);
}

.legal-page__toc ol {
    margin: 0.5rem 0 0;
    padding-left: 1.4rem;
}

/* === Phase 4 Additions — Polish Pass === */

/* Make every checkbox/radio label clickable feedback explicit.
   Native <label for="..."> already toggles the input, but the browser
   default cursor on labels is text — switching to pointer makes the
   affordance discoverable. */
.form-check-label,
.form-check-input,
.remember-me-checkbox label {
    cursor: pointer;
}

/* Give form-check rows a wider hit area so users can click anywhere on
   the row (label or padding) to toggle. */
.form-check {
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
}

.form-check-label {
    user-select: none;
    padding-left: 0.25rem;
}

/* Pill-style segmented tabs — used by My Library, My Subscriptions,
   My Reviews, etc. for the All / In Progress / Completed style row.
   Apply by adding `pill-tabs` alongside `nav nav-tabs`. */
.pill-tabs.nav-tabs {
    --pill-tab-gap: var(--spacing-xs);
    border-bottom: none;
    gap: var(--pill-tab-gap);
    padding: var(--spacing-xs);
    background: var(--gray-50);
    border-radius: var(--border-radius-lg);
    display: inline-flex;
    flex-wrap: wrap;
}

.pill-tabs.nav-tabs .nav-item {
    margin-bottom: 0;
}

.pill-tabs.nav-tabs .nav-link {
    border: none;
    border-radius: var(--border-radius-md);
    padding: 0.5rem 1.25rem;
    color: var(--gray-700);
    font-weight: var(--font-weight-medium);
    font-size: var(--font-size-sm);
    transition: background-color 0.15s ease, color 0.15s ease;
}

.pill-tabs.nav-tabs .nav-link:hover {
    background-color: var(--white);
    color: var(--primary-color);
    border: none;
}

.pill-tabs.nav-tabs .nav-link.active {
    background-color: var(--primary-color);
    color: var(--white);
    box-shadow: var(--shadow-sm);
}

.pill-tabs.nav-tabs .nav-link.active:hover {
    color: var(--white);
}

@media (max-width: 575px) {
    .pill-tabs.nav-tabs {
        display: flex;
        width: 100%;
    }
    .pill-tabs.nav-tabs .nav-item {
        flex: 1 1 auto;
    }
    .pill-tabs.nav-tabs .nav-link {
        text-align: center;
        padding: 0.5rem 0.75rem;
    }
}

/* Sign-in page polish — sit the Remember Me row inline with adequate
   touch target and align the now-centered Forgot Password link below the
   submit button to match the supporting links beneath it. */
.login-box .remember-me-checkbox.form-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: var(--spacing-md);
    padding-left: 0;
}

.login-box .remember-me-checkbox.form-check .form-check-input {
    position: static;
    flex-shrink: 0;
    width: auto;        /* undo: .login-box form input { width:100% } */
    display: inline-block; /* undo: .login-box form input { display:block } */
    margin-top: 0;
    margin-left: 0;
}

.login-box .remember-me-checkbox.form-check label {
    margin-bottom: 0;
    font-size: var(--font-size-sm);
}

/* ================================================
   Bootstrap Theme Override — map Bootstrap primary
   to the site's orange (#ec7532) so btn-primary,
   text-primary, bg-primary, etc. all stay on-brand.
   ================================================ */
.btn-primary,
.btn-primary:focus {
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    color: #fff !important;
}
.btn-primary:hover,
.btn-primary:active,
.btn-primary.active,
.show > .btn-primary.dropdown-toggle {
    background-color: var(--primary-hover) !important;
    border-color: var(--primary-hover) !important;
    color: #fff !important;
}
.btn-outline-primary {
    color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    background-color: transparent !important;
}
.btn-outline-primary:hover,
.btn-outline-primary:active {
    background-color: var(--primary-color) !important;
    color: #fff !important;
}

/* The custom base `.btn { border: 1px solid transparent }` (above) loads after
   Bootstrap and overrides each variant's border-color. Solid buttons still
   read as buttons (they have a background), but outline buttons go fully
   transparent and render as plain text — e.g. the "Register Now" / "Sign In"
   links on the auth pages. Restore the BS5 outline variants' borders/colors. */
.btn-outline-secondary {
    color: #6c757d;
    border-color: #6c757d;
    background-color: transparent;
}
.btn-outline-secondary:hover,
.btn-outline-secondary:active {
    color: #fff;
    background-color: #6c757d;
    border-color: #6c757d;
}
.btn-outline-danger {
    color: #dc3545;
    border-color: #dc3545;
    background-color: transparent;
}
.btn-outline-danger:hover,
.btn-outline-danger:active {
    color: #fff;
    background-color: #dc3545;
    border-color: #dc3545;
}
.btn-outline-success {
    color: #198754;
    border-color: #198754;
    background-color: transparent;
}
.btn-outline-success:hover,
.btn-outline-success:active {
    color: #fff;
    background-color: #198754;
    border-color: #198754;
}
.btn-outline-warning {
    color: #997404;
    border-color: #ffc107;
    background-color: transparent;
}
.btn-outline-warning:hover,
.btn-outline-warning:active {
    color: #000;
    background-color: #ffc107;
    border-color: #ffc107;
}
.btn-outline-info {
    color: #087990;
    border-color: #0dcaf0;
    background-color: transparent;
}
.btn-outline-info:hover,
.btn-outline-info:active {
    color: #000;
    background-color: #0dcaf0;
    border-color: #0dcaf0;
}
.btn-outline-light {
    color: #6c757d;
    border-color: #f8f9fa;
    background-color: transparent;
}
.btn-outline-light:hover,
.btn-outline-light:active {
    color: #000;
    background-color: #f8f9fa;
    border-color: #f8f9fa;
}
.text-primary { color: var(--primary-color) !important; }
.bg-primary    { background-color: var(--primary-color) !important; }
.border-primary { border-color: var(--primary-color) !important; }
.badge-primary,
.badge.bg-primary { background-color: var(--primary-color) !important; color: #fff !important; }
.page-link { color: var(--primary-color); }
.page-item.active .page-link {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}

/* ================================================
   Auth form — reset plain text links inside .login-box
   so they are not styled as orange buttons by style.css.
   Higher specificity (0,2,1) beats .login-box a (0,1,1).
   ================================================ */
.login-box a.text-muted,
.login-box a.text-primary,
.login-box .form-check a,
.login-box p a.auth-text-link {
    background: none;
    padding: 0;
    margin-top: 0;
    display: inline;
    font-weight: inherit;
    border-radius: 0;
    text-transform: none;
}
.login-box a.text-muted:hover {
    background: none;
    color: var(--text-secondary) !important;
}
.login-box a.text-primary:hover,
.login-box .form-check a:hover {
    background: none;
    text-decoration: underline;
}
/* OR divider — centered line with text */
.login-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 1rem 0;
    color: var(--text-muted);
}
.login-divider::before,
.login-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--gray-200);
}
.login-divider::before { margin-right: 0.75rem; }
.login-divider::after  { margin-left:  0.75rem; }
.login-divider span {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
}
/* Checkbox rows — align box and label on the same baseline.
   style.css sets `.login-box form input { width:100%; display:block }` which
   turns checkboxes into full-width blocks, pushing the label outside.
   Reset those properties and use flexbox for correct inline layout. */
.login-box .form-check {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding-left: 0;
    margin-top: var(--spacing-md);
}
.login-box .form-check .form-check-input {
    position: static;   /* undo Bootstrap 4 absolute positioning */
    flex-shrink: 0;
    width: auto;        /* undo: .login-box form input { width:100% } */
    display: inline-block; /* undo: .login-box form input { display:block } */
    margin-top: 0.2rem;
    margin-left: 0;
}
.login-box .form-check .form-check-label {
    margin-bottom: 0;
    font-size: var(--font-size-sm);
    line-height: 1.5;
    text-transform: none; /* undo: .login-box label { text-transform:capitalize } */
}

/* ================================================
   Book Card — compact info layout additions
   ================================================ */
.book-card__author {
    font-size: var(--font-size-sm);
    color: var(--gray-500);
    margin-bottom: var(--spacing-xs);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.book-card__genres {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-bottom: var(--spacing-sm);
    min-height: 1.6rem;
}

.book-card__genre-tag {
    font-size: 0.7rem;
    font-weight: var(--font-weight-medium);
    padding: 0.15rem 0.45rem;
    background: var(--gray-100);
    color: var(--gray-600);
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--gray-200);
    line-height: 1.4;
}

.book-card__stats {
    display: flex;
    gap: var(--spacing-sm);
    font-size: var(--font-size-sm);
    color: var(--gray-600);
    flex-wrap: wrap;
    padding-top: var(--spacing-sm);
    border-top: 1px solid var(--gray-100);
}

.book-card__stats span {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
}

.book-card__footer {
    margin-top: auto;
    padding-top: var(--spacing-sm);
}

/* Compact title for dense card grids (home page rails/tabs) */
.book-card__title--sm {
    font-size: 0.9rem;
}

/* ================================================
   Bootstrap 5 upgrade — compatibility shims
   .form-group was removed in BS5; legacy forms rely
   on its bottom margin. Restore it globally.
   ================================================ */
.form-group {
    margin-bottom: 1rem;
}

/* BS5 .badge defaults to white text; light-background badges
   (migrated from BS4 badge-warning/info/light) need dark text
   for contrast. BS5.1 has no text-bg-* utilities yet.
   .badge.bg-* (0,2,0) outweighs .badge (0,1,0) — no !important needed. */
.badge.bg-warning,
.badge.bg-info,
.badge.bg-light {
    color: var(--gray-900);
}

/* BS5 Reboot defaults <a> to text-decoration: underline (BS4 used none),
   and the Filmoja theme's base `a` rule only clears underline on :hover/:focus.
   Result: navigation links show a resting-state underline after the BS5 upgrade.
   Restore the clean look on the main nav, its dropdowns, and the top utility menu.
   (The animated underline bars on hover/active are :before/:after gradient
   pseudo-elements, not text-decoration — unaffected by this rule.) */
.mainmenu a,
.header-top-menu a,
.filmoja-footer-area a {
    text-decoration: none;
}

/* ================================================
   Author profile page (/author/{slug})
   These classes had no styling, so the sidebar and
   content collapsed to default left-aligned text with
   no card chrome. Restore the redesign card language.
   ================================================ */
.author-sidebar {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

.author-info-card,
.author-stats-card,
.author-links-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
    padding: var(--spacing-xl);
}

/* --- Author info card (avatar, name, handle, meta) --- */
.author-info-card {
    text-align: center;
}

.author-image {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto var(--spacing-md);
}

.author-image img,
.author-image__placeholder {
    width: 120px;
    height: 120px;
    border-radius: var(--border-radius-full);
    object-fit: cover;
    border: 3px solid var(--gray-100);
}

.author-image__placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gray-100);
    color: var(--gray-400);
    font-size: 3rem;
}

.author-verified-badge {
    position: absolute;
    bottom: 4px;
    right: 4px;
    background: var(--white);
    border-radius: var(--border-radius-full);
    color: var(--primary-color);
    font-size: 1.5rem;
    line-height: 1;
}

.author-info h3 {
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-bold);
    color: var(--gray-800);
    margin: 0 0 var(--spacing-xs);
}

.author-username {
    color: var(--primary-color);
    font-size: var(--font-size-sm);
    margin: 0 0 var(--spacing-sm);
}

.author-followers,
.author-joined {
    color: var(--gray-500);
    font-size: var(--font-size-sm);
    margin: 0 0 var(--spacing-xs);
}

.author-followers i,
.author-joined i {
    margin-right: var(--spacing-xs);
    color: var(--gray-400);
}

.author-actions {
    margin-top: var(--spacing-lg);
}

/* --- Stats & quick-links card headings --- */
.author-stats-card h4,
.author-links-card h4 {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
    color: var(--gray-700);
    margin: 0 0 var(--spacing-lg);
    padding-bottom: var(--spacing-sm);
    border-bottom: 1px solid var(--gray-200);
}

.author-stats-card .stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-lg) var(--spacing-md);
}

/* --- Quick links list --- */
.author-links {
    list-style: none;
    margin: 0;
    padding: 0;
}

.author-links li + li {
    margin-top: var(--spacing-xs);
}

.author-links a {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--border-radius-md);
    color: var(--gray-600);
    font-size: var(--font-size-sm);
    transition: background 0.2s ease, color 0.2s ease;
}

.author-links a:hover {
    background: var(--gray-50);
    color: var(--primary-color);
}

.author-links a i {
    width: 18px;
    text-align: center;
    color: var(--gray-400);
}

/* --- Content column (bio, books, payment) --- */
.author-content {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

.author-section {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
    padding: var(--spacing-xl);
}

.author-section h3 {
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-bold);
    color: var(--gray-800);
    margin: 0 0 var(--spacing-md);
    padding-bottom: var(--spacing-sm);
    border-bottom: 1px solid var(--gray-200);
}

/* Sidebar sits above content when columns stack on mobile */
@media (max-width: 991.98px) {
    .author-sidebar {
        margin-bottom: var(--spacing-lg);
    }
}

/* ================================================================
   Writer Hub — Sidebar, Header & Approval Queue
   ================================================================ */

/* ---- Sidebar shell ---- */
.writer-sidebar {
    background: #111827;
    min-height: 100vh;
    padding: 0;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    max-height: 100vh;
    overflow-y: auto;
    scrollbar-width: none;
}

.writer-sidebar::-webkit-scrollbar { display: none; }

.writer-sidebar-brand {
    padding: 22px 24px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    margin-bottom: 8px;
}

.writer-sidebar-label {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #4b5563;
    user-select: none;
}

/* ---- Nav links ---- */
.writer-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 24px;
    color: #6b7280;
    font-size: 0.825rem;
    font-weight: 500;
    border-left: 3px solid transparent;
    transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
    text-decoration: none;
    position: relative;
}

.writer-nav .nav-link span {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.writer-nav .nav-link i {
    width: 15px;
    text-align: center;
    flex-shrink: 0;
    font-size: 0.78rem;
}

.writer-nav .nav-link:hover {
    color: #d1d5db;
    background: rgba(255,255,255,0.04);
    border-left-color: rgba(236,117,50,0.3);
}

.writer-nav .nav-link.active {
    color: #f9fafb;
    background: rgba(236,117,50,0.1);
    border-left-color: #ec7532;
    font-weight: 600;
}

.writer-nav .nav-link.active i {
    color: #ec7532;
    opacity: 1;
}

.writer-nav-divider {
    margin: 12px 24px;
    height: 1px;
    background: rgba(255,255,255,0.06);
}

/* ---- Pending count badge ---- */
.nav-badge-count {
    margin-left: auto;   /* sidebar: pushes badge to far right in flex row */
    flex-shrink: 0;
    background: #ec7532;
    color: #fff;
    font-size: 0.58rem;
    font-weight: 800;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    padding: 0 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    letter-spacing: 0;
    line-height: 1;
    animation: badge-pulse 2.6s ease-in-out infinite;
}

@keyframes badge-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(236,117,50,0.6); }
    55%  { box-shadow: 0 0 0 5px rgba(236,117,50,0); }
    100% { box-shadow: 0 0 0 0 rgba(236,117,50,0); }
}

/* Raise main nav dropdowns above the sticky reading-top-nav (z-index 1020) */
.mainmenu ul li ul,
.mainmenu ul li:hover > ul {
    z-index: var(--z-index-fixed);
}

/* Badge in the main site navigation (overrides sidebar's margin-left: auto) */
.mainmenu .nav-badge-count {
    margin-left: 5px;
    vertical-align: middle;
    position: relative;
    top: -1px;
    display: inline-flex;
}

/* Approvals dropdown item: keep badge visually attached to text */
.mainmenu .nav-approvals-link {
    display: flex;
    align-items: center;
    gap: 0;
}

.mainmenu .nav-approvals-link .nav-badge-count {
    margin-left: 6px;
    top: 0;
}

/* ---- Writer main area ---- */
.writer-main {
    background: #f3f4f6;
    min-height: 100vh;
}

.writer-header {
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    padding: 14px 0;
    margin-bottom: 28px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.writer-header-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: #111827;
}

.writer-content {
    padding: 32px 32px 48px;
}

/* ================================================================
   Approvals Page
   ================================================================ */

.approvals-page {
    padding-bottom: 40px;
}

.approvals-hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 28px;
}

.approvals-title {
    font-family: 'Lora', 'Georgia', serif;
    font-size: 1.7rem;
    font-weight: 600;
    color: #111827;
    letter-spacing: -0.025em;
    margin: 0 0 4px;
    line-height: 1.2;
}

.approvals-subtitle {
    font-size: 0.855rem;
    color: #6b7280;
    margin: 0;
}

.approvals-count-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #fffbeb;
    color: #92400e;
    border: 1px solid #fde68a;
    border-radius: 20px;
    padding: 6px 16px;
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ---- Approval ticket list ---- */
.approval-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 4px;
}

.approval-ticket {
    background: #ffffff;
    border-radius: 10px;
    border: 1px solid #e9eaec;
    border-left: 4px solid #f59e0b;
    padding: 16px 20px;
    display: grid;
    grid-template-columns: 42px 1fr 1.3fr auto auto auto;
    align-items: center;
    gap: 16px;
    transition: box-shadow 0.18s ease, transform 0.18s ease;
}

.approval-ticket:hover {
    box-shadow: 0 4px 18px rgba(0,0,0,0.07);
    transform: translateY(-1px);
}

.ticket-removing {
    opacity: 0 !important;
    transform: translateX(16px) scale(0.98) !important;
    transition: opacity 0.28s ease, transform 0.28s ease !important;
    pointer-events: none !important;
}

/* Avatar */
.ticket-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    flex-shrink: 0;
    color: #fff;
    letter-spacing: 0.02em;
}

/* Reader info */
.ticket-reader strong {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ticket-reader span {
    font-size: 0.72rem;
    color: #9ca3af;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

/* Book / package */
.ticket-book strong {
    display: block;
    font-size: 0.855rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ticket-book span:not(.ticket-access-label) {
    font-size: 0.72rem;
    color: #6b7280;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

/* Access sub-label badge */
.ticket-access-label {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.7rem;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 20px;
    white-space: nowrap;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ticket-access-package {
    background: rgba(99, 102, 241, 0.09);
    color: #4f46e5;
}

.ticket-access-chapter {
    background: rgba(16, 185, 129, 0.09);
    color: #059669;
}

.ticket-access-fullbook {
    background: rgba(107, 114, 128, 0.09);
    color: #4b5563;
}

/* Amount */
.ticket-amount {
    text-align: right;
    flex-shrink: 0;
}

.ticket-amount strong {
    display: block;
    font-size: 1rem;
    font-weight: 700;
    color: #ec7532;
    letter-spacing: -0.02em;
}

.ticket-amount span {
    display: block;
    font-size: 0.65rem;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* Proof */
.ticket-proof { flex-shrink: 0; }

.btn-proof {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 13px;
    border: 1px solid #d1d5db;
    border-radius: 7px;
    background: #f9fafb;
    color: #374151;
    font-size: 0.775rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
    text-decoration: none;
    font-family: inherit;
}

.btn-proof:hover {
    background: #eff6ff;
    border-color: #93c5fd;
    color: #1d4ed8;
}

.btn-proof.no-proof {
    color: #d1d5db;
    border-style: dashed;
    background: transparent;
    cursor: default;
    pointer-events: none;
}

/* Action buttons */
.ticket-actions {
    display: flex;
    gap: 7px;
    flex-shrink: 0;
}

.btn-approve,
.btn-reject {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    border: 1px solid;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, transform 0.12s ease;
    font-size: 0.8rem;
    background: none;
}

.btn-approve {
    border-color: #bbf7d0;
    color: #059669;
    background: #f0fdf4;
}

.btn-approve:hover {
    background: #059669;
    border-color: #059669;
    color: #fff;
    transform: scale(1.1);
}

.btn-reject {
    border-color: #fecaca;
    color: #dc2626;
    background: #fff5f5;
}

.btn-reject:hover {
    background: #dc2626;
    border-color: #dc2626;
    color: #fff;
    transform: scale(1.1);
}

/* Empty state */
.approvals-empty {
    text-align: center;
    padding: 72px 32px;
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
}

.approvals-empty-icon {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background: #f0fdf4;
    border: 2px solid #bbf7d0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    color: #059669;
    font-size: 1.6rem;
}

.approvals-empty h3 {
    font-size: 1.15rem;
    font-weight: 600;
    color: #111827;
    margin: 0 0 8px;
}

.approvals-empty p {
    font-size: 0.855rem;
    color: #6b7280;
    margin: 0;
    max-width: 300px;
    margin-inline: auto;
}

/* Proof modal */
.proof-modal-content {
    border: none;
    border-radius: 14px;
    overflow: hidden;
}

.proof-modal-img {
    max-width: 100%;
    max-height: 75vh;
    border-radius: 8px;
    object-fit: contain;
}

/* Notes modal */
.notes-modal-content {
    border: none;
    border-radius: 12px;
    overflow: hidden;
}

/* ---- Responsive ---- */
@media (max-width: 991.98px) {
    .writer-sidebar {
        min-height: auto;
        position: relative;
    }
}

@media (max-width: 767.98px) {
    .approval-ticket {
        grid-template-columns: 36px 1fr auto;
        grid-template-rows: auto auto auto;
        gap: 10px 12px;
        padding: 14px 16px;
    }

    .ticket-book {
        grid-column: 1 / -1;
        border-top: 1px solid #f3f4f6;
        padding-top: 8px;
        margin-top: 2px;
    }

    .ticket-amount { text-align: left; }

    .ticket-proof,
    .ticket-actions {
        grid-column: span 1;
    }

}

/* ================================
   === Earnings Page ===
   ================================ */

/* Stat icon colour variants */
.earnings-icon-green {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.earnings-icon-blue {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.earnings-icon-amber {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

/* Status filter tabs */
.earnings-filter-tabs {
    display: flex;
    gap: 4px;
}

.earnings-filter-tab {
    background: transparent;
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    color: var(--gray-600);
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 500;
    padding: 4px 12px;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.earnings-filter-tab:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.earnings-filter-tab.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}

/* Monthly earnings bar chart */
.monthly-earnings-chart {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.monthly-bar-row {
    display: grid;
    grid-template-columns: 52px 1fr 52px;
    align-items: center;
    gap: 10px;
}

.monthly-bar-label {
    font-size: 0.75rem;
    color: var(--gray-500);
    font-weight: 500;
    text-align: right;
}

.monthly-bar-track {
    background: var(--gray-100);
    border-radius: 4px;
    height: 8px;
    overflow: hidden;
}

.monthly-bar-fill {
    background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
    border-radius: 4px;
    height: 100%;
    min-width: 4px;
    transition: width 0.4s ease;
}

.monthly-bar-amount {
    font-size: 0.73rem;
    font-weight: 600;
    color: var(--gray-700);
    text-align: left;
}

/* Payments table */
#paymentsTable th {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--gray-600);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

#paymentsTable td {
    vertical-align: middle;
}

@media (max-width: 767.98px) {
    .earnings-filter-tabs {
        flex-wrap: wrap;
    }

    .monthly-bar-row {
        grid-template-columns: 44px 1fr 44px;
        gap: 6px;
    }
}

/*================================================
  SLIM BREADCRUMB
  Replaces the legacy .filmoja-breadcrumb-area hero band.
  Token-based so it adapts to the night theme automatically
  (the --gray-* scale is inverted under [data-theme="dark"]).
==================================================*/

.bc-breadcrumb {
    margin: 0 0 var(--spacing-sm);
    font-size: var(--font-size-sm);
    line-height: var(--line-height-normal);
}

.bc-breadcrumb__list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.bc-breadcrumb__item {
    display: inline-flex;
    align-items: center;
    color: var(--gray-500);
}

.bc-breadcrumb__item + .bc-breadcrumb__item::before {
    content: "/";
    margin-right: 0.35rem;
    color: var(--gray-400);
}

.bc-breadcrumb__item a {
    color: var(--gray-500);
    text-decoration: none;
    transition: color 0.15s ease;
}

.bc-breadcrumb__item a:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

.bc-breadcrumb__item--current {
    color: var(--gray-700);
    font-weight: var(--font-weight-medium);
}

.bc-page-title {
    margin: 0 0 var(--spacing-lg);
    font-size: var(--font-size-3xl);
    font-weight: var(--font-weight-bold);
    color: var(--gray-800);
    line-height: var(--line-height-tight);
}

/*================================================
  AUTHOR — BANK ACCOUNTS & EDIT-PROFILE SIDEBAR
  Token-based; adapts to the night theme automatically.
==================================================*/

/* Bank account card (built on .content-card) */
.bank-account-card .content-card-header h3 {
    font-size: var(--font-size-base);
    min-width: 0;
}

.bank-account-card--primary {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 1px var(--primary-color);
}

.bank-account-card--inactive {
    opacity: 0.7;
}

.bank-detail {
    display: flex;
    justify-content: space-between;
    gap: var(--spacing-md);
    padding: 0.4rem 0;
    border-bottom: 1px solid var(--gray-100);
    font-size: var(--font-size-sm);
}

.bank-detail:last-of-type {
    border-bottom: 0;
}

.bank-detail__label {
    color: var(--gray-500);
    white-space: nowrap;
}

.bank-detail__value {
    color: var(--gray-700);
    font-weight: var(--font-weight-medium);
    text-align: right;
    word-break: break-word;
}

/* Edit-profile left sidebar navigation */
.author-nav-menu {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius-lg);
    padding: var(--spacing-md);
    position: sticky;
    top: var(--spacing-lg);
}

.author-nav-menu h4 {
    font-size: var(--font-size-sm);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--gray-500);
    margin: 0 0 var(--spacing-sm);
    padding: 0 var(--spacing-sm);
}

.author-nav-menu .nav-link {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    color: var(--gray-600);
    border-radius: var(--border-radius-md);
    padding: 0.6rem var(--spacing-sm);
    font-weight: var(--font-weight-medium);
    transition: background-color 0.15s ease, color 0.15s ease;
}

.author-nav-menu .nav-link i {
    width: 1.1rem;
    text-align: center;
    color: var(--gray-500);
}

.author-nav-menu .nav-link:hover {
    background: var(--gray-50);
    color: var(--gray-800);
}

.author-nav-menu .nav-link.active {
    background: var(--primary-color);
    color: #fff;
}

.author-nav-menu .nav-link.active i {
    color: #fff;
}

/*================================================
  PAYMENT QR CODE
  QR images keep a literal white backdrop in both themes so they
  stay scannable; surrounding chrome uses theme tokens.
==================================================*/

.qr-upload {
    display: flex;
    gap: var(--spacing-lg);
    align-items: flex-start;
    flex-wrap: wrap;
}

.qr-preview {
    max-width: 160px;
    max-height: 160px;
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius-md);
    background: #fff;
    padding: 4px;
}

.qr-placeholder {
    width: 120px;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px dashed var(--gray-300);
    border-radius: var(--border-radius-md);
    color: var(--gray-400);
    font-size: 2.5rem;
}

.qr-thumb {
    max-width: 120px;
    max-height: 120px;
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius-sm);
    background: #fff;
    padding: 4px;
    cursor: zoom-in;
}

.qr-reader-img {
    max-width: 150px;
    max-height: 150px;
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius-sm);
    background: #fff;
    padding: 4px;
}

/*================================================
  AUTHOR PROFILE FORM  (.pf-*)
  Sectioned card layout: left-rule section headers,
  uppercase micro-labels, generous vertical rhythm,
  pinned actions footer. Auto-adapts to night theme
  via CSS tokens — no overrides needed in site-night.css.
==================================================*/

/* Card shell */
.pf-card {
    overflow: hidden; /* rounds clip the footer bg */
    padding: 0;       /* sections own their own padding */
}

/* Individual section panel */
.pf-section {
    padding: 1.625rem 1.875rem;
    border-top: 1px solid var(--gray-200);
}
.pf-section--first {
    border-top: none;
}

/* Section heading with primary left-rule accent */
.pf-section__header {
    margin-bottom: 1.125rem;
}
.pf-section__header h4 {
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-semibold);
    color: var(--gray-800);
    margin: 0;
    padding-left: 0.75rem;
    border-left: 3px solid var(--primary-color);
    line-height: 1.4;
}
.pf-section__header h4 i {
    color: var(--gray-500);
}

/* Pro label treatment — all labels inside .pf-section */
.pf-section .form-group label,
.pf-section label.form-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.055em;
    color: var(--gray-500);
    margin-bottom: 0.35rem;
    display: block;
}
.pf-required {
    color: #ef4444;
    margin-left: 2px;
}

/* Input / textarea sizing inside the form */
.pf-section .form-control {
    padding: 0.6rem 0.875rem;
    font-size: var(--font-size-sm);
    border-color: var(--gray-300);
    background-color: var(--white);
    color: var(--gray-800);
    border-radius: var(--border-radius-md);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.pf-section .form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(236,117,50, 0.14);
    background-color: var(--white);
    color: var(--gray-800);
}
.pf-section .input-group-text {
    padding: 0.6rem 0.875rem;
    font-size: var(--font-size-sm);
    background-color: var(--gray-50);
    border-color: var(--gray-300);
    color: var(--gray-500);
}
.pf-url-prefix {
    font-size: 0.72rem !important;
    letter-spacing: 0;
}

/* Bio character hint */
.pf-char-hint {
    font-size: 0.75rem;
    color: var(--gray-400);
    margin-top: 0.35rem;
    text-align: right;
}

/* Avatar upload row */
.pf-avatar-row {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}
.pf-avatar-preview {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid var(--gray-200);
    flex-shrink: 0;
    background: var(--gray-100);
}
.pf-avatar-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.pf-avatar-controls {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.pf-avatar-controls .text-muted {
    font-size: 0.78rem;
}

/* Pinned actions footer */
.pf-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.25rem 1.875rem;
    background: var(--gray-50);
    border-top: 1px solid var(--gray-200);
}

/* Bank summary and books list inside pf-section */
.pf-summary-area {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius-md);
    padding: 0.875rem 1rem;
    min-height: 3rem;
}
.pf-books-list {
    /* gives the AJAX-loaded book grid a bit of top breathing room */
    min-height: 5rem;
}

.hover-underline:hover {
    text-decoration: underline !important;
}

/* ===== CHAPTER UNLOCK BUTTON ===== */
.chapter-unlock-btn {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    border: 1px solid rgba(245,158,11,0.3);
    color: #1c1410;
    font-weight: 600;
    letter-spacing: 0.01em;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(245,158,11,0.2);
    white-space: nowrap;
}
.chapter-unlock-btn:hover,
.chapter-unlock-btn:focus {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: #1c1410;
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(245,158,11,0.4);
    border-color: rgba(245,158,11,0.5);
}
.chapter-unlock-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(245,158,11,0.3);
}

/* ===== CHAPTER PURCHASE MODAL ===== */
#chapterPurchaseModal .modal-header {
    background: linear-gradient(135deg, #1a2535 0%, #111827 100%);
    border-bottom: 1px solid rgba(245,158,11,0.2);
    padding: 1.125rem 1.5rem;
}
#chapterPurchaseModal .modal-title {
    color: #f9fafb;
}
#chapterPurchaseModal .modal-footer {
    border-top: 1px solid rgba(0,0,0,0.1);
}
#chapterPurchaseModal .modal-footer .btn-outline-secondary {
    border-color: #d97706;
    color: #d97706;
    background: transparent;
}
#chapterPurchaseModal .modal-footer .btn-outline-secondary:hover,
#chapterPurchaseModal .modal-footer .btn-outline-secondary:focus {
    background: #d97706;
    color: #1c1410;
    border-color: #d97706;
}
#chapterPurchaseModal .modal-footer .btn-secondary {
    border: 1px solid #e5e7eb;
    color: #6b7280;
    background: transparent;
}
#chapterPurchaseModal .modal-footer .btn-secondary:hover,
#chapterPurchaseModal .modal-footer .btn-secondary:focus {
    background: #f3f4f6;
    color: #374151;
}
.chapter-purchase-header {
    display: flex;
    align-items: center;
    gap: 0.875rem;
}
.chapter-purchase-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #1c1410;
    font-size: 1rem;
    flex-shrink: 0;
    box-shadow: 0 3px 10px rgba(245,158,11,0.45);
}
.chapter-purchase-title-block .modal-title {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 2px;
}
.chapter-purchase-chapter-name {
    font-size: 0.78rem;
    color: rgba(249,250,251,0.65);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 300px;
}

/* Package grid */
.cp-packages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 0.875rem;
}

/* Package card */
.cp-package-card {
    border: 1px solid var(--gray-200, #e5e7eb);
    border-radius: 10px;
    overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
    display: flex;
    flex-direction: column;
    background: #fff;
}
.cp-package-card:hover {
    border-color: #f59e0b;
    box-shadow: 0 6px 20px rgba(245,158,11,0.18);
    transform: translateY(-2px);
}
.cp-package-card__badge {
    background: linear-gradient(90deg, #f59e0b, #d97706);
    color: #1c1410;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    padding: 0.3rem 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}
.cp-package-card__body {
    padding: 0.875rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.cp-package-card__name {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 0.3rem;
    line-height: 1.3;
}
.cp-package-card__desc {
    font-size: 0.78rem;
    color: #6b7280;
    line-height: 1.45;
    margin-bottom: 0.5rem;
    flex: 1;
}
.cp-package-card__price-row {
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
    margin-top: 0.5rem;
}
.cp-package-card__price-original {
    font-size: 0.78rem;
    color: #9ca3af;
    text-decoration: line-through;
}
.cp-package-card__price-current {
    font-size: 1.35rem;
    font-weight: 800;
    color: #d97706;
    line-height: 1;
}
.cp-package-card__price-currency {
    font-size: 0.8rem;
    font-weight: 500;
    color: #92400e;
}
.cp-package-card__footer {
    padding: 0.625rem 0.875rem;
    border-top: 1px solid #f3f4f6;
    background: #fafafa;
}

/* Night theme overrides for chapter purchase modal */
body.bc-night #chapterPurchaseModal .modal-content,
.bc-night-mode #chapterPurchaseModal .modal-content {
    background: #111827;
    border: 1px solid rgba(245,158,11,0.15);
}
body.bc-night #chapterPurchaseModal .modal-body,
.bc-night-mode #chapterPurchaseModal .modal-body {
    background: #111827;
    color: #e5e7eb;
}
body.bc-night #chapterPurchaseModal .modal-footer,
.bc-night-mode #chapterPurchaseModal .modal-footer {
    background: #0f1923;
    border-top-color: rgba(255,255,255,0.07);
}
body.bc-night .cp-package-card,
.bc-night-mode .cp-package-card {
    background: rgba(255,255,255,0.05);
    border-color: rgba(255,255,255,0.1);
}
body.bc-night .cp-package-card:hover,
.bc-night-mode .cp-package-card:hover {
    background: rgba(245,158,11,0.07);
    border-color: rgba(245,158,11,0.4);
}
body.bc-night .cp-package-card__name,
.bc-night-mode .cp-package-card__name {
    color: #f3f4f6;
}
body.bc-night .cp-package-card__desc,
.bc-night-mode .cp-package-card__desc {
    color: #9ca3af;
}
body.bc-night .cp-package-card__footer,
.bc-night-mode .cp-package-card__footer {
    background: rgba(0,0,0,0.25);
    border-top-color: rgba(255,255,255,0.07);
}
body.bc-night .cp-package-card__price-current,
.bc-night-mode .cp-package-card__price-current {
    color: #f59e0b;
}
body.bc-night .cp-package-card__price-currency,
.bc-night-mode .cp-package-card__price-currency {
    color: #fbbf24;
}

/* ===== CHAPTER SINGLE-PURCHASE SECTION (inside cp modal) ===== */
.cp-divider {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    margin: 1rem 0;
}
.cp-divider::before,
.cp-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(0, 0, 0, 0.12);
}
.cp-divider__text {
    color: #9ca3af;
    font-size: 0.75rem;
    white-space: nowrap;
}

.cp-single-chapter {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
}
.cp-single-chapter__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: #f3f4f6;
    border-bottom: 1px solid #e5e7eb;
}
.cp-single-chapter__label {
    font-weight: 700;
    font-size: 0.95rem;
    color: #111827;
}
.cp-single-chapter__price {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #1c1410;
    font-weight: 800;
    font-size: 1rem;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    white-space: nowrap;
}
.cp-chapter-steps {
    display: flex;
    gap: 0.625rem;
    margin: 0.5rem 0.75rem 0.75rem;
    padding: 0.625rem 0.75rem;
    background: rgba(245, 158, 11, 0.07);
    border: 1px solid rgba(245, 158, 11, 0.18);
    border-radius: 7px;
}
.cp-chapter-step {
    flex: 1;
    font-size: 0.8rem;
    color: #374151;
    display: flex;
    gap: 0.4rem;
    align-items: flex-start;
    line-height: 1.5;
}
.cp-chapter-step__num {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #1c1410;
    font-weight: 700;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    flex-shrink: 0;
    margin-top: 1px;
}
.cp-banks-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6b7280;
    padding: 0.625rem 1rem 0.375rem;
}
.cp-single-chapter .bank-tile {
    margin: 0 0.75rem 0.625rem;
    border-radius: 7px;
}
.cp-single-chapter .bank-tile:last-of-type {
    margin-bottom: 0;
}
.cp-single-chapter .bank-tile--primary {
    border-color: rgba(245, 158, 11, 0.35);
}
.cp-single-chapter__cta {
    padding: 0.75rem 1rem;
}
.cp-no-banks {
    margin: 0.5rem 1rem 0.75rem;
    font-size: 0.8rem;
}

/* Upload form (State 2) */
.cp-back-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.2);
    border-radius: 7px;
    padding: 0.5rem 0.875rem;
    margin-bottom: 1rem;
    font-size: 0.8rem;
}
.cp-back-bar__info {
    color: #92400e;
    font-weight: 600;
}
.cp-back-bar__back {
    color: #d97706;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    font-size: 0.8rem;
    text-decoration: underline;
}
.cp-upload-zone {
    border: 2px dashed #d1d5db;
    border-radius: 7px;
    padding: 1rem;
    text-align: center;
    color: #9ca3af;
    font-size: 0.8rem;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}
.cp-upload-zone:hover,
.cp-upload-zone.has-file {
    border-color: #f59e0b;
    background: rgba(245, 158, 11, 0.04);
    color: #92400e;
}
.cp-success-banner {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    padding: 0.875rem 1rem;
}
.cp-success-banner i {
    color: #16a34a;
    font-size: 1.25rem;
    flex-shrink: 0;
    margin-top: 1px;
}

/* Night-theme overrides */
body.bc-night .cp-divider::before,
.bc-night-mode .cp-divider::before,
body.bc-night .cp-divider::after,
.bc-night-mode .cp-divider::after {
    background: rgba(255, 255, 255, 0.08);
}
body.bc-night .cp-single-chapter,
.bc-night-mode .cp-single-chapter {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.1);
}
body.bc-night .cp-single-chapter__header,
.bc-night-mode .cp-single-chapter__header {
    background: rgba(245, 158, 11, 0.08);
    border-bottom-color: rgba(245, 158, 11, 0.18);
}
body.bc-night .cp-chapter-steps,
.bc-night-mode .cp-chapter-steps {
    background: rgba(245, 158, 11, 0.08);
    border-color: rgba(245, 158, 11, 0.15);
}
body.bc-night .cp-single-chapter__label,
.bc-night-mode .cp-single-chapter__label {
    color: #fde68a;
}
body.bc-night .cp-success-banner,
.bc-night-mode .cp-success-banner {
    background: rgba(22, 163, 74, 0.1);
    border-color: rgba(34, 197, 94, 0.3);
    color: #e2e8f0;
}
body.bc-night .cp-back-bar,
.bc-night-mode .cp-back-bar {
    background: rgba(245, 158, 11, 0.12);
    border-color: rgba(245, 158, 11, 0.25);
}
body.bc-night .cp-back-bar__info,
.bc-night-mode .cp-back-bar__info {
    color: #fbbf24;
}
body.bc-night .cp-upload-zone,
.bc-night-mode .cp-upload-zone {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.15);
    color: #9ca3af;
}
body.bc-night .cp-upload-zone:hover,
body.bc-night .cp-upload-zone.has-file,
.bc-night-mode .cp-upload-zone:hover,
.bc-night-mode .cp-upload-zone.has-file {
    border-color: #f59e0b;
    background: rgba(245, 158, 11, 0.08);
    color: #fbbf24;
}
/* Night-mode: bank tile inside single-chapter purchase section */
body.bc-night .cp-single-chapter .bank-tile,
.bc-night-mode .cp-single-chapter .bank-tile {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(245, 158, 11, 0.25);
}
body.bc-night .cp-single-chapter .bank-tile__head,
.bc-night-mode .cp-single-chapter .bank-tile__head {
    background: rgba(245, 158, 11, 0.10);
    border-bottom-color: rgba(245, 158, 11, 0.18);
}
body.bc-night .cp-single-chapter .bank-tile--primary .bank-tile__head,
.bc-night-mode .cp-single-chapter .bank-tile--primary .bank-tile__head {
    background: rgba(245, 158, 11, 0.13);
}
body.bc-night .cp-single-chapter .bank-tile__name,
.bc-night-mode .cp-single-chapter .bank-tile__name {
    color: #fde68a;
}
body.bc-night .cp-single-chapter .bank-field__label,
.bc-night-mode .cp-single-chapter .bank-field__label {
    color: #9ca3af;
}
body.bc-night .cp-single-chapter .bank-field__value,
.bc-night-mode .cp-single-chapter .bank-field__value {
    color: #e5e7eb;
}
/* Step text */
body.bc-night .cp-chapter-step,
.bc-night-mode .cp-chapter-step {
    color: #d1d5db;
}

/* Banks label */
body.bc-night .cp-banks-label,
.bc-night-mode .cp-banks-label {
    color: #9ca3af;
}

/* Footer buttons */
body.bc-night #chapterPurchaseModal .modal-footer .btn-outline-secondary,
.bc-night-mode #chapterPurchaseModal .modal-footer .btn-outline-secondary {
    border-color: rgba(245, 158, 11, 0.45);
    color: #fbbf24;
    background: transparent;
}
body.bc-night #chapterPurchaseModal .modal-footer .btn-outline-secondary:hover,
body.bc-night #chapterPurchaseModal .modal-footer .btn-outline-secondary:focus,
.bc-night-mode #chapterPurchaseModal .modal-footer .btn-outline-secondary:hover,
.bc-night-mode #chapterPurchaseModal .modal-footer .btn-outline-secondary:focus {
    background: rgba(245, 158, 11, 0.12);
    border-color: rgba(245, 158, 11, 0.60);
    color: #fbbf24;
}
body.bc-night #chapterPurchaseModal .modal-footer .btn-secondary,
.bc-night-mode #chapterPurchaseModal .modal-footer .btn-secondary {
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #9ca3af;
    background: transparent;
}
body.bc-night #chapterPurchaseModal .modal-footer .btn-secondary:hover,
body.bc-night #chapterPurchaseModal .modal-footer .btn-secondary:focus,
.bc-night-mode #chapterPurchaseModal .modal-footer .btn-secondary:hover,
.bc-night-mode #chapterPurchaseModal .modal-footer .btn-secondary:focus {
    background: rgba(255, 255, 255, 0.06);
}

/* Upload form inputs (State 2) */
body.bc-night #chapterPurchaseModal .form-select,
body.bc-night #chapterPurchaseModal .form-control,
.bc-night-mode #chapterPurchaseModal .form-select,
.bc-night-mode #chapterPurchaseModal .form-control {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.15);
    color: #e5e7eb;
}
body.bc-night #chapterPurchaseModal .form-select:focus,
body.bc-night #chapterPurchaseModal .form-control:focus,
.bc-night-mode #chapterPurchaseModal .form-select:focus,
.bc-night-mode #chapterPurchaseModal .form-control:focus {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(245, 158, 11, 0.45);
    box-shadow: 0 0 0 0.2rem rgba(245, 158, 11, 0.15);
    color: #e5e7eb;
}

/* ===== Chapter Comments ===== */
.chapter-comments { max-width: 760px; margin: 2.5rem auto 4rem; padding: 0 1rem; }
.chapter-comments__title { font-size: 1.25rem; font-weight: 600; display: flex; align-items: center; gap: .5rem; margin-bottom: 1.25rem; }
.chapter-comments__count { font-size: .85rem; background: var(--bs-secondary-bg, #e9ecef); border-radius: 1rem; padding: .1rem .6rem; }

.comment-compose { border: 1px solid var(--bs-border-color, #dee2e6); border-radius: .75rem; padding: 1rem; margin-bottom: 1.5rem; }
.comment-compose--locked { display: flex; align-items: center; gap: .25rem; color: var(--bs-secondary-color, #6c757d); }
.comment-compose__input { resize: vertical; margin-bottom: .75rem; }
.comment-compose__row { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.comment-compose__spoiler { font-size: .85rem; display: flex; align-items: center; gap: .35rem; margin: 0; }
.comment-compose__notice { font-size: .8rem; color: var(--bs-secondary-color, #6c757d); margin-left: auto; }
.comment-compose__submit { white-space: nowrap; }

.comment { display: flex; gap: .75rem; padding: 1rem 0; border-top: 1px solid var(--bs-border-color, #eee); }
.comment--reply { margin-left: 2.5rem; border-top: 1px dashed var(--bs-border-color, #eee); }
.comment__avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.comment__body { flex: 1; min-width: 0; }
.comment__head { display: flex; align-items: baseline; gap: .5rem; flex-wrap: wrap; }
.comment__author { font-weight: 600; }
.comment__time, .comment__edited { font-size: .78rem; color: var(--bs-secondary-color, #6c757d); }
.comment__text { margin: .35rem 0 .5rem; white-space: pre-wrap; word-wrap: break-word; }
.comment__content--spoiler .comment__text { filter: blur(6px); transition: filter .2s; user-select: none; }
.comment__content--spoiler.is-revealed .comment__text { filter: none; user-select: auto; }
.comment__spoiler-toggle { font-size: .75rem; background: var(--bs-warning-bg-subtle, #fff3cd); border: 0; border-radius: .35rem; padding: .15rem .5rem; margin-bottom: .35rem; cursor: pointer; }
.comment__content--spoiler.is-revealed .comment__spoiler-toggle { display: none; }
.comment__actions { display: flex; gap: 1rem; }
.comment__actions button { background: none; border: 0; padding: 0; font-size: .82rem; color: var(--bs-secondary-color, #6c757d); cursor: pointer; }
.comment__actions button:hover { color: var(--bs-primary, #0d6efd); }
.comment__more-replies { background: none; border: 0; color: var(--bs-primary, #0d6efd); font-size: .82rem; margin: .5rem 0 0 2.5rem; cursor: pointer; }
.comment-pager { display: flex; gap: .35rem; justify-content: center; margin-top: 1.5rem; flex-wrap: wrap; }
.comment-pager button { min-width: 36px; height: 36px; border: 1px solid var(--bs-border-color, #dee2e6); background: transparent; border-radius: .35rem; cursor: pointer; }
.comment-pager button.is-active { background: var(--bs-primary, #0d6efd); color: #fff; border-color: var(--bs-primary, #0d6efd); }

/* Night mode */
body.bc-night .comment-compose,
.bc-night-mode .comment-compose { border-color: rgba(255,255,255,.12); }
body.bc-night .comment,
.bc-night-mode .comment { border-color: rgba(255,255,255,.12); }
body.bc-night .chapter-comments__count,
.bc-night-mode .chapter-comments__count { background: rgba(255,255,255,.12); }
body.bc-night .comment__spoiler-toggle,
.bc-night-mode .comment__spoiler-toggle { background: rgba(255,193,7,.18); color: #ffe69c; }
body.bc-night .comment-pager button,
.bc-night-mode .comment-pager button { border-color: rgba(255,255,255,.2); color: inherit; }
body.bc-night .comment__actions button,
.bc-night-mode .comment__actions button { color: rgba(255,255,255,.6); }
body.bc-night .comment__time,
body.bc-night .comment__edited,
.bc-night-mode .comment__time,
.bc-night-mode .comment__edited { color: rgba(255,255,255,.5); }

/* Hero slider (filmoja-slide) nav buttons — replaced broken image assets with FA icons */
.filmoja-slide .owl-prev,
.filmoja-slide .owl-next {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.45);
    color: #fff;
    font-size: 18px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    transition: background 0.2s, border-color 0.2s;
}

.filmoja-slide .owl-prev:hover,
.filmoja-slide .owl-next:hover {
    background: var(--primary-color, #ec7532);
    border-color: var(--primary-color, #ec7532);
}

/* ====================================================
   filmoja-quote-area background override — day & night
   The theme references a missing bgs1.jpg asset; replace
   with pure-CSS gradients for both theme modes.
   ==================================================== */

/* Day mode: deep navy — bold contrast against the light page */
.filmoja-quote-area {
    background:
        radial-gradient(ellipse at 20% 50%, rgba(236, 117, 50, 0.13) 0%, transparent 55%),
        radial-gradient(ellipse at 80% 50%, rgba(236, 117, 50, 0.09) 0%, transparent 55%),
        linear-gradient(135deg, #12172e 0%, #1c2444 50%, #121a30 100%);
}

.filmoja-quote-area::after {
    display: none; /* overlay was only needed for the missing background image */
}

/* Night mode: deeper midnight — richer orange glows to stand out on a dark page */
[data-theme="dark"] .filmoja-quote-area,
body.bc-night .filmoja-quote-area {
    background:
        radial-gradient(ellipse at 20% 50%, rgba(236, 117, 50, 0.22) 0%, transparent 55%),
        radial-gradient(ellipse at 80% 50%, rgba(236, 117, 50, 0.16) 0%, transparent 55%),
        linear-gradient(135deg, #06080f 0%, #0c1020 50%, #060810 100%);
}

/* ====================================================
   CTA Band (Home Page) — dual reader/writer strip
   ==================================================== */
.cta-band {
    display: flex;
    align-items: stretch;
}

.cta-band__panel {
    flex: 1;
    text-align: center;
    padding: 40px 32px;
}

.cta-band__panel--reader {
    border-right: 1px solid rgba(255, 255, 255, 0.12);
}

.cta-band__icon {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: rgba(236, 117, 50, 0.15);
    border: 2px solid var(--primary-color, #ec7532);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 14px;
    font-size: 20px;
    color: var(--primary-color, #ec7532);
}

.cta-band__label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--primary-color, #ec7532);
    font-weight: 600;
    margin-bottom: 8px;
}

.cta-band__title {
    color: #fff;
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
    line-height: 1.3;
}

.cta-band__subtext {
    color: #aaa;
    font-size: 13px;
    margin-bottom: 20px;
    line-height: 1.6;
}

.cta-band__btn {
    display: inline-block;
    padding: 11px 28px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    letter-spacing: 0.5px;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.cta-band__btn--primary {
    background: var(--primary-color, #ec7532);
    color: #fff;
}

.cta-band__btn--primary:hover {
    background: #d4641e;
    color: #fff;
}

.cta-band__btn--outline {
    background: transparent;
    color: var(--primary-color, #ec7532);
    border: 2px solid var(--primary-color, #ec7532);
}

.cta-band__btn--outline:hover {
    background: var(--primary-color, #ec7532);
    color: #fff;
}

@media (max-width: 767px) {
    .cta-band {
        flex-direction: column;
    }
    .cta-band__panel--reader {
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.12);
        padding-bottom: 32px;
    }
    .cta-band__panel--writer {
        padding-top: 32px;
    }
}

/* =============================================================================
   Theories Module (articles, discussions, comments)
   ============================================================================= */

.theory-article-header { padding: 2rem 0 1rem; }
.theory-article-title { font-size: 2.25rem; line-height: 1.2; margin-bottom: 0.5rem; }
.theory-article-meta { color: #666; font-size: 0.92rem; margin-bottom: 1rem; }
.theory-article-meta a { color: inherit; text-decoration: none; }
.theory-article-meta a:hover { text-decoration: underline; }
.theory-spoiler-notice { background: #fff3cd; border: 1px solid #ffeaa7; color: #856404; padding: 0.65rem 1rem; border-radius: 4px; margin-bottom: 1rem; font-size: 0.9rem; }
.theory-tag-list { list-style: none; padding: 0; margin: 0 0 1rem; display: flex; flex-wrap: wrap; gap: 0.4rem; }
.theory-tag-list li a { background: #f0f0f0; color: #333; padding: 0.25rem 0.65rem; border-radius: 3px; font-size: 0.82rem; text-decoration: none; transition: background 0.15s; }
.theory-tag-list li a:hover { background: #e0e0e0; }
.theory-tag-list li a.character { background: #e7f0ff; color: #0b4fb3; }
.theory-tag-list li a.character:hover { background: #cfe0ff; }

.theory-article-body { line-height: 1.75; font-size: 1.05rem; padding: 1rem 0 2rem; }
.theory-article-body p { margin-bottom: 1rem; }
.theory-article-body img { max-width: 100%; height: auto; border-radius: 4px; }
.theory-article-body blockquote { border-left: 4px solid #ddd; padding-left: 1rem; color: #555; margin: 1rem 0; }

.theory-image-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; margin: 1.5rem 0; }
.theory-image-card { position: relative; overflow: hidden; border-radius: 6px; background: #f5f5f5; }
.theory-image-card img { width: 100%; display: block; transition: transform 0.2s; }
.theory-image-card:hover img { transform: scale(1.03); }
.theory-image-card .caption { padding: 0.5rem 0.75rem; font-size: 0.85rem; color: #555; background: #fff; }

.theory-video-list { margin: 1.5rem 0; }
.theory-video-embed { position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; border-radius: 6px; margin-bottom: 1rem; background: #000; }
.theory-video-embed iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0; }

.theory-engagement { border-top: 1px solid #eee; border-bottom: 1px solid #eee; padding: 1rem 0; margin: 1.5rem 0; display: flex; gap: 2rem; align-items: center; flex-wrap: wrap; }
.theory-vote-widget { display: inline-flex; align-items: center; gap: 0.35rem; }
.theory-vote-widget button { background: #f5f5f5; border: 1px solid #ddd; color: #555; padding: 0.3rem 0.6rem; font-size: 0.95rem; border-radius: 3px; cursor: pointer; transition: background 0.15s, color 0.15s, border-color 0.15s; }
.theory-vote-widget button:hover { background: #eaeaea; }
.theory-vote-widget button.active-up { background: #e8f5e9; color: #2e7d32; border-color: #a5d6a7; }
.theory-vote-widget button.active-down { background: #ffebee; color: #c62828; border-color: #ef9a9a; }
.theory-vote-widget .score { font-weight: 600; font-size: 1rem; padding: 0 0.25rem; min-width: 1.5rem; text-align: center; }

.theory-rating-widget { display: inline-flex; gap: 0.1rem; align-items: center; }
.theory-rating-widget button { background: transparent; border: 0; color: #bbb; font-size: 1.4rem; padding: 0 0.05rem; cursor: pointer; transition: color 0.15s; }
.theory-rating-widget button.active,
.theory-rating-widget button:hover { color: #f1c40f; }
.theory-rating-widget .rating-label { margin-right: 0.5rem; color: #888; font-size: 0.9rem; }

.theory-comments { padding: 1.5rem 0 3rem; }
.theory-comments h3 { margin-bottom: 1rem; }
.theory-comment { padding: 0.9rem 0; border-bottom: 1px solid #f0f0f0; }
.theory-comment:last-child { border-bottom: 0; }
.theory-comment.removed .theory-comment__body { color: #999; font-style: italic; }
.theory-comment__header { display: flex; align-items: baseline; gap: 0.6rem; margin-bottom: 0.4rem; font-size: 0.88rem; color: #666; }
.theory-comment__author { font-weight: 600; color: #222; }
.theory-comment__author-badge { background: #e7f0ff; color: #0b4fb3; padding: 0.08rem 0.45rem; border-radius: 3px; font-size: 0.72rem; font-weight: 600; margin-left: 0.25rem; }
.theory-comment__time { color: #999; font-size: 0.82rem; }
.theory-comment__body { line-height: 1.6; font-size: 0.98rem; }
.theory-comment__actions { margin-top: 0.4rem; display: flex; gap: 1rem; font-size: 0.85rem; }
.theory-comment__actions button { background: transparent; border: 0; color: #0b4fb3; cursor: pointer; padding: 0; font-size: 0.85rem; }
.theory-comment__actions button:hover { text-decoration: underline; }
.theory-comment__replies { margin-left: 2rem; padding-left: 1rem; border-left: 2px solid #eef2f8; }

.theory-comment-form { margin: 1rem 0; }
.theory-comment-form textarea { width: 100%; min-height: 80px; padding: 0.6rem; border: 1px solid #ccc; border-radius: 4px; font-size: 0.95rem; resize: vertical; }
.theory-comment-form__row { display: flex; align-items: center; gap: 0.8rem; margin-top: 0.4rem; flex-wrap: wrap; }
.theory-comment-form label { font-size: 0.85rem; display: inline-flex; align-items: center; gap: 0.3rem; }
.theory-comment-form button[type="submit"] { background: #0b4fb3; color: #fff; border: 0; padding: 0.45rem 1.1rem; border-radius: 4px; cursor: pointer; font-size: 0.9rem; }
.theory-comment-form button[type="submit"]:hover { background: #0a449d; }
.theory-comment-form button[type="submit"]:disabled { opacity: 0.6; cursor: not-allowed; }
.theory-comment-form .reply-indicator { font-size: 0.8rem; color: #888; }

.theory-report-link { font-size: 0.82rem; color: #999; cursor: pointer; text-decoration: none; }
.theory-report-link:hover { color: #c62828; }

.theory-empty, .theory-error { padding: 2rem 1rem; text-align: center; color: #666; background: #fafafa; border-radius: 4px; }

@media (max-width: 767px) {
    .theory-article-title { font-size: 1.6rem; }
    .theory-engagement { gap: 1rem; }
    .theory-comment__replies { margin-left: 1rem; padding-left: 0.75rem; }
}

/* =============================================================================
   Spoiler Rendering (Reddit-style inline + post-level + image spoilers)
   ============================================================================= */

/* Inline spoiler: blacked out until revealed by click */
.spoiler {
    background: #111;
    color: transparent;
    border-radius: 3px;
    padding: 0 2px;
    cursor: pointer;
    transition: color .12s ease, background .12s ease;
    user-select: none;
}
.spoiler.revealed {
    background: rgba(0,0,0,.06);
    color: inherit;
    user-select: text;
}

/* Post-level spoiler block: blurred until revealed */
.spoiler-block { position: relative; }
.spoiler-block:not(.revealed) > .spoiler-block-content {
    filter: blur(10px);
    pointer-events: none;
    user-select: none;
}
.spoiler-block .spoiler-reveal {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}
.spoiler-block.revealed .spoiler-reveal { display: none; }

/* Image spoiler: blurred until revealed */
.spoiler-image:not(.revealed) img { filter: blur(18px); }
.spoiler-image .spoiler-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 2;
}

/* Dark theme adjustments */
@media (prefers-color-scheme: dark) {
    .spoiler { background: #000; }
}

/* ── Cookie consent banner ─────────────────────────────────────────────── */
.cookie-consent {
    display: none;
    position: fixed;
    inset: auto 0 0 0;
    z-index: 1080;
    background: #fff;
    color: #212529;
    border-top: 1px solid rgba(0, 0, 0, .15);
    box-shadow: 0 -2px 12px rgba(0, 0, 0, .12);
}

.cookie-consent--visible { display: block; }

.cookie-consent__inner {
    max-width: 1140px;
    margin: 0 auto;
    padding: 1rem 1.25rem;
    display: flex;
    gap: 1.25rem;
    align-items: center;
    flex-wrap: wrap;
}

.cookie-consent__text { flex: 1 1 24rem; }
.cookie-consent__title { display: block; margin-bottom: .25rem; }
.cookie-consent__body { margin: 0 0 .35rem; font-size: .925rem; }
.cookie-consent__essential { margin: 0; font-size: .8rem; opacity: .75; }

.cookie-consent__actions {
    display: flex;
    gap: .5rem;
    flex: 0 0 auto;
    margin-left: auto;
}

@media (max-width: 575.98px) {
    .cookie-consent__actions { width: 100%; }
    .cookie-consent__actions .btn { flex: 1 1 0; }
}

[data-theme="dark"] .cookie-consent {
    background: #1e1e24;
    color: #e9ecef;
    border-top-color: rgba(255, 255, 255, .15);
}

[data-theme="dark"] .cookie-consent__essential { opacity: .8; }

/* ── Bot check (Cloudflare Turnstile) ─────────────────────────────────────── */
/* Rendered appearance="interaction-only", so the widget has no height at all for the
   overwhelming majority of visitors. The container therefore claims layout space ONLY while a
   checkbox is actually being shown (.bc-captcha--interactive, toggled by captcha.js) —
   otherwise every form looks exactly as it did before this feature. The partial sits after the
   submit button in the DOM, so a challenge appearing pushes nothing upward and cannot shift the
   button out from under a cursor. */
.bc-captcha {
    display: flex;
    justify-content: center;
}

.bc-captcha--interactive {
    min-height: 65px; /* Turnstile's own widget height — reserved only while shown */
    margin-top: 1rem;
}
