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

:root {
    /* Color Scheme */
    --base-color: #e8e8e8;
    --light-gray: #f5f5f5;
    --main-color: #2c3e50;
    --accent-color: #d4704a;
    --text-dark: #2c3e50;
    --text-light: #7f8c8d;
    --white: #ffffff;
    --shadow: rgba(44, 62, 80, 0.1);
    --shadow-dark: rgba(44, 62, 80, 0.2);
    
    /* Typography */
    --font-display: 'Playfair Display', serif;
    --font-body: 'Noto Sans JP', sans-serif;
    
    /* Mobile-first spacing */
    --mobile-max-width: 390px;
    --container-max-width: 1200px;
    --section-padding: 3rem 0;
    --content-padding: 1.5rem;
    --mobile-padding: 1rem;
}

body {
    font-family: var(--font-body);
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--base-color);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Mobile-first container design */
.container {
    max-width: var(--mobile-max-width);
    margin: 0 auto;
    padding: 0 var(--mobile-padding);
}

/* Wider container for desktop */
@media (min-width: 768px) {
    .container {
        max-width: var(--container-max-width);
        padding: 0 2rem;
    }
}

/* Mobile-first Header */
.header {
    background: var(--white);
    box-shadow: 0 2px 10px var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
    display: none;
}

.header .container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem var(--mobile-padding);
    text-align: center;
}

@media (min-width: 768px) {
    .header .container {
        justify-content: space-between;
        padding: 1rem 2rem;
    }
}

.logo {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--main-color);
    text-decoration: none;
}

.logo a {
    color: inherit;
    text-decoration: none;
}

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

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

.nav a:hover {
    color: var(--accent-color);
    opacity: 1;
}

/* Mobile-optimized Hero Section */
.hero {
    position: relative;
    height: 60vh;
    min-height: 400px;
    overflow: hidden;
    margin-bottom: 0;
}

@media (min-width: 768px) {
    .hero {
        height: 70vh;
        min-height: 500px;
    }
}

.hero-visual {
    position: relative;
    width: 100%;
    height: 100%;
}

/* Key visual image - optimized for 400px main container width */
.hero-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-content {
    text-align: center;
    color: var(--white);
    max-width: 600px;
    padding: 0 2rem;
}

.hero-title {
    font-family: var(--font-display);
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.hero-subtitle {
    font-size: 1.2rem;
    font-weight: 300;
    opacity: 0.9;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

/* Mobile-optimized Story Info Section */
.story-info {
    padding: 2rem 0;
    background: var(--white);
    text-align: center;
    margin-bottom: 0;
}

@media (min-width: 768px) {
    .story-info {
        padding: var(--section-padding);
    }
}

.genre-tag {
    display: inline-block;
    background: var(--accent-color);
    color: var(--white);
    padding: 0.5rem 1.5rem;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 2rem;
}

.story-description {
    max-width: 700px;
    margin: 0 auto 3rem;
    font-size: 1.1rem;
    line-height: 1.8;
}

.story-description p {
    margin-bottom: 1rem;
}

.cta-button {
    display: inline-block;
    background: var(--main-color);
    color: var(--white);
    padding: 1rem 3rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px var(--shadow-dark);
}

.cta-button:hover {
    background: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--shadow-dark);
}

/* Mobile-optimized Episode List Section */
.episode-list {
    padding: 2rem 0;
    background: var(--light-gray);
}

@media (min-width: 768px) {
    .episode-list {
        padding: var(--section-padding);
    }
}

.section-title {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 3rem;
    color: var(--main-color);
}

/* Mobile-first episode grid */
.episodes {
    max-width: 100%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

@media (min-width: 768px) {
    .episodes {
        max-width: 800px;
    }
}

/* Mobile-optimized episode cards */
.episode-item {
    background: var(--white);
    margin-bottom: 0;
    border-radius: 15px;
    box-shadow: 0 2px 15px var(--shadow);
    transition: all 0.3s ease;
    overflow: hidden;
}

.episode-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px var(--shadow-dark);
}

/* Mobile-optimized episode links */
.episode-link {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 1rem 1.2rem;
    text-decoration: none;
    color: inherit;
    position: relative;
    min-height: 70px;
}

@media (min-width: 768px) {
    .episode-link {
        padding: 1.5rem 2rem;
    }
}

.episode-number {
    font-weight: 700;
    color: var(--accent-color);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.episode-title {
    font-size: 0.95rem;
    font-weight: 500;
    line-height: 1.3;
    margin-bottom: 0.3rem;
}

.new-badge {
    position: absolute;
    top: 1rem;
    right: 1.2rem;
    background: #e74c3c;
    color: var(--white);
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Episode Page Styles */
.episode-page {
    background: var(--white);
}

.episode-main {
    min-height: calc(100vh - 200px);
    padding: 2rem 0;
}

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

.episode-title {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 600;
    color: var(--main-color);
    margin-bottom: 1rem;
}

.episode-nav-top,
.episode-nav-bottom {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin: 2rem 0;
    flex-wrap: wrap;
}

.nav-btn {
    padding: 0.8rem;
    border: 2px solid var(--main-color);
    background: var(--white);
    color: var(--main-color);
    text-decoration: none;
    border-radius: 25px;
    font-weight: 500;
    transition: all 0.3s ease;
    cursor: pointer;
}

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

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

.nav-btn:disabled:hover {
    background: var(--white);
    color: var(--main-color);
}

.home-btn {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: var(--white);
}

.home-btn:hover {
    background: var(--main-color);
    border-color: var(--main-color);
}

/* Webtoon Viewer */
.webtoon-viewer {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 1rem;
}

.webtoon-panel {
    margin-bottom: 0;
    text-align: center;
}

.webtoon-panel img {
    width: 100%;
    max-width: 690px;
    height: auto;
    display: block;
    border-radius: 0;
    box-shadow: none;
    transition: transform 0.3s ease;
}

.webtoon-panel img:hover {
    transform: scale(1.02);
}

/* Main content */
main {
    flex: 1;
    max-width: 400px;
    margin: 0 auto;
    box-shadow: 0 4px 20px var(--shadow-dark);
    padding-bottom: 3rem;
}

/* Social Links */
.social-links {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
}

.social-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1.5rem;
    background: var(--accent-color);
    color: var(--white);
    text-decoration: none;
    border-radius: 25px;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px var(--shadow);
}

.social-link:hover {
    background: var(--main-color);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px var(--shadow-dark);
}

.social-link svg {
    width: 20px;
    height: 20px;
}

/* Profile Section */
.profile-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
    text-align: center;
}

.profile-image {
    flex-shrink: 0;
}

.profile-photo {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 4px 15px var(--shadow);
}

/* Top navigation */
.top-nav {
    padding: 1rem;
    text-align: center;
    background: var(--white);
}

.jump-button {
    display: inline-block;
    background: var(--accent-color);
    color: var(--white);
    padding: 0.8rem 2rem;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px var(--shadow);
}

.jump-button:hover {
    background: var(--main-color);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px var(--shadow-dark);
}

/* Footer */
.footer {
    background: var(--main-color);
    color: var(--white);
    padding: 2rem 0;
    text-align: center;
    position: relative;
    z-index: 1;
    margin-top: auto;
}

.footer .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.copyright {
    opacity: 0.8;
}

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

.footer-links a {
    color: var(--white);
    text-decoration: none;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.footer-links a:hover {
    opacity: 1;
}

/* Section dividers inspired by reference site */
.section-divider {
    width: 100%;
    height: 60px;
    background: linear-gradient(45deg, var(--accent-color), var(--main-color));
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.section-divider::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

.section-divider-text {
    color: var(--white);
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 1.1rem;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

/* Mobile-specific responsive adjustments */
@media (max-width: 767px) {
    .nav {
        display: none; /* Hide navigation on mobile for cleaner look */
    }
    
    .hero-title {
        font-size: 1.8rem;
    }
    
    .hero-subtitle {
        font-size: 0.95rem;
    }
    
    .story-description {
        font-size: 0.95rem;
        line-height: 1.7;
    }
    
    .section-title {
        font-size: 1.6rem;
        margin-bottom: 2rem;
    }
}

/* Tablet and desktop adjustments */
@media (min-width: 768px) {
    .episode-nav-top,
    .episode-nav-bottom {
        flex-direction: row;
        justify-content: center;
        gap: 1rem;
    }
    
    .nav-btn {
        min-width: auto;
    }
    
    .footer .container {
        flex-direction: row;
        justify-content: space-between;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 1.5rem;
    }
    
    .cta-button {
        padding: 0.8rem 2rem;
        font-size: 1rem;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .episode-title {
        font-size: 1.2rem;
    }
    
    .nav-btn {
        padding: 0.6rem 1.2rem;
        font-size: 0.9rem;
    }
}

/* Loading Animation */
.loading {
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Focus Styles for Accessibility */
.nav-btn:focus,
.cta-button:focus,
.episode-link:focus {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}