/* Roberto T Hugo - Mobile-Responsive Reading Website */

/* CSS Variables */
:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --accent-color: #e74c3c;
    --text-color: #2c3e50;
    --text-light: #7f8c8d;
    --bg-color: #ffffff;
    --bg-light: #f8f9fa;
    --border-color: #e9ecef;
    --shadow: 0 2px 10px rgba(0,0,0,0.1);
    --shadow-hover: 0 4px 20px rgba(0,0,0,0.15);
    --border-radius: 8px;
    --transition: all 0.3s ease;
}

/* Dark Theme */
.theme-dark {
    --text-color: #ffffff;
    --text-light: #b0b0b0;
    --bg-color: #1a1a1a;
    --bg-light: #2d2d2d;
    --border-color: #404040;
}

/* Sepia Theme */
.theme-sepia {
    --text-color: #5c4b37;
    --text-light: #8b7355;
    --bg-color: #f4f1ea;
    --bg-light: #f9f6f0;
    --border-color: #d4c4a8;
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
    transition: var(--transition);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 1rem;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

p {
    margin-bottom: 1rem;
}

a {
    color: var(--secondary-color);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--accent-color);
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

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

.btn-primary:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

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

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

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

/* Navigation */
.navbar {
    background: white;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

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

.nav-logo a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
}

.logo-img {
    height: 36px;
    max-height: 36px;
    width: auto;
    display: inline-block;
    object-fit: contain;
}

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

.nav-link {
    color: var(--text-color);
    font-weight: 500;
    transition: var(--transition);
}

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

.nav-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.bar {
    width: 25px;
    height: 3px;
    background: var(--primary-color);
    margin: 3px 0;
    transition: var(--transition);
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 4rem 0;
    min-height: 70vh;
    display: flex;
    align-items: center;
}

.hero-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.hero-content h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.hero-subtitle {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.hero-stats {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
}

.stat {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 2rem;
    font-weight: 700;
}

.stat-label {
    font-size: 0.875rem;
    opacity: 0.8;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.hero-image {
    display: flex;
    justify-content: center;
    align-items: center;
}

.book-stack {
    position: relative;
    width: 200px;
    height: 300px;
}

.book {
    position: absolute;
    width: 120px;
    height: 180px;
    background: white;
    border-radius: 4px;
    box-shadow: var(--shadow);
}

.book-1 {
    transform: rotate(-5deg);
    z-index: 1;
}

.book-2 {
    transform: rotate(0deg);
    left: 40px;
    z-index: 2;
}

.book-3 {
    transform: rotate(5deg);
    left: 80px;
    z-index: 3;
}

/* Features Section */
.features {
    padding: 4rem 0;
    background: var(--bg-light);
}

.features h2 {
    text-align: center;
    margin-bottom: 3rem;
}

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

.feature-card {
    background: white;
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    text-align: center;
    transition: var(--transition);
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.feature-icon {
    font-size: 3rem;
    color: var(--secondary-color);
    margin-bottom: 1rem;
}

.feature-card h3 {
    margin-bottom: 1rem;
}

/* Novels Section */
.novels {
    padding: 4rem 0;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.novel-filters {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.5rem 1rem;
    border: 2px solid var(--border-color);
    background: white;
    color: var(--text-color);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
}

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

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

.novel-card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: var(--transition);
}

.novel-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.novel-cover {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.novel-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.placeholder-cover {
    width: 100%;
    height: 100%;
    background: var(--bg-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: var(--text-light);
}

.novel-status {
    position: absolute;
    top: 1rem;
    right: 1rem;
    padding: 0.25rem 0.75rem;
    border-radius: var(--border-radius);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-draft { background: #f39c12; color: white; }
.status-published { background: #27ae60; color: white; }
.status-archived { background: #95a5a6; color: white; }

.novel-info {
    padding: 1.5rem;
}

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

.novel-author {
    color: var(--text-light);
    margin-bottom: 0.5rem;
}

.novel-genre {
    display: inline-block;
    background: var(--bg-light);
    color: var(--secondary-color);
    padding: 0.25rem 0.75rem;
    border-radius: var(--border-radius);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.novel-stats {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    color: var(--text-light);
}

.novel-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
}

.empty-icon {
    font-size: 4rem;
    color: var(--text-light);
    margin-bottom: 1rem;
}

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

/* CTA Section */
.cta {
    background: var(--primary-color);
    color: white;
    padding: 4rem 0;
    text-align: center;
}

.cta-content h2 {
    margin-bottom: 1rem;
}

.cta-content p {
    margin-bottom: 2rem;
    opacity: 0.9;
}

/* Novel Reader */
.novel-reader {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.reader-header {
    background: white;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.reader-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.back-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-color);
    font-weight: 500;
}

.reader-controls {
    display: flex;
    gap: 0.5rem;
}

.control-btn {
    width: 40px;
    height: 40px;
    border: 2px solid var(--border-color);
    background: white;
    border-radius: var(--border-radius);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

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

.novel-meta {
    padding: 1rem 0;
    border-top: 1px solid var(--border-color);
}

.novel-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.tag {
    padding: 0.25rem 0.75rem;
    border-radius: var(--border-radius);
    font-size: 0.875rem;
    font-weight: 500;
}

.tag-genre {
    background: var(--bg-light);
    color: var(--secondary-color);
}

.reader-content {
    flex: 1;
    padding: 1.5rem 0 3rem;
}

.reading-area {
    max-width: 860px;
    margin: 0 auto;
    padding: 0 1rem;
}

.novel-text {
    font-size: 1.125rem;
    line-height: 1.8;
    color: var(--text-color);
    max-width: 72ch;
    margin: 0 auto;
    word-break: break-word;
}

.novel-text h1,
.novel-text h2,
.novel-text h3 {
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.novel-text p {
    margin-bottom: 1.5rem;
}

.reader-footer {
    background: white;
    border-top: 1px solid var(--border-color);
    padding: 0.75rem 0;
    position: sticky;
    bottom: 0;
}

.reading-progress {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.progress-bar {
    flex: 1;
    height: 4px;
    background: var(--border-color);
    border-radius: 2px;
    overflow: hidden;
}

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

.progress-text {
    font-size: 0.875rem;
    color: var(--text-light);
    min-width: 3rem;
}

.reader-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: 2px solid var(--border-color);
    background: white;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
}

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

.action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.chapter-nav select {
    padding: 0.5rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    background: white;
    cursor: pointer;
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
}

.modal-content {
    background: white;
    margin: 5% auto;
    padding: 0;
    border-radius: var(--border-radius);
    width: 90%;
    max-width: 500px;
    box-shadow: var(--shadow-hover);
}

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

.modal-close {
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-light);
}

.modal-body {
    padding: 1.5rem;
}

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

.setting-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.setting-group input[type="range"] {
    width: 100%;
    margin-bottom: 0.5rem;
}

/* Theme Options */
.theme-options {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 0.5rem;
    z-index: 1000;
}

.theme-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    cursor: pointer;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.theme-option:hover {
    background: var(--bg-light);
}

.theme-preview {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
}

.theme-preview.light { background: white; }
.theme-preview.dark { background: #1a1a1a; }
.theme-preview.sepia { background: #f4f1ea; }

/* Footer */
.footer {
    background: var(--primary-color);
    color: white;
    padding: 3rem 0 1rem;
    margin-top: auto;
}

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

.footer-section h3,
.footer-section h4 {
    margin-bottom: 1rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: rgba(255,255,255,0.8);
    transition: var(--transition);
}

.footer-section a:hover {
    color: white;
}

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

.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    transition: var(--transition);
}

.social-links a:hover {
    background: var(--secondary-color);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.6);
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background-color: white;
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: var(--shadow);
        padding: 2rem 0;
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-toggle {
        display: flex;
    }

    .nav-toggle.active .bar:nth-child(2) {
        opacity: 0;
    }

    .nav-toggle.active .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }

    .nav-toggle.active .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    .hero-container {
        grid-template-columns: 1fr;
        text-align: center;
    }

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

    .hero-stats {
        justify-content: center;
    }

    .hero-actions {
        justify-content: center;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .novel-filters {
        width: 100%;
        justify-content: center;
    }

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

    .reader-actions {
        flex-direction: column;
        gap: 1rem;
    }

    .chapter-nav {
        order: -1;
    }

    .modal-content {
        margin: 10% auto;
        width: 95%;
    }
    /* Mobile Reader - Full Width */
    .reader-header { 
        position: fixed; 
        width: 100%; 
        z-index: 1000;
    }
    .reader-content { 
        padding-top: 4.5rem; 
        padding-bottom: 4rem;
    }
    .reading-area { 
        max-width: 100%; 
        padding: 0 0.5rem; 
        margin: 0;
    }
    .novel-text { 
        max-width: 100%; 
        font-size: 1.1rem; 
        line-height: 1.6; 
        margin: 0;
        padding: 0;
    }
    .reader-footer { 
        position: fixed; 
        width: 100%; 
        bottom: 0; 
        z-index: 1000;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 0.5rem;
    }

    .hero {
        padding: 2rem 0;
    }

    .hero-content h1 {
        font-size: 2rem;
    }

    .hero-stats {
        flex-direction: column;
        gap: 1rem;
    }

    .btn {
        padding: 0.625rem 1.25rem;
        font-size: 0.875rem;
    }

    .novel-card {
        margin: 0 0.5rem;
    }

    .novel-actions {
        flex-direction: column;
    }

    .novel-actions .btn {
        width: 100%;
        justify-content: center;
    }

    /* Extra small mobile - Ultra full width */
    .reading-area { 
        padding: 0 0.25rem; 
    }
    .novel-text {
        font-size: 1.15rem;
        line-height: 1.5;
        max-width: 100%;
        margin: 0;
        padding: 0;
    }

    .novel-text h1,
    .novel-text h2,
    .novel-text h3 {
        margin-top: 1.5rem;
        margin-bottom: 0.75rem;
    }

    .novel-text p {
        margin-bottom: 1rem;
    }
}

/* Print Styles */
@media print {
    .navbar,
    .reader-header,
    .reader-footer,
    .modal,
    .theme-options {
        display: none !important;
    }

    .novel-text {
        font-size: 12pt;
        line-height: 1.5;
        max-width: none;
    }

    .novel-text h1,
    .novel-text h2,
    .novel-text h3 {
        page-break-after: avoid;
    }

    .novel-text p {
        orphans: 3;
        widows: 3;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus styles for keyboard navigation */
.btn:focus,
.control-btn:focus,
.action-btn:focus,
.filter-btn:focus {
    outline: 2px solid var(--secondary-color);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --border-color: #000000;
        --text-light: #000000;
    }
}

/* ===== Bobook Club Homepage v2 Overrides ===== */
/* Palette update */
:root {
    --primary-color: #0A2A4A; /* dark navy */
    --secondary-color: #00B8F5; /* bright cyan */
    --accent-color: #F5A623; /* golden */
}

/* Hero gradient refinement */
.hero {
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--primary-color) 100%);
}

/* Hero badges */
.hero-badges {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.2);
    color: #F8FAFC;
    padding: 0.5rem 0.75rem;
    border-radius: 999px;
    font-size: 0.9rem;
}

/* CTA styles */
.btn-accent {
    background: var(--accent-color);
    color: #1E293B;
}

.btn-accent:hover,
.btn-cta:hover {
    filter: brightness(1.05);
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

/* Badge mapping colors */
.status-draft { background: var(--accent-color); color: #1E293B; }
.cta { background: linear-gradient(135deg, var(--primary-color), #061829); }

@media (max-width: 768px) {
    .hero-badges { grid-template-columns: 1fr; }
}
