/**
 * AIMangaMaker.com - Page Reader Styles
 * Styling for the manga/manhwa page reader
 */

 body {
    background-color: #1a1a1a;
    margin: 0;
    padding: 0;
    font-family: 'Roboto', sans-serif;
    color: #fff;
}

/* Reader Header */
.reader-header {
    background-color: #252525;
    padding: 10px 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 100;
}

.reader-header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    max-width: 1400px;
    margin: 0 auto;
}

.reader-title {
    display: flex;
    flex-direction: column;
}

.project-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

.project-title a {
    color: #fff;
    text-decoration: none;
    transition: color 0.2s;
}

.project-title a:hover {
    color: var(--primary-color);
}

.chapter-title {
    font-size: 14px;
    color: #bbb;
    margin: 5px 0 0;
}

.reader-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.page-info {
    font-size: 14px;
    color: #bbb;
}

.settings-button {
    background: none;
    border: none;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.settings-button:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.home-button {
    color: #fff;
    text-decoration: none;
    font-size: 16px;
    padding: 5px 10px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.home-button:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Reader Container */
.reader-container {
    max-width: 100%;
    margin: 0;
    padding: 0;
    min-height: calc(100vh - 170px);
}

/* Page Navigation */
.page-navigation {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.nav-buttons {
    display: flex;
    gap: 10px;
}

.nav-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    background-color: var(--text-color);
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.2s;
}

.nav-button:hover:not(.disabled) {
    background-color: var(--light-color);
}

.nav-button.disabled {
    background-color: #2a2a2a;
    color: var(--light-color);
    cursor: not-allowed;
}

.nav-button i {
    margin-right: 8px;
}

.nav-button.next i {
    margin-right: 0;
    margin-left: 8px;
}

.page-select {
    display: flex;
    align-items: center;
    background-color: var(--text-color);
    border-radius: 4px;
    padding: 5px 10px;
}

.page-select label {
    margin-right: 10px;
    font-size: 14px;
    color: #bbb;
}

.page-select select {
    background-color: var(--light-color);
    color: #fff;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    outline: none;
    font-size: 14px;
}

/* Page Display */
.page-display {
    text-align: center;
    margin: 0;
    padding: 0;
    position: relative;
    width: 100%;
}

/* Bottom Page Navigation */
.bottom-page-navigation {
    margin: 40px 0;
    text-align: center;
}

.bottom-nav-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.page-image {
    width: 100%;
    max-width: 900px; 
    margin: 0 auto; 
    border-radius: 0;
    box-shadow: none;
    display: block;
}

.page-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 24px;
    color: #aaa;
}

/* Reading Modes */
.reading-mode-standard .page-display {
    text-align: center;
}

.reading-mode-webtoon .page-display {
    max-width: 800px;
    margin: 0 auto;
}

.reading-mode-webtoon .page-image {
    max-height: none;
    width: 100%;
}

/* Page Navigation Overlays */
.page-overlay-nav {
    position: fixed;
    top: 0;
    bottom: 0;
    width: 20%;
    z-index: 10;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.page-overlay-nav:hover .overlay-arrow {
    opacity: 0.3;
}

.overlay-arrow {
    color: white;
    font-size: 48px;
    opacity: 0;
    transition: opacity 0.2s;
    background-color: rgba(0, 0, 0, 0.3);
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.page-overlay-prev {
    left: 0;
}

.page-overlay-next {
    right: 0;
}

/* Reader Footer */
.reader-footer {
    background-color: #252525;
    padding: 20px;
    text-align: center;
    margin-top: 40px;
}

.footer-navigation {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
}

.creator-credit {
    font-size: 14px;
    color: #bbb;
}

.creator-credit a {
    color: var(--primary-color);
    text-decoration: none;
}

.creator-credit a:hover {
    text-decoration: underline;
}

/* Settings Panel */
.settings-panel {
    position: fixed;
    top: 60px;
    right: 20px;
    width: 300px;
    background-color: var(--text-color);
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    z-index: 101;
    padding: 20px;
    transform: translateY(-10px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.settings-panel.active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
}

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

.settings-header h3 {
    margin: 0;
    font-size: 18px;
}

.close-settings {
    background: none;
    border: none;
    color: var(--light-color);
    font-size: 20px;
    cursor: pointer;
}

.close-settings:hover {
    color: #fff;
}

.settings-section {
    margin-bottom: 20px;
}

.settings-section h4 {
    margin: 0 0 10px;
    font-size: 16px;
    color: #ccc;
}

.reading-mode-options {
    display: flex;
    gap: 10px;
}

.mode-option {
    flex: 1;
    padding: 10px;
    background-color: var(--light-color);
    border-radius: 4px;
    text-align: center;
    cursor: pointer;
    transition: background-color 0.2s;
}

.mode-option.active {
    background-color: var(--primary-color);
}

.mode-option:hover:not(.active) {
    background-color: var(--light-color);
}

.theme-options {
    display: flex;
    gap: 10px;
}

.theme-option {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    position: relative;
    border: 2px solid transparent;
}

.theme-option.active {
    border-color: var(--primary-color);
}

.theme-option.light {
    background-color: var(--gray-200);
}

.theme-option.dark {
    background-color: #1a1a1a;
}

.theme-option.sepia {
    background-color: var(--gray-300);
}

.image-quality-slider {
    width: 100%;
}

/* Chapter List Panel */
.chapter-list-panel {
    position: fixed;
    top: 60px;
    left: 20px;
    width: 300px;
    max-height: 500px;
    overflow-y: auto;
    background-color: var(--text-color);
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    z-index: 101;
    padding: 20px;
    transform: translateY(-10px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.chapter-list-panel.active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
}

.chapter-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.chapter-list-header h3 {
    margin: 0;
    font-size: 18px;
}

.close-chapter-list {
    background: none;
    border: none;
    color: var(--light-color);
    font-size: 20px;
    cursor: pointer;
}

.close-chapter-list:hover {
    color: #fff;
}

.chapter-items {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chapter-item {
    padding: 10px;
    background-color: var(--light-color);
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.chapter-item.current {
    background-color: var(--primary-color);
}

.chapter-item:hover:not(.current) {
    background-color: var(--light-color);
}

.chapter-number {
    font-weight: 600;
    font-size: 14px;
}

.chapter-name {
    font-size: 14px;
    color: #ccc;
    margin-top: 3px;
}

/* Comments Section */
.comments-section {
    background-color: #252525;
    padding: 30px;
    border-radius: 8px;
    margin-top: 40px;
}

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

.comments-header h3 {
    margin: 0;
    font-size: 20px;
}

.comments-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.comment-item {
    background-color: #2a2a2a;
    border-radius: 8px;
    padding: 15px;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.comment-user {
    font-weight: 600;
}

.comment-date {
    font-size: 12px;
    color: var(--light-color);
}

.comment-content {
    color: #ddd;
    line-height: 1.5;
}

.add-comment-form {
    margin-top: 20px;
}

.add-comment-form textarea {
    width: 100%;
    height: 100px;
    padding: 15px;
    border-radius: 8px;
    background-color: #2a2a2a;
    border: 1px solid #444;
    color: #fff;
    font-family: inherit;
    resize: none;
    margin-bottom: 10px;
}

.comment-form-footer {
    display: flex;
    justify-content: flex-end;
}

/* Notification */
.notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: var(--text-color);
    color: white;
    padding: 15px 20px;
    border-radius: 4px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    transition: transform 0.3s, opacity 0.3s;
    transform: translateY(100px);
    opacity: 0;
}

.notification.active {
    transform: translateY(0);
    opacity: 1;
}

/* Progress Bar */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 4px;
    background-color: var(--primary-color);
    z-index: 1000;
    width: 0%;
    transition: width 0.2s;
}

/* Fullscreen Mode */
.fullscreen-mode .reader-header,
.fullscreen-mode .page-navigation,
.fullscreen-mode .reader-footer,
.fullscreen-mode .comments-section {
    display: none;
}

.fullscreen-mode .reader-container {
    padding: 0;
    min-height: 100vh;
    display: block;
}

.fullscreen-mode .page-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.fullscreen-mode .bottom-page-navigation {
    display: flex !important;
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    margin: 0;
}

.fullscreen-exit {
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.fullscreen-mode .fullscreen-exit {
    display: flex;
}

/* Light Theme */
.theme-light {
    background-color: var(--gray-200);
    color: var(--text-color);
}

.theme-light .reader-header,
.theme-light .reader-footer {
    background-color: var(--gray-200);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.theme-light .project-title a,
.theme-light .home-button,
.theme-light .settings-button {
    color: var(--text-color);
}

.theme-light .chapter-title,
.theme-light .page-info {
    color: var(--light-color);
}

.theme-light .nav-button {
    background-color: #eee;
    color: var(--text-color);
}

.theme-light .nav-button:hover:not(.disabled) {
    background-color: #ddd;
}

.theme-light .nav-button.disabled {
    background-color: var(--gray-200);
    color: #aaa;
}

.theme-light .page-select {
    background-color: #eee;
}

.theme-light .page-select select {
    background-color: var(--gray-200);
    color: var(--text-color);
}

.theme-light .overlay-arrow {
    color: var(--text-color);
    background-color: rgba(255, 255, 255, 0.3);
}

.theme-light .settings-panel,
.theme-light .chapter-list-panel {
    background-color: var(--gray-200);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.theme-light .mode-option {
    background-color: #eee;
    color: var(--text-color);
}

.theme-light .mode-option.active {
    background-color: var(--primary-color);
    color: #fff;
}

.theme-light .mode-option:hover:not(.active) {
    background-color: #ddd;
}

.theme-light .chapter-item {
    background-color: #eee;
    color: var(--text-color);
}

.theme-light .chapter-item.current {
    background-color: var(--primary-color);
    color: #fff;
}

.theme-light .chapter-item:hover:not(.current) {
    background-color: #ddd;
}

.theme-light .chapter-name {
    color: var(--light-color);
}

.theme-light .comments-section {
    background-color: var(--gray-200);
}

.theme-light .comment-item {
    background-color: var(--gray-300);
}

.theme-light .comment-content {
    color: var(--text-color);
}

.theme-light .add-comment-form textarea {
    background-color: var(--gray-300);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-color);
}

/* Sepia Theme */
.theme-sepia {
    background-color: var(--gray-300);
    color: #5f4b32;
}

.theme-sepia .reader-header,
.theme-sepia .reader-footer {
    background-color: var(--gray-300);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.theme-sepia .project-title a,
.theme-sepia .home-button,
.theme-sepia .settings-button {
    color: #5f4b32;
}

.theme-sepia .chapter-title,
.theme-sepia .page-info {
    color: #8a7e6f;
}

.theme-sepia .nav-button {
    background-color: #e8dbca;
    color: #5f4b32;
}

.theme-sepia .nav-button:hover:not(.disabled) {
    background-color: #decdb8;
}

.theme-sepia .nav-button.disabled {
    background-color: var(--gray-300);
    color: #b3a695;
}

.theme-sepia .page-select {
    background-color: #e8dbca;
}

.theme-sepia .page-select select {
    background-color: var(--gray-300);
    color: #5f4b32;
}

.theme-sepia .overlay-arrow {
    color: #5f4b32;
    background-color: rgba(247, 241, 234, 0.3);
}

.theme-sepia .settings-panel,
.theme-sepia .chapter-list-panel {
    background-color: var(--gray-300);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.theme-sepia .mode-option {
    background-color: #e8dbca;
    color: #5f4b32;
}

.theme-sepia .mode-option.active {
    background-color: #8a7e6f;
    color: #f7f1ea;
}

.theme-sepia .mode-option:hover:not(.active) {
    background-color: #decdb8;
}

.theme-sepia .chapter-item {
    background-color: #e8dbca;
    color: #5f4b32;
}

.theme-sepia .chapter-item.current {
    background-color: #8a7e6f;
    color: #f7f1ea;
}

.theme-sepia .chapter-item:hover:not(.current) {
    background-color: #decdb8;
}

.theme-sepia .chapter-name {
    color: #8a7e6f;
}

.theme-sepia .comments-section {
    background-color: var(--gray-300);
}

.theme-sepia .comment-item {
    background-color: #e8dbca;
}

.theme-sepia .comment-content {
    color: #5f4b32;
}

.theme-sepia .add-comment-form textarea {
    background-color: #e8dbca;
    border: 1px solid #decdb8;
    color: #5f4b32;
}

/* Responsive Styles */
@media (max-width: 992px) {
    .reader-header-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .reader-controls {
        width: 100%;
        justify-content: space-between;
    }
    
    .page-navigation {
        flex-direction: column-reverse;
        gap: 15px;
    }
    
    .nav-buttons {
        width: 100%;
    }
    
    .nav-button {
        flex: 1;
        text-align: center;
    }
    
    .page-select {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .reader-container {
        padding: 0px;
    }
    
    .page-image {
        width: 100%;
        max-width: none;
    }
    
    .page-overlay-nav {
        display: none;
    }
    
    .reading-mode-options,
    .theme-options {
        flex-wrap: wrap;
    }
    
    .comments-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .settings-panel,
    .chapter-list-panel {
        width: calc(100% - 40px);
        left: 20px;
        right: 20px;
        background-color: var(--gray-200);
    }
    
}

@media (max-width: 576px) {
    .footer-navigation {
        flex-direction: column;
        gap: 10px;
    }
    
    .nav-button {
        width: 100%;
    }
    
    .chapter-list-panel {
        max-height: 400px;
    }
}

/* ===== Manhwa Continuous Scroll Layout ===== */
.manhwa-continuous-scroll {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
}

.manhwa-page-container {
    width: 100%;
    display: flex;
    justify-content: center;
    position: relative;
}

.manhwa-page-image {
    width: 100%;
    max-width: 900px;
    height: auto;
    display: block;
    opacity: 0;
    transition: opacity 0.3s ease;
    box-shadow: none;
}

.manhwa-page-image.loaded {
    opacity: 1;
}

/* Page indicator for manhwa */
.manhwa-page-container::before {
    content: "Page " attr(data-page-number);
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    z-index: 10;
    opacity: 0.8;
}

/* Hide page loading indicator after first image loads */
.manhwa-continuous-scroll .page-loading {
    margin-bottom: 20px;
}

/* Responsive adjustments for manhwa */
@media (max-width: 768px) {
    .manhwa-continuous-scroll {
        max-width: 100%;
        padding: 0;
    }

    .manhwa-page-container::before {
        font-size: 10px;
        padding: 3px 6px;
    }
}

/* Progress tracking for manhwa scroll */
.manhwa-scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: rgba(0, 0, 0, 0.3);
    z-index: 999;
}

.manhwa-scroll-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), #42a5f5);
    width: 0%;
    transition: width 0.1s ease;
}