/*
Theme Name: Manhwa Minimal
Description: Clean, fast theme optimized specifically for manhwa sites
Version: 1.0
Author: Manhwa Pro
*/

/* =============================================================================
   MINIMAL RESET & BASE
   ============================================================================= */

* {
    box-sizing: border-box;
}

body {
    background: #0e1726;
    color: #ffffff;
    font-family: "Roboto", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* =============================================================================
   TYPOGRAPHY
   ============================================================================= */

h1, h2, h3, h4, h5, h6 {
    color: #ffffff;
    font-weight: 600;
    margin: 0 0 1rem 0;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }

a {
    color: #3c8bc6;
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: #5ba3d9;
}

/* =============================================================================
   LAYOUT CONTAINERS
   ============================================================================= */

.manhwa-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* =============================================================================
   HOMEPAGE LAYOUT
   ============================================================================= */

.manhwa-hero {
    display: flex;
    gap: 2rem;
    margin-bottom: 3rem;
    align-items: flex-start;
}

.manhwa-cover {
    width: 240px;
    min-width: 240px;
    flex-shrink: 0;
}

.manhwa-cover img {
    width: 100%;
    height: auto;
    border-radius: 0.8rem;
    display: block;
}

.manhwa-info {
    flex: 1;
    min-width: 0;
}

.manhwa-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.manhwa-synopsis {
    background: #182335;
    padding: 1.5rem;
    border-radius: 0.8rem;
    margin-bottom: 1.5rem;
    line-height: 1.7;
}

.manhwa-meta {
    background: #1e2c43;
    padding: 1.5rem;
    border-radius: 0.8rem;
    border: 1px solid #2a3b5c;
}

.meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.meta-item {
    display: flex;
    flex-direction: column;
}

.meta-label {
    font-size: 0.9rem;
    color: #a0a7b4;
    margin-bottom: 0.25rem;
    font-weight: 500;
}

.meta-value {
    color: #ffffff;
    font-weight: 600;
}

/* =============================================================================
   READING ACTION BUTTONS
   ============================================================================= */

.reading-actions {
    display: flex;
    gap: 1.5rem;
    margin: 3rem 0;
    justify-content: center;
    flex-wrap: wrap;
}

.reading-button {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 2rem 2.5rem;
    border-radius: 1.25rem;
    text-decoration: none;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    font-weight: 700;
    min-width: 220px;
    justify-content: flex-start;
    border: none;
    position: relative;
    overflow: hidden;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.reading-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.reading-button:hover::before {
    left: 100%;
}

.reading-button-primary {
    background: linear-gradient(135deg, #ff6b6b, #ee5a24, #ff9ff3);
    color: #ffffff;
    box-shadow: 0 8px 32px rgba(255, 107, 107, 0.4), 0 4px 16px rgba(238, 90, 36, 0.2);
}

.reading-button-primary:hover {
    background: linear-gradient(135deg, #ff5252, #e55100, #ff6ec7);
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 12px 40px rgba(255, 107, 107, 0.5), 0 8px 24px rgba(238, 90, 36, 0.3);
    color: #ffffff;
}

.reading-button-secondary {
    background: linear-gradient(135deg, #667eea, #764ba2, #f093fb);
    color: #ffffff;
    box-shadow: 0 8px 32px rgba(102, 126, 234, 0.4), 0 4px 16px rgba(118, 75, 162, 0.2);
}

.reading-button-secondary:hover {
    background: linear-gradient(135deg, #5a6fd8, #6a4190, #e084fc);
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 12px 40px rgba(102, 126, 234, 0.5), 0 8px 24px rgba(118, 75, 162, 0.3);
    color: #ffffff;
}

.button-icon {
    font-size: 2rem;
    flex-shrink: 0;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.button-text {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.button-text strong {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    letter-spacing: 0.5px;
}

.button-text small {
    font-size: 0.95rem;
    opacity: 0.9;
    font-weight: 500;
    letter-spacing: 0.3px;
}

/* =============================================================================
   CHAPTER LIST
   ============================================================================= */

.chapters-section {
    margin-top: 3rem;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #2d3748;
}

.section-title {
    font-size: 1.8rem;
    margin: 0;
}

.sort-toggle {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, #4facfe, #00f2fe);
    border: none;
    border-radius: 2rem;
    color: #ffffff;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    font-size: 1rem;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    box-shadow: 0 4px 20px rgba(79, 172, 254, 0.3), 0 2px 8px rgba(0, 242, 254, 0.2);
    position: relative;
    overflow: hidden;
}

.sort-toggle::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.6s ease;
}

.sort-toggle:hover::before {
    left: 100%;
}

.sort-toggle:hover {
    background: linear-gradient(135deg, #3d8bfe, #00d4fe);
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 6px 25px rgba(79, 172, 254, 0.4), 0 4px 12px rgba(0, 242, 254, 0.3);
}

.sort-toggle:active {
    transform: translateY(-1px) scale(1.02);
}

.sort-icon {
    font-size: 1.3rem;
    transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}

.sort-toggle:active .sort-icon {
    transform: scale(1.3) rotate(180deg);
}

.sort-text {
    letter-spacing: 0.3px;
}

.chapter-grid {
    display: grid;
    gap: 1rem;
}

.chapter-item {
    background: linear-gradient(135deg, #182335, #1e2c43);
    border-radius: 1rem;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid #2a3b5c;
    position: relative;
    box-shadow: 0 4px 16px rgba(24, 35, 53, 0.6);
}

.chapter-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #ff6b6b, #4facfe, #667eea);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.chapter-item:hover::before {
    opacity: 1;
}

.chapter-item:hover {
    background: linear-gradient(135deg, #1e2c43, #2a3b5c);
    border-color: #4facfe;
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 8px 32px rgba(79, 172, 254, 0.3), 0 4px 16px rgba(24, 35, 53, 0.4);
}

.chapter-link {
    display: block;
    padding: 1.75rem;
    color: inherit;
    text-decoration: none;
    position: relative;
}

.chapter-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: #ffffff;
    transition: color 0.3s ease;
    letter-spacing: 0.3px;
}

.chapter-item:hover .chapter-title {
    color: #4facfe;
}

.chapter-meta {
    font-size: 0.95rem;
    color: #a0a7b4;
    font-weight: 500;
    line-height: 1.5;
}

.chapter-meta small {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: #718096;
    font-weight: 400;
}

/* =============================================================================
   CHAPTER READING PAGE
   ============================================================================= */

.chapter-header {
    text-align: center;
    margin-bottom: 2rem;
    padding: 2rem;
    background: #182335;
    border-radius: 0.8rem;
}

.chapter-navigation {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.nav-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #ffffff;
    border: none;
    border-radius: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-decoration: none;
    min-height: 52px; /* Touch-friendly */
    touch-action: manipulation;
    -webkit-user-select: none;
    user-select: none;
    position: relative;
    overflow: hidden;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    box-shadow: 0 6px 24px rgba(102, 126, 234, 0.4), 0 3px 12px rgba(118, 75, 162, 0.2);
    letter-spacing: 0.5px;
    font-size: 1rem;
}

.nav-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
    transition: left 0.5s ease;
}

.nav-button:hover::before {
    left: 100%;
}

.nav-button:hover {
    background: linear-gradient(135deg, #5a6fd8, #6a4190);
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 30px rgba(102, 126, 234, 0.5), 0 4px 16px rgba(118, 75, 162, 0.3);
}

.nav-button:active {
    transform: translateY(-1px) scale(0.98);
}

.nav-button:disabled {
    background: linear-gradient(135deg, #4a5568, #2d3748);
    cursor: not-allowed;
    pointer-events: none;
    opacity: 0.6;
    transform: none;
    box-shadow: 0 2px 8px rgba(74, 85, 104, 0.2);
}

.nav-button:disabled::before {
    display: none;
}

/* Chapter content - seamless images */
.chapter-content {
    background: #182335;
    padding: 2.5rem;
    border-radius: 0.8rem;
    margin-bottom: 2rem;
    line-height: 0; /* Crucial for seamless images */
    font-size: 0; /* Crucial for seamless images */
}

.chapter-content img {
    max-width: 100%;
    height: auto;
    margin: 0; /* Remove all margins */
    border-radius: 0;
    box-shadow: none;
    border: none;
    display: block;
    width: 100%;
}

/* =============================================================================
   MOBILE RESPONSIVE
   ============================================================================= */

@media (max-width: 768px) {
    .manhwa-container {
        padding: 1rem;
    }
    
    .manhwa-hero {
        flex-direction: column;
        text-align: center;
    }
    
    .manhwa-cover {
        width: 200px;
        margin: 0 auto;
    }
    
    .manhwa-title {
        font-size: 1.8rem;
    }
    
    .meta-grid {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    /* Reading action buttons mobile */
    .reading-actions {
        flex-direction: column;
        margin: 2rem 0;
        gap: 1rem;
    }
    
    .reading-button {
        min-width: auto;
        width: 100%;
        padding: 1.5rem 2rem;
        justify-content: center;
    }
    
    .button-text {
        text-align: center;
    }
    
    .button-text strong {
        font-size: 1.1rem;
    }
    
    .button-text small {
        font-size: 0.9rem;
    }
    
    /* Section header mobile */
    .section-header {
        flex-direction: column;
        gap: 1.5rem;
        align-items: stretch;
    }
    
    .section-title {
        text-align: center;
        font-size: 1.5rem;
    }
    
    .sort-toggle {
        justify-content: center;
        padding: 1.25rem 1.5rem;
        font-size: 1.1rem;
        border-radius: 1.5rem;
    }
    
    .sort-icon {
        font-size: 1.4rem;
    }
    
    .chapter-navigation {
        flex-direction: column;
    }
    
    .nav-button {
        padding: 1.25rem 1.5rem;
        font-size: 1.1rem;
        min-height: 56px;
        border-radius: 1.25rem;
        font-weight: 700;
        letter-spacing: 0.4px;
    }
    
    .chapter-content {
        padding: 1rem;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    .nav-button:hover {
        background: #3c8bc6; /* Disable hover effects */
    }
    
    .nav-button:active {
        background: #2b7bb8;
        transform: scale(0.98);
    }
}

/* =============================================================================
   NO CHAPTERS MESSAGE
   ============================================================================= */

.no-chapters-message {
    text-align: center;
    padding: 3rem 2rem;
    background: #182335;
    border-radius: 0.8rem;
    border: 2px dashed #2a3b5c;
    margin: 2rem 0;
}

.no-chapters-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.6;
}

.no-chapters-title {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: #a0a7b4;
}

.no-chapters-description {
    color: #718096;
    font-size: 1rem;
    line-height: 1.6;
}