/* === CSS VARIABLES - Forbes Black Theme === */
:root {
    /* Backgrounds */
    --bg-primary: #080808;
    --bg-secondary: #0f0f0f;
    --bg-tertiary: #161616;
    --bg-elevated: #1e1e1e;

    /* Borders */
    --border-subtle: #1e1e1e;
    --border-default: #2a2a2a;
    --border-strong: #333333;

    /* Text */
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --text-muted: #666666;
    --text-inverse: #000000;

    /* Accent */
    --accent: #ff6b35;
    --accent-dim: rgba(255, 107, 53, 0.15);

    /* Semantic */
    --success: #2d6a4f;
    --error: #c1121f;
    --warning: #f4a261;

    /* Layout */
    --container-max: 1600px;
    --radius-sm: 3px;
    --radius-md: 6px;
    --radius-lg: 9px;

    /* Animation */
    --ease-out: cubic-bezier(0.215, 0.61, 0.355, 1);
    --ease-in-out: cubic-bezier(0.645, 0.045, 0.355, 1);
}

/* === RESET & BASE === */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

html::-webkit-scrollbar {
    display: none;
}

body {
    font-family: 'Inter', 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    overflow-x: hidden;
    font-size: 15px;
}

/* Page load animation */
body.page-loading {
    opacity: 0;
}

body.loaded {
    animation: fadeIn 0.5s var(--ease-out) forwards;
}

/* === ANIMATIONS === */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* Animate on scroll */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
}

.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger children */
.stagger-children > * {
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 0.5s var(--ease-out), transform 0.5s var(--ease-out);
}

.stagger-children.visible > *:nth-child(1) { transition-delay: 0.1s; }
.stagger-children.visible > *:nth-child(2) { transition-delay: 0.2s; }
.stagger-children.visible > *:nth-child(3) { transition-delay: 0.3s; }
.stagger-children.visible > *:nth-child(4) { transition-delay: 0.4s; }
.stagger-children.visible > *:nth-child(5) { transition-delay: 0.5s; }
.stagger-children.visible > * {
    opacity: 1;
    transform: translateY(0);
}

/* === LAYOUT === */
.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 32px;
}

section {
    border-bottom: 1px solid var(--border-subtle);
}

/* === HEADER === */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(8, 8, 8, 0.95);
    border-bottom: 1px solid var(--border-subtle);
}

.nav {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 52px;
    position: relative;
}

.logo {
    position: absolute;
    left: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-primary);
    text-decoration: none;
    letter-spacing: -0.02em;
}

.logo svg {
    width: 24px;
    height: 24px;
}

.nav-links {
    display: flex;
    gap: 28px;
    align-items: center;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.85rem;
    transition: color 0.15s ease;
    letter-spacing: 0.01em;
}

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

/* === HERO SECTION === */
.hero {
    min-height: 40vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 70px;
    padding-bottom: 40px;
    border-bottom: 1px solid var(--border-subtle);
}

.hero-content {
    text-align: center;
    max-width: 1100px;
    width: 100%;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 16px;
    letter-spacing: 0.02em;
    animation: fadeInUp 0.6s var(--ease-out) 0.1s both;
}

.hero-title {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 14px;
    animation: fadeInUp 0.6s var(--ease-out) 0.2s both;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.hero-title span {
    color: #ffffff;
    position: relative;
}

.hero-subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 28px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.5;
    animation: fadeInUp 0.6s var(--ease-out) 0.3s both;
}

/* === DOWNLOAD CARD === */
.download-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 18px;
    max-width: 1500px;
    margin: 0 auto;
    animation: scaleIn 0.5s var(--ease-out) 0.4s both;
    overflow: visible;
}

.input-group {
    display: flex;
    align-items: center;
    gap: 0;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    padding: 4px;
    transition: border-color 0.15s ease;
    position: relative;
    overflow: visible;
}

.input-group:focus-within {
    border-color: var(--border-strong);
}

.input-icon {
    padding-left: 14px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
}

.input-icon svg {
    width: 16px;
    height: 16px;
}

.url-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 1rem;
    font-family: inherit;
    padding: 12px 14px;
}

.url-input::placeholder {
    color: var(--text-muted);
    transition: color 0.3s ease;
}

.url-input:focus::placeholder {
    color: transparent;
}

.paste-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 6px;
    cursor: pointer;
    transition: all 0.3s var(--ease-out);
    border-radius: var(--radius-sm);
}

.paste-btn:hover {
    color: var(--text-secondary);
    background: var(--bg-tertiary);
    transform: scale(1.05);
}

.paste-btn:active {
    transform: scale(0.95);
}

.paste-btn svg {
    width: 16px;
    height: 16px;
}

/* === RECENTLY PASTED SECTION === */
.recently-pasted-section {
    max-width: 1000px;
    margin: 24px auto 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 20px;
    animation: fadeInUp 0.5s var(--ease-out) 0.5s both;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.section-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.pasted-items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}

.pasted-item {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    cursor: pointer;
    transition: all 0.2s var(--ease-out);
    position: relative;
}

.pasted-item:hover {
    background: var(--bg-hover);
    border-color: var(--border-strong);
    transform: translateY(-2px);
}

.pasted-item-url {
    font-size: 0.85rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.pasted-item-title {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
}

.pasted-item-remove {
    position: absolute;
    top: 8px;
    right: 8px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.pasted-item-remove:hover {
    color: var(--text-primary);
    background: var(--bg-primary);
}

.pasted-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 32px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.fetch-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: var(--accent);
    border: none;
    border-radius: 12px;
    padding: 9px 20px;
    color: var(--text-inverse);
    font-weight: 600;
    font-size: 0.8rem;
    letter-spacing: 0.01em;
    cursor: pointer;
    transition: all 0.3s var(--ease-out);
    transform: translateY(0);
}

.fetch-btn:hover {
    opacity: 0.95;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.15);
}

.fetch-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(255, 255, 255, 0.1);
}

.fetch-btn.loading .btn-text {
    display: none;
}

.fetch-btn.loading .spinner {
    display: block;
}

.spinner {
    display: none;
}

.spinner-circle {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* === ERROR MESSAGE === */
.error-message {
    margin-top: 20px;
    padding: 14px 18px;
    background: rgba(193, 18, 31, 0.15);
    border: 1px solid rgba(193, 18, 31, 0.3);
    border-radius: var(--radius-md);
    color: var(--error);
    font-size: 0.9rem;
    display: none;
}

.error-message.show {
    display: block;
}

/* === RESULTS SECTION === */
.results-section {
    margin-top: 32px;
    display: none;
}

.results-section.show {
    display: block;
    animation: fadeInUp 0.5s var(--ease-out) both;
}

.chapter-header {
    display: flex;
    gap: 24px;
    margin-bottom: 24px;
    animation: fadeInUp 0.5s var(--ease-out) 0.1s both;
}

.chapter-cover {
    width: 180px;
    height: 240px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    overflow: hidden;
    flex-shrink: 0;
    transition: transform 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out);
}

.chapter-cover:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.chapter-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s var(--ease-out);
}

.chapter-cover:hover img {
    transform: scale(1.05);
}

.cover-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}

.cover-placeholder svg {
    width: 48px;
    height: 48px;
}

.chapter-info {
    flex: 1;
}

.chapter-details {
    flex: 1;
}

.manga-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}

.chapter-text {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.page-count {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.page-count svg {
    width: 16px;
    height: 16px;
}

.results-header {
    display: flex;
    align-items: center;
    margin-bottom: 24px;
}

.back-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    transition: all 0.2s var(--ease-out);
}

.back-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.back-btn svg {
    width: 18px;
    height: 18px;
}

.download-options {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 24px;
}

.format-selector {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.format-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.format-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.format-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.format-btn:hover {
    background: var(--bg-hover);
    border-color: var(--border-muted);
}

.format-btn.active {
    background: var(--accent-dim);
    border-color: var(--accent);
    color: var(--accent);
}

.format-btn svg {
    width: 16px;
    height: 16px;
}

.download-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 24px;
    background: var(--accent);
    color: var(--text-inverse);
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s var(--ease-out);
}

.download-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.15);
}

.download-btn svg {
    width: 20px;
    height: 20px;
}

.chapter-number {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.lang-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 6px;
    background: var(--accent-dim);
    border: 1px solid var(--accent);
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--accent);
    letter-spacing: 0.5px;
    margin-right: 6px;
}

.chapter-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.meta-item svg {
    width: 16px;
    height: 16px;
}

/* === ACTIONS === */
.actions {
    display: flex;
    gap: 12px;
    margin-top: 32px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s var(--ease-out);
    text-decoration: none;
    transform: translateY(0);
}

.btn-primary {
    background: var(--accent);
    color: var(--text-inverse);
}

.btn-primary:hover {
    opacity: 0.95;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.15);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-default);
}

.btn-secondary:hover {
    background: var(--bg-elevated);
    transform: translateY(-1px);
}

.btn-secondary:active {
    transform: translateY(0);
}

/* === PREVIEW SECTION === */
.preview-section {
    margin-top: 40px;
}

.preview-section.hidden {
    display: none;
}

.preview-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text-secondary);
}

.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
}

.image-card {
    aspect-ratio: 2/3;
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    position: relative;
    opacity: 0;
    animation: scaleIn 0.4s var(--ease-out) both;
    transition: all 0.3s var(--ease-out);
}

.image-card:hover {
    border-color: var(--border-default);
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.image-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s var(--ease-out);
}

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

.image-number {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: var(--bg-primary);
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.load-more-spinner {
    display: flex;
    justify-content: center;
    padding: 24px;
}

.load-more-spinner.hidden {
    display: none;
}

.loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border-subtle);
    border-top-color: var(--text-muted);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* === MORE CHAPTERS SECTION === */
.more-chapters-section {
    margin-top: 40px;
    padding: 24px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
}

.more-chapters-section.hidden {
    display: none;
}

.more-chapters-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-subtle);
}

.more-chapters-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.more-chapters-count {
    font-size: 0.85rem;
    color: var(--text-muted);
    background: var(--bg-tertiary);
    padding: 4px 10px;
    border-radius: var(--radius-sm);
}

.more-chapters-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 360px;
    overflow-y: auto;
}

.more-chapters-list::-webkit-scrollbar {
    width: 6px;
}

.more-chapters-list::-webkit-scrollbar-track {
    background: transparent;
}

.more-chapters-list::-webkit-scrollbar-thumb {
    background: var(--border-default);
    border-radius: 12px;
}

.more-chapter-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background 0.15s ease;
}

.more-chapter-item:hover {
    background: var(--bg-tertiary);
}

.more-chapter-item.current {
    background: var(--bg-tertiary);
}

.more-chapter-item.current .more-chapter-number {
    color: var(--text-primary);
}

.more-chapter-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.more-chapter-number {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
}

.more-chapter-title {
    font-size: 0.85rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.more-chapter-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.more-chapter-group {
    max-width: 120px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.more-chapter-date {
    white-space: nowrap;
}

/* === LOADING STATE === */
.loading-state {
    margin-top: 40px;
    text-align: center;
}

.loading-state.hidden {
    display: none;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto 16px;
    border: 3px solid var(--border-subtle);
    border-top-color: var(--text-muted);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* === MANGA CHAPTER SELECTION === */
.manga-selection {
    margin-top: 40px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 32px;
}

.manga-selection.hidden {
    display: none;
}

.manga-selection-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    gap: 20px;
}

.manga-selection-info {
    display: flex;
    align-items: center;
    gap: 20px;
    flex: 1;
    min-width: 0;
}

.manga-selection-cover {
    width: 80px;
    height: 120px;
    object-fit: cover;
    border-radius: var(--radius-md);
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.manga-selection-text {
    flex: 1;
    min-width: 0;
}

.manga-selection-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.close-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all 0.15s ease;
}

.close-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.chapter-filters {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.filter-select {
    padding: 10px 14px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: inherit;
    cursor: pointer;
}

.filter-select:focus {
    outline: none;
    border-color: var(--border-default);
}

.chapter-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-height: 500px;
    overflow-y: auto;
}

.chapter-list::-webkit-scrollbar {
    width: 6px;
}

.chapter-list::-webkit-scrollbar-track {
    background: transparent;
}

.chapter-list::-webkit-scrollbar-thumb {
    background: var(--border-default);
    border-radius: 12px;
}

.chapter-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background 0.15s ease;
}

.chapter-list-item:hover {
    background: var(--bg-tertiary);
}

.chapter-list-item.selected {
    background: var(--bg-tertiary);
}

.chapter-item-info {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
}

.chapter-item-number {
    font-weight: 600;
    color: var(--text-primary);
    min-width: 80px;
}

.chapter-item-title {
    color: var(--text-muted);
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chapter-item-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.download-chapter-btn {
    padding: 8px 16px;
    background: var(--accent);
    color: var(--text-inverse);
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.15s ease;
}

.download-chapter-btn:hover {
    opacity: 0.9;
}

/* === RECENT DOWNLOADS SECTION === */
.recent-downloads {
    padding: 50px 0;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-subtle);
}

.section-header {
    text-align: center;
    margin-bottom: 32px;
}

.section-title-sm {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}

.recent-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 16px;
}

.recent-card {
    display: flex;
    flex-direction: column;
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s var(--ease-out);
    animation: fadeInUp 0.4s var(--ease-out) both;
}

.recent-card:hover {
    border-color: var(--border-default);
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.recent-card-cover {
    aspect-ratio: 2/3;
    background: var(--bg-tertiary);
    overflow: hidden;
    position: relative;
}

.recent-card-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s var(--ease-out);
}

.recent-card:hover .recent-card-cover img {
    transform: scale(1.05);
}

.recent-card-cover .placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}

.recent-card-cover .placeholder svg {
    width: 32px;
    height: 32px;
}

.recent-card-info {
    padding: 12px;
}

.recent-card-title {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 4px;
    line-height: 1.3;
    height: 2.2em;
}

.recent-card-chapter {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Skeleton loading */
.recent-skeleton {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 16px;
}

.skeleton-card {
    aspect-ratio: 2/3;
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 0.6;
    }
    50% {
        opacity: 1;
    }
}

.recent-empty-state {
    text-align: center;
    padding: 60px 40px;
    color: var(--text-secondary);
    font-size: 1rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1px dashed var(--border-default);
}

/* === HOW TO SECTION === */
.how-to {
    padding: 60px 0;
    background: var(--bg-secondary);
}

.section-title {
    font-size: 1.75rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 40px;
    letter-spacing: -0.02em;
}

.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 32px;
    max-width: 900px;
    margin: 0 auto;
}

.step-number {
    width: 48px;
    height: 48px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.step-content h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.step-content p {
    color: var(--text-secondary);
    line-height: 1.6;
    font-size: 0.95rem;
}

/* === FAQ SECTION === */
.faq {
    padding: 60px 0;
}

.faq-list {
    max-width: 800px;
    margin: 0 auto;
}

.faq-item {
    border-bottom: 1px solid var(--border-subtle);
}

.faq-question {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: color 0.3s var(--ease-out);
}

.faq-question:hover {
    color: var(--text-secondary);
}

.faq-icon {
    transition: transform 0.4s var(--ease-in-out);
}

.faq-item.active .faq-icon {
    transform: rotate(180deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s var(--ease-in-out), opacity 0.3s var(--ease-out);
    opacity: 0;
}

.faq-item.active .faq-answer {
    max-height: 500px;
    padding-bottom: 16px;
    opacity: 1;
}

.faq-answer p {
    color: var(--text-secondary);
    line-height: 1.6;
}

/* === FOOTER === */
.footer {
    padding: 40px 0 24px;
    border-top: 1px solid var(--border-subtle);
    background: var(--bg-secondary);
}

.footer-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    margin-bottom: 32px;
}

.footer-brand {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer-brand .logo {
    position: static;
    display: inline-flex;
    margin-bottom: 8px;
}

.footer-brand p {
    color: var(--text-muted);
    font-size: 0.9rem;
    max-width: 280px;
    line-height: 1.6;
}

.footer-links {
    display: flex;
    gap: 48px;
}

.footer-column h4 {
    color: var(--text-primary);
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.footer-column a {
    display: block;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    margin-bottom: 10px;
    transition: color 0.15s ease;
}

.footer-column a:hover {
    color: var(--text-secondary);
}

.footer-bottom {
    padding-top: 24px;
    border-top: 1px solid var(--border-subtle);
    text-align: center;
}

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

/* === CLIPBOARD DROPDOWN === */
.clipboard-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 320px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    z-index: 5000;
    animation: fadeInUp 0.2s var(--ease-out) both;
    max-height: 400px;
    overflow-y: auto;
}

.clipboard-dropdown::-webkit-scrollbar {
    width: 6px;
}

.clipboard-dropdown::-webkit-scrollbar-track {
    background: transparent;
}

.clipboard-dropdown::-webkit-scrollbar-thumb {
    background: var(--border-default);
    border-radius: 12px;
}

.dropdown-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-subtle);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.clear-small-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: all 0.15s ease;
}

.clear-small-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

.clipboard-list {
    max-height: 280px;
    overflow-y: auto;
}

.clipboard-list::-webkit-scrollbar {
    width: 4px;
}

.clipboard-list::-webkit-scrollbar-track {
    background: transparent;
}

.clipboard-list::-webkit-scrollbar-thumb {
    background: var(--border-default);
    border-radius: 12px;
}

.clipboard-empty {
    padding: 24px 16px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.clipboard-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.15s ease;
    border-bottom: 1px solid var(--border-subtle);
}

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

.clipboard-item:hover {
    background: var(--bg-tertiary);
}

.clipboard-item-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    flex-shrink: 0;
}

.clipboard-item-content {
    flex: 1;
    min-width: 0;
}

.clipboard-item-title {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.clipboard-item-url {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.clipboard-item-time {
    font-size: 0.75rem;
    color: var(--text-muted);
    flex-shrink: 0;
}

.clipboard-item-remove {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.clipboard-item-remove:hover {
    background: var(--bg-tertiary);
    color: var(--error);
}

/* === DOWNLOAD PROGRESS === */
.download-progress {
    margin-top: 24px;
    padding: 20px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
}

.progress-bar {
    height: 6px;
    background: var(--bg-primary);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 12px;
}

.progress-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 12px;
    transition: width 0.3s ease;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
}

.progress-info span:first-child {
    color: var(--text-secondary);
}

.progress-info span:last-child {
    color: var(--text-primary);
    font-weight: 600;
}

/* === FILE INFO & CACHE === */
.file-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 16px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.cache-notice {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    color: var(--text-muted);
}

.cache-notice svg {
    flex-shrink: 0;
}

/* === CAPTCHA === */
.captcha-container {
    display: flex;
    justify-content: center;
    margin: 16px 0;
}

.captcha-container .cf-turnstile {
    width: fit-content;
}

/* === SETTINGS === */
.settings-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    margin-top: 16px;
    padding: 12px 16px;
    background: transparent;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.settings-toggle:hover {
    background: var(--bg-tertiary);
    border-color: var(--border-default);
    color: var(--text-primary);
}

.settings-toggle svg {
    flex-shrink: 0;
}

.settings-panel {
    margin-top: 16px;
    padding: 20px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
}

.settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

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

.settings-select {
    padding: 8px 12px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: inherit;
    cursor: pointer;
    transition: border-color 0.15s ease;
}

.settings-select:focus {
    outline: none;
    border-color: var(--border-default);
}

/* === FILTER GROUPS === */
.filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-group label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.filter-input {
    padding: 10px 14px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: inherit;
    min-width: 200px;
}

.filter-input:focus {
    outline: none;
    border-color: var(--border-default);
}

.filter-input::placeholder {
    color: var(--text-muted);
}

/* === BULK ACTIONS === */
.bulk-actions-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    margin-bottom: 16px;
}

.bulk-actions-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.select-all-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    cursor: pointer;
}

.select-all-checkbox input {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.selected-count {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.bulk-actions-right {
    display: flex;
    gap: 8px;
}

.bulk-action-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.bulk-action-btn:hover {
    background: var(--bg-primary);
    border-color: var(--border-default);
    color: var(--text-primary);
}

.bulk-action-btn.primary {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--text-inverse);
}

.bulk-action-btn.primary:hover {
    opacity: 0.9;
}

.bulk-action-btn svg {
    width: 16px;
    height: 16px;
}

/* === MODALS === */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    animation: fadeIn 0.2s ease both;
}

.modal-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 480px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: scaleIn 0.3s var(--ease-out) both;
}

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

.modal-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all 0.15s ease;
}

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

.modal-body {
    padding: 20px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 20px;
    border-top: 1px solid var(--border-subtle);
}

.range-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}

.range-input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.range-input-group label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.range-input {
    padding: 10px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: inherit;
}

.range-input:focus {
    outline: none;
    border-color: var(--border-default);
}

.range-options {
    padding-top: 16px;
    border-top: 1px solid var(--border-subtle);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    cursor: pointer;
}

.checkbox-label input {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* === CUSTOM CHECKBOX === */
.custom-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
    position: relative;
}

.custom-checkbox input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.custom-checkbox .checkmark {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 22px;
    width: 22px;
    min-width: 22px;
    background: var(--bg-secondary);
    border: 2px solid var(--border-muted);
    border-radius: 9px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.custom-checkbox .checkmark::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: var(--accent);
    border-radius: 50%;
    transform: scale(0);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.custom-checkbox:hover .checkmark {
    border-color: var(--accent);
    background: var(--bg-tertiary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.custom-checkbox input:checked ~ .checkmark {
    border-color: var(--accent);
    background: var(--accent);
}

.custom-checkbox input:checked ~ .checkmark::before {
    transform: scale(1.5);
    opacity: 0;
}

.custom-checkbox .checkmark svg {
    position: relative;
    z-index: 1;
    display: none;
    color: white;
    transform: scale(0);
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1) 0.05s;
}

.custom-checkbox input:checked ~ .checkmark svg {
    display: block;
    transform: scale(1);
}

/* === CUSTOM DROPDOWN === */
.custom-dropdown {
    position: relative;
    display: flex;
    align-items: center;
}

.custom-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding: 10px 32px 10px 14px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
}

.custom-select:hover {
    border-color: var(--border-strong);
}

.custom-select:focus {
    outline: none;
    border-color: var(--accent);
}

.dropdown-arrow {
    position: absolute;
    right: 10px;
    pointer-events: none;
    color: var(--text-muted);
    transition: transform 0.2s;
}

.custom-select:focus ~ .dropdown-arrow {
    transform: rotate(180deg);
}

.modal-btn {
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.modal-btn.secondary {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

.modal-btn.secondary:hover {
    background: var(--bg-elevated);
    color: var(--text-primary);
}

.modal-btn.primary {
    background: var(--accent);
    color: var(--text-inverse);
}

.modal-btn.primary:hover {
    opacity: 0.9;
}

/* === CHAPTER LIST ITEMS === */
.chapter-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: transparent;
    border-radius: var(--radius-md);
    transition: background 0.15s ease;
    cursor: pointer;
    gap: 16px;
}

.chapter-item:hover {
    background: var(--bg-tertiary);
}

.chapter-item.selected {
    background: var(--bg-tertiary);
}

.chapter-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.chapter-main .chapter-number {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.chapter-main .chapter-title {
    font-size: 0.9rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chapter-meta-inline {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.chapter-meta-inline .chapter-group {
    color: var(--text-muted);
}

.chapter-meta-inline .chapter-date {
    color: var(--text-muted);
}

.chapter-checkbox {
    flex-shrink: 0;
}

.chapter-checkbox .checkmark {
    width: 18px;
    height: 18px;
}

.chapter-item-right {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
}

.chapter-groups {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.chapter-group-badge {
    padding: 3px 8px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    color: var(--text-muted);
}

.chapter-date {
    font-size: 0.8rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.chapter-list-empty {
    padding: 40px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* === MANGA SELECTION === */
.manga-selection-desc {
    margin-bottom: 20px;
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.5;
}

.load-more-chapters-btn {
    width: 100%;
    margin-top: 16px;
    padding: 14px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.load-more-chapters-btn:hover {
    background: var(--bg-elevated);
    border-color: var(--border-default);
    color: var(--text-primary);
}

/* === TOAST NOTIFICATION === */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    padding: 12px 24px;
    background: var(--accent);
    color: var(--text-inverse);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    z-index: 2000;
    opacity: 0;
    transition: all 0.3s var(--ease-out);
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* === RECENT SIDEBAR === */
.recent-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 360px;
    background: var(--bg-secondary);
    border-left: 1px solid var(--border-default);
    z-index: 500;
    transform: translateX(100%);
    transition: transform 0.3s var(--ease-out);
    display: flex;
    flex-direction: column;
}

.recent-sidebar:not(.hidden) {
    transform: translateX(0);
}

.recent-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid var(--border-subtle);
}

.recent-header h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.recent-header h3 svg {
    width: 20px;
    height: 20px;
}

.icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all 0.15s ease;
}

.icon-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.recent-list {
    flex: 1;
    overflow-y: auto;
}

.recent-list::-webkit-scrollbar {
    width: 6px;
}

.recent-list::-webkit-scrollbar-track {
    background: transparent;
}

.recent-list::-webkit-scrollbar-thumb {
    background: var(--border-default);
    border-radius: 12px;
}

.recent-empty {
    padding: 40px 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.recent-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border-subtle);
    cursor: pointer;
    transition: background 0.15s ease;
}

.recent-item:hover {
    background: var(--bg-tertiary);
}

.recent-item-info {
    flex: 1;
    min-width: 0;
}

.recent-item-title {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.recent-item-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.recent-item-actions {
    display: flex;
    gap: 8px;
}

.recent-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all 0.15s ease;
}

.recent-action-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.recent-action-btn svg {
    width: 14px;
    height: 14px;
}

/* === MORE CHAPTERS STATES === */
.more-chapters-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 32px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.more-chapters-empty {
    padding: 32px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* === UTILITY === */
.hidden {
    display: none !important;
}

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

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .container {
        padding: 0 20px;
    }

    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .download-card {
        padding: 24px;
    }

    .input-group {
        flex-direction: column;
    }

    .fetch-btn {
        width: 100%;
    }

    .chapter-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .actions {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .footer-links {
        gap: 32px;
    }

    .clipboard-dropdown {
        right: -20px;
        min-width: calc(100vw - 40px);
    }

    .bulk-actions-bar {
        flex-direction: column;
        gap: 12px;
    }

    .bulk-actions-left,
    .bulk-actions-right {
        width: 100%;
        justify-content: space-between;
    }

    .recent-sidebar {
        width: 100%;
    }
}

/* === PAGE STYLES (Privacy, Terms) === */
.page-container {
    min-height: 100vh;
    padding: 80px 0 60px;
    background: var(--bg-primary);
}

.page-header {
    text-align: center;
    margin-bottom: 48px;
}

.page-header h1 {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
    letter-spacing: -0.02em;
}

.page-header p {
    font-size: 1rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto;
}

.page-content {
    max-width: 800px;
    margin: 0 auto;
}

.page-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 32px;
    margin-bottom: 24px;
}

.page-section h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-subtle);
}

.page-section h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 20px;
    margin-bottom: 10px;
}

.page-section p,
.page-section ul {
    color: var(--text-secondary);
    line-height: 1.7;
    font-size: 0.95rem;
}

.page-section ul {
    padding-left: 24px;
    margin: 12px 0;
}

.page-section li {
    margin-bottom: 8px;
}

.page-section a {
    color: var(--text-primary);
    text-decoration: none;
    border-bottom: 1px solid var(--border-default);
    transition: border-color 0.15s ease;
}

.page-section a:hover {
    border-color: var(--text-secondary);
}

.page-section code {
    padding: 2px 6px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    font-family: 'SF Mono', Monaco, Consolas, monospace;
    font-size: 0.9em;
    color: var(--text-primary);
}

.contact-box {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 24px;
    text-align: center;
    margin-top: 32px;
}

.contact-box p {
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.contact-box a {
    display: inline-block;
    padding: 12px 24px;
    background: var(--accent);
    color: var(--text-inverse);
    text-decoration: none;
    border-radius: var(--radius-md);
    font-weight: 500;
    border: none;
    transition: opacity 0.2s ease;
}

.contact-box a:hover {
    opacity: 0.9;
}

/* === GITHUB SECTION === */
.github-section {
    padding: 48px 0;
    background: var(--bg-secondary);
}

.github-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    padding: 24px;
    max-width: 600px;
    margin: 0 auto;
}

.github-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.github-avatar {
    width: 48px;
    height: 48px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
}

.github-title {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.github-title h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.github-badge {
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
}

.github-badge.public {
    background: var(--success-dim);
    color: var(--success);
    border: 1px solid var(--success-subtle);
}

.github-desc {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 16px;
}

.github-stats {
    display: flex;
    gap: 20px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.github-stat {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.github-stat svg {
    color: var(--text-muted);
}

.github-languages {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-subtle);
}

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

.lang-tag {
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 500;
}

.lang-tag.Python {
    background: #3572A5;
    color: white;
}

.lang-tag.HTML {
    background: #e34c26;
    color: white;
}

.lang-tag.CSS {
    background: #563d7c;
    color: white;
}

.lang-tag.JavaScript {
    background: #f1e05a;
    color: #24292e;
}

.github-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--accent);
    color: var(--text-inverse);
    text-decoration: none;
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 0.9rem;
    transition: opacity 0.2s ease;
}

.github-link:hover {
    opacity: 0.9;
}

@media (max-width: 768px) {
    .page-section {
        padding: 24px;
    }
}
