/* Additional Styles for Error Handling and Notifications */

/* Homepage Styles */
.homepage-hero {
    padding: 4rem 0 3rem;
    max-width: 600px;
    margin: 0 auto;
}

.homepage-hero h1 {
    font-size: 10rem;
    margin-bottom: 0px;
    line-height: 1;
}

.homepage-hero h3 {
    font-size: 2rem;
    margin-bottom: 1rem;
    line-height: 1.2;
    color: var(--secondary-color);
    font-weight: 400;
}

.homepage-hero p {
    margin-bottom: 2rem;
    line-height: 1.5;
    text-align: justify;
    font-size: var(--font-size);
}

.homepage-hero img {
    max-width: 100%;
    height: auto;
    margin: 0 0;
}

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

/* Hand-drawn border style */
.hand-drawn-border {
    border: 3px solid var(--border-color);
    border-bottom-left-radius: 225px 15px;
    border-bottom-right-radius: 15px 255px;
    border-top-left-radius: 15px 225px;
    border-top-right-radius: 255px 15px;
}

#checklist-1 {
    display: flex;
    margin-bottom: 1rem;
    align-items: center;
}

#checklist-2 {
    display: flex;
    padding-bottom: 2rem;
    align-items: center;
}

.checklist-icon {
    margin-right: 0.5rem;
    font-size: 1.3rem;
}

.checklist-text {
    flex-grow: 1;
    font-size: 1.1rem;
}

/* Access Progress Meter */
.access-meter {
    margin: 2rem 0;
    padding: 0.5rem;
    position: relative;
}

.access-meter-container {
    position: relative;
    height: 20px;
    background: rgba(0, 0, 0, 0.05);
    /* Much lighter background */
    border: 2px solid var(--border-color);
    border-radius: 15px 25px 20px 18px;
    /* Slightly irregular for hand-drawn feel */
    overflow: visible;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
    right: 0;
}

.access-meter-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--secondary-color) 0%, var(--primary-color) 100%);
    border-radius: 12px 20px 15px 14px;
    /* Matching irregular shape */
    transition: width 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    width: 0%;
    /* Default empty state */
    position: relative;
}

/* Runner overlay for access meter */

.access-meter-runner-overlay {
    position: absolute;
    top: -60px;
    left: 0;
    right: 0;
    width: 70px;
    height: auto;
    z-index: 3;
    pointer-events: none;
    transition: left 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Position runner for each state */
.access-meter.empty .access-meter-runner-overlay {
    left: -38px;
}

.access-meter.half .access-meter-runner-overlay {
    left: calc(50% - 38px);
}

.access-meter.full .access-meter-runner-overlay {
    left: calc(100% - 38px);
}

.runner-svg {
    display: block;
    overflow: visible;
}

.access-meter-fill::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    right: 2px;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 8px 15px 10px 9px;
}

/* Runner emoji overlays */


.access-meter-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 1rem;
    font-size: 0.8rem;
    color: var(--secondary-color);
    margin-left: -25px;
    margin-right: -25px;
}

.access-meter-label {
    font-family: var(--font-handwritten, 'Excalifont', cursive);
    font-size: 0.75rem;
}

/* Meter states */
.access-meter.empty .access-meter-fill {
    width: 0%;
}

.access-meter.half .access-meter-fill {
    width: 50%;
}

.access-meter.full .access-meter-fill {
    width: 100%;
}

.access-meter.full .access-meter-fill {
    background: linear-gradient(90deg, #22c55e 0%, #16a34a 100%);
}

.access-meter.full .access-meter-fill {
    background: linear-gradient(90deg, #22c55e 0%, #16a34a 100%);
}

/* Standard section container */
.section-container {
    max-width: 600px;
    margin: 3rem auto;
    padding: 2rem;
    background: var(--card-bg, var(--bg-color));
}

/* Section header styling */
.section-container h2 {
    text-align: left;
    margin-bottom: 1rem;
    color: var(--heading-color);
    font-size: 2rem;
}

.section-container h2 a {
    color: var(--heading-color);
    text-decoration: none;
}

.section-container h2 a:hover {
    color: var(--primary-color);
}

.section-container p {
    text-align: left;
    margin-bottom: 2rem;
    color: var(--text-color);
    opacity: 0.8;
    line-height: 1.6;
}

/* Quotes styling within sections */
.section-container blockquote {
    margin: 1.5rem 0;
    padding: 1rem 1.5rem;
    background: var(--quote-bg);
    border-left: 3px solid var(--primary-color);
    border-radius: 4px;
    position: relative;
}

.section-container blockquote p {
    margin: 0 0 0.5rem 0;
    font-style: italic;
    opacity: 1;
    line-height: 1.5;
}

.section-container blockquote cite {
    font-size: 0.9rem;
    color: var(--secondary-color);
    font-style: normal;
    font-weight: 500;
}

/* Site navigation for homepage */
.site-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
}

.site-title a {
    color: var(--text-color);
    text-decoration: none;
}

.main-nav {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.main-nav a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 400;
    /* transition: opacity 0.2s ease; */
}

.main-nav a:hover {
    opacity: 0.7;
}

.main-nav a.active {
    color: var(--primary-color);
    font-weight: 500;
}

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

    .homepage-hero {
        padding: 2rem 0;
    }

    .homepage-hero h1 {
        font-size: 7rem;
    }

    .section-container {
        padding: 1.5rem;
    }
}

/* Compact controls for very small screens */
@media (max-width: 480px) {
    .controls.compact .control-btn {
        padding: 6px 8px;
        font-size: 11px;
        min-width: 30px;
    }

    .controls.compact {
        gap: 3px;
    }

    .book-title {
        font-size: 1rem;
    }

    .header {
        height: 50px;
    }

    .main-content {
        margin-top: 50px;
    }

    .sidebar {
        top: 50px;
        height: calc(100vh - 50px);
    }
}

/* Print styles additions */
@media print {
    .chapter-content {
        font-size: 11pt;
        line-height: 1.4;
    }

    .chapter-content h1 {
        font-size: 18pt;
        margin-bottom: 12pt;
    }

    .chapter-content h2 {
        font-size: 14pt;
        margin: 12pt 0 8pt;
    }

    .chapter-content h3 {
        font-size: 12pt;
        margin: 10pt 0 6pt;
    }
}

/* Focus styles for better accessibility */
.control-btn:focus,
.nav-btn:focus,
.chapter-list a:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Selection styles */
::selection {
    background: var(--primary-color);
    color: white;
}

::-moz-selection {
    background: var(--primary-color);
    color: white;
}

/* Authentication Styles - using section-container base */

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.auth-form p {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0;
}

#paywall-subscribe-container {
    width: 100%;
}

#paywall-subscribe-btn {
    width: 100%;
}

.email-input {
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    background: var(--bg-color);
    color: var(--text-color);
    transition: border-color 0.2s ease;
}

.email-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74, 85, 104, 0.1);
}

.auth-status {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
}

.auth-status.info {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: #3b82f6;
}

.auth-status.success {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #22c55e;
}

.auth-status.error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

.auth-success p {
    width: 100%;
    margin: 2rem 0;
    font-size: 1.2rem;
    font-weight: 600;
}

.auth-success button {
    width: 100%;
}

.auth-login {
    margin-bottom: 2rem;
}

.hidden {
    display: none !important;
}

/* Locked Chapter Styles */
.chapter-locked {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
}

/* Chapter preview styled as regular content with fade effect */
.chapter-preview-container {
    position: relative;
    margin: 1rem 0 0 0;
}

.chapter-preview-text p {
    margin: 0;
    line-height: 1.7;
    color: var(--text-color);
    font-size: var(--font-size);
    text-align: justify;
}

.chapter-fade-overlay {
    position: absolute;
    bottom: 5px;
    left: 0;
    right: 0;
    height: 60px;
    background: linear-gradient(to bottom, transparent 0%, var(--bg-color) 100%);
    pointer-events: none;
}

.chapter-lock-notice {
    text-align: center;
    padding: 3rem 2rem;
    background: var(--card-bg, var(--bg-color));
    margin: 2rem 0;
}

.chapter-lock-notice h3 {
    margin-bottom: 1rem;
    color: var(--heading-color);
}

.chapter-lock-notice p {
    margin-bottom: 2rem;
    color: var(--text-color);
    opacity: 0.8;
    line-height: 1.6;
}

.chapter-auth-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 400px;
    margin: 0 auto 2rem;
}

.login-help {
    font-size: 0.9rem;
    color: var(--secondary-color);
    margin-bottom: 0 !important;
}

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

    .chapter-lock-notice {
        padding: 2rem 1rem;
        margin: 1rem 0;
    }

    .chapter-auth-form {
        max-width: none;
    }
}

/* Subscription Paywall Styles */
.chapter-subscription-notice {
    text-align: center;
    padding: 3rem 2rem;
    background: linear-gradient(135deg, var(--card-bg, var(--bg-color)) 0%, var(--quote-bg) 100%);
    margin: 2rem 0;
}

.icon {
    font-size: 3rem;
}

.chapter-subscription-notice h3 {
    margin-bottom: 1rem;
    color: var(--heading-color);
    font-size: 1.5rem;
}

.chapter-subscription-notice p {
    margin-bottom: 2rem;
    color: var(--text-color);
    opacity: 0.8;
    line-height: 1.6;
}

.subscription-actions {
    margin-top: 2rem;
}


@media (max-width: 768px) {
    .auth-form {
        gap: 0.75rem;
    }

    .email-input {
        padding: 0.875rem;
        font-size: 0.95rem;
    }

    .chapter-subscription-notice {
        padding: 2rem 1rem;
        margin: 1rem 0;
    }

}