@import url('https://fonts.googleapis.com/css2?family=Exo+2:wght@300;400;500;600;700&family=Changa+One&family=Dela+Gothic+One&family=BBH+Bartle&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Dark theme palette */
    --bg-primary: #18181b;
    --bg-secondary: #222225;
    --bg-tertiary: #2a2a2d;
    --bg-elevated: #2e2e32;
    --glass-bg: rgba(34, 34, 37, 0.85);
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --text-tertiary: #707070;
    --accent-primary: #e10500;
    --accent-secondary: #ff1a0f;
    --accent-glow: rgba(225, 5, 0, 0.15);
    --border-primary: rgba(255, 255, 255, 0.08);
    --border-secondary: rgba(255, 255, 255, 0.04);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.6);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.6);
    --shadow-xl: 0 24px 48px rgba(0, 0, 0, 0.7);
    
    /* Site-specific colors */
    --eva-color: #ff3370;
    --fairy-color: #d48597;
    --violet-color: #ee00ff;
}

body {
    font-family: 'Exo 2', -apple-system, system-ui, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Access Code Popup */
.access-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.access-popup-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
}

.access-popup-content {
    position: relative;
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 1rem;
    padding: 3rem 2.5rem;
    width: 90%;
    max-width: 420px;
    text-align: center;
    box-shadow: var(--shadow-xl);
}

.access-popup-header {
    margin-bottom: 2rem;
}

.access-lock-icon {
    width: 3rem;
    height: 3rem;
    color: var(--accent-primary);
    margin: 0 auto 1.5rem;
}

.access-popup-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.access-popup-subtitle {
    font-size: 0.9375rem;
    color: var(--text-secondary);
}

.access-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.access-input {
    width: 100%;
    background: var(--bg-elevated);
    border: 1px solid var(--border-primary);
    border-radius: 0.5rem;
    padding: 1rem 1.25rem;
    color: var(--text-primary);
    font-size: 0.9375rem;
    font-family: 'Exo 2', sans-serif;
    text-align: center;
    letter-spacing: 0.05em;
    outline: none;
    transition: all 0.2s ease;
}

.access-input:focus {
    border-color: var(--accent-primary);
    background: var(--bg-tertiary);
}

.access-input::placeholder {
    color: var(--text-tertiary);
    letter-spacing: normal;
}

.access-submit {
    background: var(--accent-primary);
    color: white;
    border: none;
    border-radius: 0.5rem;
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    font-family: 'Exo 2', sans-serif;
    cursor: pointer;
    transition: all 0.2s ease;
}

.access-submit:hover:not(:disabled) {
    background: var(--accent-secondary);
    transform: translateY(-1px);
}

.access-submit:active:not(:disabled) {
    transform: translateY(0);
}

.access-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.access-error {
    background: rgba(225, 5, 0, 0.1);
    border: 1px solid rgba(225, 5, 0, 0.3);
    color: var(--accent-primary);
    padding: 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Exo 2', sans-serif;
    font-weight: 600;
    letter-spacing: -0.03em;
}

/* SVG Icons */
svg {
    width: 1.25rem;
    height: 1.25rem;
    stroke-width: 1.75;
}

/* Navbar */
.navbar {
    background: var(--glass-bg);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border-bottom: 1px solid var(--border-primary);
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.25rem 3rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    display: flex;
    align-items: center;
    font-size: 1.125rem;
    font-weight: 700;
    font-family: 'Dela Gothic One', sans-serif;
    letter-spacing: 0.08em;
}

.brand-name {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-links {
    display: flex;
    gap: 0.25rem;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 0.75rem 1.5rem;
    border-radius: 0.375rem;
    display: flex;
    align-items: center;
    gap: 0.625rem;
    transition: all 0.2s ease;
    font-size: 0.875rem;
    font-weight: 400;
    letter-spacing: 0.02em;
    border: 1px solid transparent;
    font-family: 'BBH Bartle', 'Exo 2', sans-serif;
    text-transform: uppercase;
}

.nav-icon {
    width: 1rem;
    height: 1rem;
    stroke-width: 2;
}

.nav-link:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: var(--border-primary);
}

.nav-link.active {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}

/* Main Content */
.main-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2.5rem 3rem;
}

/* Chat Container */
.chat-container {
    max-width: 900px;
    margin: 0 auto;
    height: calc(100vh - 180px);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.chat-header {
    padding: 2rem;
    background: var(--bg-secondary);
    border-radius: 0.5rem;
    border: 1px solid var(--border-primary);
}

.stats-bar {
    display: flex;
    gap: 4rem;
    justify-content: center;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.375rem;
}

.stat-label {
    font-size: 0.6875rem;
    color: var(--text-tertiary);
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--accent-primary);
    font-family: 'Exo 2', sans-serif;
    line-height: 1;
    animation: countUp 0.5s ease-out;
}

@keyframes countUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Chat Messages */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.message {
    display: flex;
    gap: 1.25rem;
    animation: messageSlide 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes messageSlide {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 0.375rem;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 1px solid var(--border-primary);
}

.message-avatar svg {
    width: 1.25rem;
    height: 1.25rem;
    stroke: var(--text-secondary);
    stroke-width: 2;
}

.message.user .message-avatar {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
}

.message.user .message-avatar svg {
    stroke: white;
}

.message-content {
    background: var(--bg-secondary);
    padding: 1.5rem;
    border-radius: 0.5rem;
    flex: 1;
    border: 1px solid var(--border-primary);
}

.message-content p {
    margin-bottom: 0.875rem;
    line-height: 1.65;
    font-size: 0.9375rem;
}

.message-content p:last-child {
    margin-bottom: 0;
}

.message-content a {
    color: var(--accent-primary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.message-content a:hover {
    color: var(--accent-secondary);
}

.success-message {
    color: #00d9a3 !important;
}

.error-message {
    color: #ff4757 !important;
}

.info-box {
    background: var(--bg-elevated);
    border: 1px solid var(--border-primary);
    border-radius: 0.5rem;
    padding: 1.25rem;
    margin: 1.5rem 0;
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.info-box svg {
    color: var(--accent-primary);
    margin-top: 0.125rem;
}

.info-box p {
    margin: 0.5rem 0;
    font-size: 0.875rem;
    line-height: 1.6;
}

.info-box p:first-child {
    margin-top: 0;
}

.info-box strong {
    color: var(--accent-primary);
    font-weight: 600;
}

.examples {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-secondary);
}

.examples-title {
    font-size: 0.6875rem;
    color: var(--text-tertiary);
    margin-bottom: 1rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.example-url {
    background: var(--bg-elevated);
    padding: 1.125rem 1.25rem;
    border-radius: 0.375rem;
    font-size: 0.8125rem;
    color: var(--accent-primary);
    cursor: pointer;
    margin-top: 0.75rem;
    transition: all 0.2s ease;
    border: 1px solid var(--border-secondary);
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-weight: 500;
}

.example-url:hover {
    background: var(--bg-tertiary);
    border-color: var(--accent-primary);
    transform: translateX(4px);
}

.loading-dots {
    display: flex;
    gap: 0.5rem;
    padding: 0.75rem 0;
}

.loading-dots span {
    width: 6px;
    height: 6px;
    border-radius: 1px;
    background: var(--accent-primary);
    animation: dotPulse 1.4s infinite ease-in-out both;
}

.loading-dots span:nth-child(1) { animation-delay: -0.32s; }
.loading-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes dotPulse {
    0%, 80%, 100% {
        transform: scale(0);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Chat Input */
.chat-input-container {
    padding: 0;
}

.input-mode-toggle {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.mode-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 0.375rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Exo 2', sans-serif;
}

.mode-btn:hover {
    background: var(--bg-tertiary);
    border-color: var(--accent-primary);
}

.mode-btn.active {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}

.chat-input-wrapper {
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    padding: 0.5rem;
    transition: all 0.2s ease;
}

.chat-input-wrapper:focus-within {
    border-color: var(--accent-primary);
    background: var(--bg-tertiary);
}

.chat-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 0.9375rem;
    padding: 0.875rem 1rem;
    font-family: 'Inter', sans-serif;
    resize: none;
}

.bulk-input {
    min-height: 120px;
    line-height: 1.6;
}

.bulk-send {
    align-self: flex-end;
}

.chat-input::placeholder {
    color: var(--text-tertiary);
}

.send-button {
    background: var(--accent-primary);
    border: none;
    border-radius: 0.375rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    color: white;
    position: relative;
    overflow: hidden;
}

.send-button::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transform: translateX(-100%);
}

.send-button:hover::before {
    animation: buttonShine 0.6s ease;
}

.send-button:hover {
    background: var(--accent-secondary);
    transform: scale(1.1) rotate(5deg);
}

.send-button:active {
    transform: scale(0.9) rotate(0deg);
}

@keyframes buttonShine {
    to {
        transform: translateX(100%);
    }
}

.input-hint {
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin-top: 1rem;
    letter-spacing: 0.01em;
}

/* Progress Tracking */
.progress-container {
    background: var(--bg-elevated);
    border: 1px solid var(--border-primary);
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin: 1rem 0;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.progress-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
}

.progress-percentage {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--accent-primary);
}

.progress-bar {
    width: 100%;
    height: 10px;
    background: var(--bg-secondary);
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    border-radius: 5px;
    transition: width 0.3s ease;
    animation: progressPulse 2s ease-in-out infinite;
}

.progress-fill.searching {
    width: 100%;
    background: linear-gradient(90deg, 
        var(--bg-secondary) 0%, 
        var(--accent-primary) 50%, 
        var(--bg-secondary) 100%);
    background-size: 200% 100%;
    animation: searchingAnimation 1.5s ease-in-out infinite;
}

@keyframes progressPulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.85;
    }
}

@keyframes searchingAnimation {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.progress-images-count {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    background: var(--bg-secondary);
    border-radius: 0.375rem;
    font-size: 0.875rem;
}

.images-label {
    color: var(--text-secondary);
    font-weight: 500;
}

.images-value {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 1rem;
}

.images-percentage {
    color: var(--accent-primary);
    font-weight: 600;
    margin-left: auto;
}

.progress-status {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0.5rem 0;
    line-height: 1.5;
}

.progress-images {
    font-size: 0.8125rem;
    color: var(--text-tertiary);
    margin: 0.25rem 0;
}

/* Library */
.library-container {
    max-width: 1600px;
}

.library-header {
    margin-bottom: 3rem;
}

.library-header h1 {
    margin-bottom: 2rem;
    font-family: 'Exo 2', sans-serif;
    font-weight: 700;
    font-size: 2.5rem;
    letter-spacing: -0.04em;
    display: flex;
    align-items: center;
    gap: 1.125rem;
    animation: titleSlide 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes titleSlide {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.header-icon {
    width: 2.5rem;
    height: 2.5rem;
    stroke: var(--accent-primary);
    stroke-width: 2;
    animation: iconFloat 3s ease-in-out infinite;
}

@keyframes iconFloat {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-8px);
    }
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
}

.stat-card {
    background: var(--bg-secondary);
    padding: 2rem;
    border-radius: 0.5rem;
    text-align: center;
    border: 1px solid var(--border-primary);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    animation: cardFadeIn 0.5s ease-out backwards;
}

.stat-card:nth-child(1) { animation-delay: 0.1s; }
.stat-card:nth-child(2) { animation-delay: 0.2s; }
.stat-card:nth-child(3) { animation-delay: 0.3s; }
.stat-card:nth-child(4) { animation-delay: 0.4s; }

.stat-card:hover {
    border-color: var(--accent-primary);
    background: var(--bg-tertiary);
    transform: translateY(-8px) scale(1.02);
}

@keyframes cardFadeIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stat-card-value {
    font-size: 3rem;
    font-weight: 700;
    color: var(--accent-primary);
    margin-bottom: 0.5rem;
    font-family: 'Exo 2', sans-serif;
    line-height: 1;
}

.stat-card-label {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    font-weight: 500;
    letter-spacing: 0.02em;
}

/* Filters */
.library-filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.search-wrapper {
    flex: 1;
    position: relative;
}

.search-icon {
    position: absolute;
    left: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1rem;
    height: 1rem;
    stroke: var(--text-tertiary);
    pointer-events: none;
    stroke-width: 2;
}

.search-input,
.filter-select {
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    color: var(--text-primary);
    padding: 1rem 1.25rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    outline: none;
    transition: all 0.2s ease;
    font-family: 'Inter', sans-serif;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238a8a8a' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 3rem;
}

.filter-select {
    cursor: pointer;
}

.search-input {
    width: 100%;
    padding-left: 3rem;
}

.search-input:focus,
.filter-select:focus {
    border-color: var(--accent-primary);
    background: var(--bg-tertiary);
    animation: inputFocus 0.3s ease;
}

@keyframes inputFocus {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.02);
    }
    100% {
        transform: scale(1);
    }
}

/* Chapters Grid */
.chapters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 1rem;
}

.chapter-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 0.5rem;
    padding: 1.75rem;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    animation: cardSlideIn 0.4s ease-out backwards;
}

.chapter-card:nth-child(1) { animation-delay: 0.05s; }
.chapter-card:nth-child(2) { animation-delay: 0.1s; }
.chapter-card:nth-child(3) { animation-delay: 0.15s; }
.chapter-card:nth-child(4) { animation-delay: 0.2s; }
.chapter-card:nth-child(5) { animation-delay: 0.25s; }
.chapter-card:nth-child(6) { animation-delay: 0.3s; }

.chapter-card:hover {
    border-color: var(--accent-primary);
    background: var(--bg-tertiary);
    transform: translateY(-8px) scale(1.02);
}

/* Site-specific hover colors for chapter cards */
.chapter-card[data-site="evascans"]:hover,
.chapter-card[data-site="evas"]:hover {
    border-color: var(--eva-color);
}

.chapter-card[data-site="fairyscans"]:hover,
.chapter-card[data-site="fairy"]:hover {
    border-color: var(--fairy-color);
}

.chapter-card[data-site="violetscans"]:hover,
.chapter-card[data-site="violet"]:hover {
    border-color: var(--violet-color);
}

@keyframes cardSlideIn {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.chapter-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.site-badge {
    background: var(--accent-primary);
    color: white;
    padding: 0.375rem 0.875rem;
    border-radius: 0.25rem;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    font-family: 'Changa One', sans-serif;
}

/* Site-specific badge colors */
.site-badge[data-site="evascans"],
.site-badge[data-site="evas"] {
    background: var(--eva-color);
}

.site-badge[data-site="fairyscans"],
.site-badge[data-site="fairy"] {
    background: var(--fairy-color);
}

.site-badge[data-site="violetscans"],
.site-badge[data-site="violet"] {
    background: var(--violet-color);
}

.chapter-date {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}

.chapter-card-body {
    margin-bottom: 1.5rem;
}

.chapter-title {
    font-size: 1.0625rem;
    margin-bottom: 0.625rem;
    line-height: 1.4;
    font-weight: 600;
    letter-spacing: -0.015em;
}

.chapter-number {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.chapter-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border-secondary);
    gap: 0.75rem;
}

.chapter-card-footer .image-count {
    flex: 1;
}

.chapter-card-footer > button {
    flex-shrink: 0;
    margin-left: 0;
}

.image-count {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
}

.image-count svg {
    width: 0.875rem;
    height: 0.875rem;
    stroke: var(--text-tertiary);
    stroke-width: 2;
}

.open-folder-btn {
    background: var(--bg-elevated);
    border: 1px solid var(--border-primary);
    color: var(--text-primary);
    padding: 0.625rem 1rem;
    border-radius: 0.375rem;
    cursor: pointer;
    font-size: 0.8125rem;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    font-family: 'Changa One', sans-serif;
    letter-spacing: 0.02em;
}

.open-folder-btn svg {
    width: 0.875rem;
    height: 0.875rem;
    stroke-width: 2;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.open-folder-btn:hover {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
    transform: scale(1.05);
}

.open-folder-btn:hover svg {
    transform: translateX(3px);
}

.open-folder-btn:disabled,
.download-zip-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: rgba(255, 255, 255, 0.01);
    pointer-events: none;
}

.download-zip-btn {
    background: var(--bg-elevated);
    border: 1px solid var(--border-primary);
    color: var(--text-primary);
    padding: 0.625rem 1rem;
    border-radius: 0.375rem;
    cursor: pointer;
    font-size: 0.8125rem;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    font-family: 'Changa One', sans-serif;
    letter-spacing: 0.02em;
}

.download-zip-btn svg {
    width: 0.875rem;
    height: 0.875rem;
    stroke-width: 2;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.download-zip-btn:hover {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
    transform: scale(1.05);
}

.download-zip-btn:hover svg {
    transform: translateY(3px);
}

.download-zip-main-btn {
    background: var(--accent-primary);
    color: white;
    border: none;
    border-radius: 0.5rem;
    padding: 1.25rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    font-family: 'Exo 2', sans-serif;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin: 1.5rem auto;
    max-width: 400px;
}

.download-zip-main-btn:hover {
    background: var(--accent-secondary);
    transform: translateY(-2px);
}

.download-zip-main-btn:active {
    transform: translateY(0);
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
    .nav-container {
        padding: 1rem 1.5rem;
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav-brand {
        font-size: 1rem;
    }
    
    .nav-links {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
    }
    
    .nav-link {
        justify-content: center;
        font-size: 0.8125rem;
        padding: 0.75rem 0.5rem;
    }
    
    .chat-container {
        padding: 1rem;
        max-width: 100%;
    }
    
    .stats-bar {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .chat-messages {
        max-height: 50vh;
    }
    
    .message {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .message-avatar {
        margin-bottom: 0.5rem;
    }
    
    .example-url {
        font-size: 0.75rem;
        padding: 0.875rem 1rem;
        word-break: break-all;
    }
    
    .input-mode-toggle {
        flex-direction: column;
    }
    
    .mode-btn {
        width: 100%;
    }
    
    .bulk-input {
        min-height: 100px;
    }
    
    .library-header h1 {
        font-size: 1.5rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
    }
    
    .stat-card-value {
        font-size: 1.75rem;
    }
    
    .library-filters {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .search-wrapper,
    .filter-select {
        width: 100%;
    }
    
    .chapters-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .chapter-card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .chapter-card-footer {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }
    
    .chapter-card-footer .image-count {
        text-align: center;
    }
    
    .open-folder-btn,
    .download-zip-btn {
        width: 100%;
        justify-content: center;
    }
    
    .access-popup-content {
        padding: 2rem 1.5rem;
        margin: 1rem;
    }
    
    .info-box {
        flex-direction: column;
        padding: 1rem;
    }
    
    .progress-container {
        padding: 1rem;
    }
    
    .progress-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .download-zip-main-btn {
        width: 100%;
        font-size: 0.9375rem;
        padding: 1rem 1.5rem;
    }
}

@media (max-width: 480px) {
    .nav-brand {
        font-size: 0.875rem;
    }
    
    .nav-link {
        font-size: 0.75rem;
        padding: 0.625rem 0.5rem;
        gap: 0.25rem;
    }
    
    .nav-icon {
        width: 0.875rem;
        height: 0.875rem;
    }
    
    .chat-container {
        padding: 0.75rem;
    }
    
    .message-content {
        font-size: 0.875rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .chapter-title {
        font-size: 1rem;
    }
    
    .access-popup-title {
        font-size: 1.25rem;
    }
}

/* Empty State */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 6rem 2rem;
}

.empty-icon {
    width: 5rem;
    height: 5rem;
    margin: 0 auto 2rem;
    stroke: var(--text-tertiary);
    opacity: 0.4;
    stroke-width: 1.5;
    animation: emptyBounce 2s ease-in-out infinite;
}

@keyframes emptyBounce {
    0%, 100% {
        transform: translateY(0);
        opacity: 0.4;
    }
    50% {
        transform: translateY(-15px);
        opacity: 0.6;
    }
}

.empty-state h2 {
    margin-bottom: 0.75rem;
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.empty-state p {
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
    font-size: 1rem;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
    background: var(--accent-primary);
    color: white;
    padding: 1rem 1.75rem;
    border-radius: 0.375rem;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    font-weight: 600;
    font-size: 0.9375rem;
    letter-spacing: 0.02em;
    border: 1px solid var(--accent-primary);
    font-family: 'Changa One', sans-serif;
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transform: translateX(-100%);
}

.btn-primary:hover::before {
    animation: buttonShine 0.6s ease;
}

.btn-primary svg {
    width: 1.125rem;
    height: 1.125rem;
    stroke-width: 2;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.btn-primary:hover {
    background: var(--accent-secondary);
    border-color: var(--accent-secondary);
    transform: translateY(-4px) scale(1.05);
}

.btn-primary:hover svg {
    transform: translateX(4px);
}

.btn-primary:active {
    transform: translateY(-2px) scale(1);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 2px;
    border: 3px solid var(--bg-primary);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--bg-elevated);
}

/* Responsive */
@media (max-width: 1024px) {
    .nav-container,
    .main-content {
        padding-left: 2rem;
        padding-right: 2rem;
    }
}

@media (max-width: 768px) {
    .nav-container,
    .main-content {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .library-header h1 {
        font-size: 2rem;
    }
    
    .stat-card {
        padding: 1.5rem;
    }
    
    .chapters-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-bar {
        gap: 2rem;
    }
}
