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

:root {
    --primary-color: #6B46C1;
    --primary-dark: #553C9A;
    --text-color: #1a1a1a;
    --text-light: #666;
    --background: #ffffff;
    --background-alt: #f8f9fa;
    --border-color: #e1e4e8;
    --max-width: 800px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background);
}

/* Header and Navigation */
header {
    background-color: var(--background);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.nav-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 1rem 2rem;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: var(--primary-color);
}

.nav-links a.active {
    color: var(--primary-color);
}

/* Main Content */
main {
    min-height: calc(100vh - 200px);
}

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 2rem;
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 3rem 0 2rem;
}

.logo-container {
    margin-bottom: 2rem;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo {
    max-width: 200px;
    height: auto;
    border-radius: 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.hero h1 {
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.tagline {
    font-size: 1.5rem;
    color: var(--text-light);
    font-weight: 300;
}

/* Content Section */
.content {
    padding: 2rem 0 4rem;
}

.app-description h2 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    color: var(--text-color);
}

.app-description h3 {
    font-size: 1.5rem;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.app-description p {
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    color: var(--text-color);
}

.features {
    list-style: none;
    margin: 1.5rem 0;
}

.features li {
    padding: 0.75rem 0;
    font-size: 1.1rem;
    color: var(--text-color);
    border-bottom: 1px solid var(--border-color);
}

.features li:last-child {
    border-bottom: none;
}

.features strong {
    color: var(--primary-color);
}

/* Call to Action */
.cta {
    margin-top: 3rem;
    text-align: center;
}

.app-store-button {
    display: inline-block;
    background-color: var(--primary-color);
    color: white;
    padding: 1rem 2.5rem;
    border-radius: 12px;
    text-decoration: none;
    font-size: 1.2rem;
    font-weight: 600;
    transition: background-color 0.3s ease, transform 0.2s ease;
    box-shadow: 0 4px 12px rgba(107, 70, 193, 0.3);
}

.app-store-button:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(107, 70, 193, 0.4);
}

/* Privacy Policy Styles */
.privacy-content {
    padding: 3rem 0;
}

.privacy-content h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.privacy-content h2 {
    font-size: 1.8rem;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.privacy-content h3 {
    font-size: 1.3rem;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    color: var(--text-color);
}

.privacy-content p,
.privacy-content ul {
    margin-bottom: 1.25rem;
    font-size: 1.05rem;
    color: var(--text-color);
}

.privacy-content ul {
    padding-left: 2rem;
}

.privacy-content li {
    margin-bottom: 0.75rem;
}

.privacy-content a {
    color: var(--primary-color);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s ease;
}

.privacy-content a:hover {
    border-bottom-color: var(--primary-color);
}

.last-updated {
    color: var(--text-light);
    font-style: italic;
    font-size: 0.95rem;
}

/* Footer */
footer {
    background-color: var(--background-alt);
    border-top: 1px solid var(--border-color);
    padding: 2rem 0;
    margin-top: 4rem;
}

footer .container {
    text-align: center;
}

footer p {
    color: var(--text-light);
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
}

footer a {
    color: var(--primary-color);
    text-decoration: none;
    transition: opacity 0.3s ease;
}

footer a:hover {
    opacity: 0.7;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 1.5rem;
    }

    .nav-container {
        padding: 1rem 1.5rem;
    }

    .hero h1 {
        font-size: 2.5rem;
    }

    .tagline {
        font-size: 1.25rem;
    }

    .app-description h2 {
        font-size: 1.75rem;
    }

    .app-description h3 {
        font-size: 1.3rem;
    }

    .app-description p,
    .features li {
        font-size: 1rem;
    }

    .logo-container {
        min-height: 150px;
    }

    .logo {
        max-width: 150px;
    }

    .app-store-button {
        font-size: 1.1rem;
        padding: 0.875rem 2rem;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 2rem;
    }

    .nav-links {
        gap: 1rem;
    }

    .logo-container {
        min-height: 120px;
    }

    .logo {
        max-width: 120px;
    }
}

/* =====================================================
   USER AUTHENTICATION STYLES
   ===================================================== */

.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    padding: 2rem;
}

.auth-card {
    max-width: 450px;
    width: 100%;
    background: white;
    border-radius: 12px;
    padding: 2.5rem;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-header h1 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.auth-header p {
    color: var(--text-light);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-color);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 1rem;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(107, 70, 193, 0.1);
}

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

.form-group small {
    display: block;
    margin-top: 0.25rem;
    color: var(--text-light);
    font-size: 0.85rem;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.checkbox-group input[type="checkbox"] {
    width: auto;
}

.checkbox-group label {
    margin: 0;
}

.password-strength {
    height: 4px;
    background: var(--border-color);
    border-radius: 2px;
    margin-top: 0.5rem;
    overflow: hidden;
}

.password-strength-bar {
    height: 100%;
    transition: width 0.3s ease, background-color 0.3s ease;
}

.password-strength-bar.weak {
    width: 33%;
    background: #dc3545;
}

.password-strength-bar.medium {
    width: 66%;
    background: #ffc107;
}

.password-strength-bar.strong {
    width: 100%;
    background: #28a745;
}

.password-hint {
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

.password-hint.weak {
    color: #dc3545;
}

.password-hint.medium {
    color: #f90;
}

.password-hint.strong {
    color: #28a745;
}

.btn-submit {
    width: 100%;
    padding: 0.875rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
}

.btn-submit:hover {
    background: var(--primary-dark);
}

.btn-submit:disabled {
    background: var(--border-color);
    cursor: not-allowed;
}

.auth-links {
    text-align: center;
    margin-top: 1.5rem;
}

.auth-links a {
    color: var(--primary-color);
    text-decoration: none;
}

.auth-links a:hover {
    text-decoration: underline;
}

/* =====================================================
   BUTTONS AND ACTIONS
   ===================================================== */

.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    display: inline-block;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    font-family: inherit;
}

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

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

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

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

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #218838;
}

.btn-small {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
    border-radius: 4px;
}

.btn-continue {
    background: #28a745;
    color: white;
}

.btn-continue:hover {
    background: #218838;
}

.btn-read {
    background: var(--background);
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

/* =====================================================
   MESSAGES AND ALERTS
   ===================================================== */

.message {
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
}

.message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.message.info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.message.warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

/* =====================================================
   BADGES AND LABELS
   ===================================================== */

.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.badge-free {
    background: #e9ecef;
    color: #495057;
}

.badge-pro {
    background: var(--primary-color);
    color: white;
}

.badge-success {
    background: #28a745;
    color: white;
}

.badge-failed {
    background: #dc3545;
    color: white;
}

.badge-pending {
    background: #ffc107;
    color: #000;
}

.badge-inactive {
    background: #dc3545;
    color: white;
}

.badge-public {
    background: #28a745;
    color: white;
}

.badge-private {
    background: #6c757d;
    color: white;
}

.progress-badge {
    background: #28a745;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    margin-left: 0.5rem;
}

/* =====================================================
   PRICING PAGE
   ===================================================== */

.pricing-hero {
    text-align: center;
    padding: 3rem 2rem 2rem;
    background: linear-gradient(135deg, rgba(107, 70, 193, 0.1), rgba(85, 60, 154, 0.1));
}

.pricing-hero h1 {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.pricing-hero p {
    font-size: 1.2rem;
    color: var(--text-light);
}

.pricing-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 2rem 4rem;
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.pricing-card {
    background: var(--background-alt);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.pricing-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}

.pricing-card.featured {
    border-color: var(--primary-color);
    background: white;
    box-shadow: 0 4px 16px rgba(107, 70, 193, 0.2);
}

.pricing-card.featured .popular-badge {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

.pricing-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.pricing-card .price {
    font-size: 3rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.pricing-card .price-period {
    color: var(--text-light);
    font-size: 1rem;
}

.pricing-features {
    list-style: none;
    margin: 2rem 0;
    text-align: left;
}

.pricing-features li {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
}

.pricing-features li:last-child {
    border-bottom: none;
}

.pricing-features li:before {
    content: "✓ ";
    color: var(--primary-color);
    font-weight: bold;
    margin-right: 0.5rem;
}

.pricing-card .btn {
    width: 100%;
    margin-top: 1rem;
}

.comparison-note {
    text-align: center;
    margin-top: 2rem;
    padding: 1rem;
    background: var(--background-alt);
    border-radius: 8px;
    color: var(--text-light);
}

/* =====================================================
   USER DASHBOARD (MY BOOKS, ACCOUNT)
   ===================================================== */

.page-header {
    background: var(--background-alt);
    padding: 2rem;
    margin-bottom: 2rem;
    border-radius: 12px;
}

.page-header h1 {
    margin-bottom: 0.5rem;
}

.page-header .user-info {
    color: var(--text-light);
}

.action-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

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

.book-card {
    background: var(--background-alt);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.book-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
}

.book-cover {
    width: 100%;
    height: 200px;
    border-radius: 8px;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 3rem;
}

.book-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

.book-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.book-author {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 0.5rem;
}

.book-meta {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 1rem;
}

.book-actions {
    display: flex;
    gap: 0.5rem;
    flex-direction: column;
}

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-light);
}

.empty-state h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.pro-banner {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.pro-banner-content h3 {
    margin-bottom: 0.5rem;
}

.usage-badge {
    display: inline-block;
    background: rgba(255,255,255,0.2);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.9rem;
}

.card {
    background: var(--background-alt);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
}

.card h2 {
    margin-bottom: 1.5rem;
    color: var(--primary-color);
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
}

.info-row:last-child {
    border-bottom: none;
}

.usage-bar {
    background: var(--border-color);
    border-radius: 10px;
    height: 20px;
    overflow: hidden;
    margin-top: 0.5rem;
}

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

.activity-item {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
}

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

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

.account-container {
    max-width: 900px;
    margin: 2rem auto;
    padding: 0 2rem;
}

.account-grid {
    display: grid;
    gap: 2rem;
}

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

/* =====================================================
   SUBSCRIPTION PAGES
   ===================================================== */

.success-container,
.cancel-container {
    max-width: 600px;
    margin: 4rem auto;
    padding: 2rem;
}

.success-card,
.cancel-card {
    background: var(--background-alt);
    padding: 3rem 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    text-align: center;
}

.success-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.success-card h1,
.cancel-card h1 {
    margin-bottom: 1rem;
}

.cancel-card h1 {
    color: #c33;
    text-align: left;
}

.success-card h1 {
    color: var(--primary-color);
}

.success-card p,
.cancel-card p {
    color: var(--text-light);
    margin-bottom: 2rem;
}

.cancel-card p {
    text-align: left;
}

.warning-box {
    background: #fff3cd;
    border-left: 4px solid #f90;
    padding: 1rem;
    margin: 1.5rem 0;
    text-align: left;
}

.warning-box h3 {
    margin-bottom: 0.5rem;
}

.warning-box ul {
    margin-left: 1.5rem;
}

.button-group {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.security-notice {
    background: #fff3cd;
    border-left: 4px solid #f90;
    padding: 0.75rem;
    margin-top: 1.5rem;
    font-size: 0.85rem;
    color: #856404;
}

/* =====================================================
   ADMIN STYLES
   ===================================================== */

.admin-header {
    background: var(--primary-color);
    color: white;
    padding: 1rem 0;
    margin-bottom: 2rem;
}

.admin-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

.admin-nav h1 {
    margin: 0;
    font-size: 1.5rem;
}

.admin-nav .nav-links {
    display: flex;
    gap: 1.5rem;
}

.admin-nav .nav-links a {
    color: white;
    text-decoration: none;
    font-weight: 500;
}

.admin-nav .nav-links a:hover {
    text-decoration: underline;
}

.admin-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem 4rem 2rem;
}

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

.stat-card {
    background: var(--background-alt);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

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

.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.action-btn {
    display: block;
    padding: 1rem;
    background: var(--primary-color);
    color: white;
    text-align: center;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: background 0.3s ease;
}

.action-btn:hover {
    background: var(--primary-dark);
}

.action-btn.secondary {
    background: var(--background);
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

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

.filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    align-items: center;
}

.filter-btn {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    background: var(--background-alt);
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    color: var(--text-color);
    transition: all 0.3s ease;
}

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

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

.search-box {
    flex: 1;
    max-width: 500px;
}

.search-box input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
}

.users-table,
.books-table,
.payments-table {
    background: var(--background-alt);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 2rem;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    background: var(--primary-color);
    color: white;
    padding: 1rem;
    text-align: left;
    font-weight: 600;
}

td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

tr:last-child td {
    border-bottom: none;
}

tr:hover {
    background: rgba(0,0,0,0.02);
}

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

.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2rem;
}

.pagination a {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    text-decoration: none;
    color: var(--text-color);
}

.pagination a:hover {
    background: var(--background-alt);
}

.pagination a.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.back-link {
    margin-bottom: 1rem;
}

.back-link a {
    color: var(--primary-color);
    text-decoration: none;
}

.back-link a:hover {
    text-decoration: underline;
}

.admin-badge {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

/* =====================================================
   READER STYLES
   ===================================================== */

.reader-container {
    max-width: 800px;
    margin: 2rem auto;
    padding: 0 2rem;
}

.reader-header {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

.reader-title {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.reader-author {
    color: var(--text-light);
    font-size: 1.1rem;
}

.chapter-selector {
    margin-bottom: 2rem;
}

.chapter-selector select {
    width: 100%;
    max-width: 400px;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 1rem;
}

.chapter-title {
    margin: 2rem 0 1rem 0;
    color: var(--text-color);
}

.toggle-view {
    margin-bottom: 2rem;
}

.toggle-btn {
    padding: 0.5rem 1rem;
    background: var(--background-alt);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    color: var(--text-color);
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

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

.chunk {
    background: var(--background-alt);
    padding: 1.5rem;
    margin-bottom: 1rem;
    border-radius: 8px;
    line-height: 1.8;
    font-size: 1.1rem;
}

.chunk-original {
    padding: 1.5rem;
    line-height: 1.8;
    font-size: 1.05rem;
}

.navigation {
    display: flex;
    justify-content: space-between;
    margin: 3rem 0 2rem 0;
    gap: 1rem;
}

.nav-btn {
    padding: 0.75rem 1.5rem;
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 500;
    transition: background 0.3s ease;
}

.nav-btn:hover {
    background: var(--primary-dark);
}

.resume-banner {
    background: #fff3cd;
    border-left: 4px solid #f90;
    padding: 1rem;
    margin-bottom: 2rem;
    border-radius: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.resume-banner-content {
    flex: 1;
}

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

.resume-btn,
.dismiss-btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

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

.resume-btn:hover {
    background: var(--primary-dark);
}

.dismiss-btn {
    background: white;
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

.dismiss-btn:hover {
    background: var(--background-alt);
}

.progress-indicator {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--primary-color);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.progress-indicator.show {
    opacity: 1;
}

/* =====================================================
   OLD ADMIN LOGIN (login.php) STYLES
   ===================================================== */

.login-container {
    max-width: 400px;
    margin: 4rem auto;
    padding: 2rem;
    background: var(--background-alt);
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.login-container h1 {
    text-align: center;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
}

.login-card {
    background: white;
    padding: 2rem;
    border-radius: 12px;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.submit-btn {
    width: 100%;
    padding: 0.75rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
}

.submit-btn:hover {
    background: var(--primary-dark);
}

.error {
    background: #f8d7da;
    color: #721c24;
    padding: 0.75rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

/* =====================================================
   BATCH UPLOAD & CREATE BOOK STYLES
   ===================================================== */

.batch-container {
    max-width: 900px;
    margin: 2rem auto;
    padding: 0 2rem;
}

.upload-section {
    background: var(--background-alt);
    padding: 2rem;
    border-radius: 12px;
    margin-bottom: 2rem;
}

.upload-form {
    margin-top: 1rem;
}

.upload-btn {
    background: var(--primary-color);
    color: white;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.3s ease;
}

.upload-btn:hover {
    background: var(--primary-dark);
}

.form-section {
    background: var(--background-alt);
    padding: 2rem;
    border-radius: 12px;
    margin-bottom: 2rem;
}

.info-box {
    background: #d1ecf1;
    border-left: 4px solid #0c5460;
    padding: 1rem;
    margin-bottom: 2rem;
    border-radius: 6px;
    color: #0c5460;
}

.info-box strong {
    color: #0c5460;
}

.progress-container {
    text-align: center;
    padding: 3rem 2rem;
}

.progress-container h2 {
    color: var(--primary-color);
    margin: 1rem 0;
}

.progress-bar {
    background: var(--border-color);
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
    margin: 1rem auto;
    max-width: 400px;
}

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

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem auto;
}

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

.results {
    margin-top: 2rem;
}

.result-item {
    background: var(--background-alt);
    padding: 1rem;
    margin-bottom: 0.5rem;
    border-radius: 6px;
    border-left: 4px solid var(--border-color);
}

.result-item.success {
    border-left-color: #28a745;
}

.result-item.error {
    border-left-color: #dc3545;
}

.result-item.skipped {
    border-left-color: #ffc107;
    opacity: 0.7;
}

/* Additional button styles */
.back-btn,
.logout-btn {
    padding: 0.5rem 1rem;
    background: var(--background-alt);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    text-decoration: none;
    color: var(--text-color);
    transition: all 0.3s ease;
}

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

.action-links {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.action-links a {
    color: var(--primary-color);
    text-decoration: none;
}

.action-links a:hover {
    text-decoration: underline;
}

/* Additional missing classes */
.create-container {
    max-width: 900px;
    margin: 2rem auto;
    padding: 0 2rem;
}

.book-info {
    background: var(--background-alt);
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.activity-log {
    background: var(--background-alt);
    padding: 1.5rem;
    border-radius: 8px;
    margin-top: 2rem;
}

.activity-log h3 {
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.delete-link {
    color: #dc3545;
    text-decoration: none;
    font-weight: 500;
}

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

.currency {
    font-size: 0.8em;
    vertical-align: super;
}

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

/* =====================================================
   RESPONSIVE ADJUSTMENTS
   ===================================================== */

@media (max-width: 768px) {
    .auth-container {
        padding: 1rem;
    }

    .auth-card {
        padding: 2rem 1.5rem;
    }

    .pricing-grid {
        grid-template-columns: 1fr;
    }

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

    .form-grid {
        grid-template-columns: 1fr;
    }

    .action-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .pro-banner {
        flex-direction: column;
        text-align: center;
    }

    .admin-nav {
        flex-direction: column;
        gap: 1rem;
    }

    .admin-nav .nav-links {
        flex-wrap: wrap;
        justify-content: center;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    .filters {
        flex-direction: column;
        align-items: stretch;
    }

    .search-box {
        max-width: 100%;
    }

    .users-table,
    .books-table,
    .payments-table {
        overflow-x: auto;
    }

    table {
        min-width: 600px;
    }

    .reader-container {
        padding: 0 1rem;
    }

    .reader-title {
        font-size: 1.5rem;
    }

    .chunk {
        padding: 1rem;
        font-size: 1rem;
    }

    .navigation {
        flex-direction: column;
    }

    .nav-btn {
        width: 100%;
        text-align: center;
    }

    .resume-banner {
        flex-direction: column;
        align-items: stretch;
    }

    .resume-banner-actions {
        justify-content: stretch;
    }

    .resume-btn,
    .dismiss-btn {
        flex: 1;
    }

    .progress-indicator {
        bottom: 1rem;
        right: 1rem;
        left: 1rem;
        text-align: center;
    }

    .login-container {
        margin: 2rem auto;
    }

    .batch-container {
        padding: 0 1rem;
    }
}

@media (max-width: 480px) {
    .book-cover {
        height: 150px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .stat-value {
        font-size: 2rem;
    }
}
