/* style.css */
:root {
    --text-color: #333;
    --bg-color: #f8f8f8;
    --link-color: #007bff;
    --link-hover-color: #0056b3;
    --border-color: #ddd;
    --header-bg: #eee;
    --table-header-bg: #e9ecef;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    background-color: var(--bg-color);
    color: var(--text-color);
}

.container {
    max-width: 960px;
    margin: 20px auto;
    padding: 0 15px;
}

header {
    padding: 15px 0;
    border-bottom: 1px solid var(--border-color);
    text-align: center;
    background-image: url('https://www.jujutsukaisen.fun/bg-banner.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color: rgba(255, 255, 255, 0.6);
    background-blend-mode: overlay;
}

header h1 {
    margin: 0;
    font-size: 2em;
}

header h1 a {
    text-decoration: none;
    color: var(--text-color);
}

nav {
    margin-top: 15px;
}

nav a {
    color: var(--link-color);
    text-decoration: none;
    padding: 5px 10px;
    border: 1px solid var(--link-color);
    border-radius: 4px;
    display: inline-block;
    margin: 0 5px;
}

nav a:hover {
    background-color: var(--link-color);
    color: white;
}

h2 {
    font-size: 1.8em;
    margin-top: 30px;
    margin-bottom: 15px;
}

h3 {
    font-size: 1.5em;
    margin-top: 25px;
    margin-bottom: 15px;
}

ul {
    list-style: none;
    padding: 0;
}

li {
    margin-bottom: 10px;
}

a {
    color: var(--link-color);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.chapter-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.chapter-item {
    background-color: white;
    padding: 15px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.chapter-item a {
    display: block;
    font-size: 1.1em;
    font-weight: bold;
    color: var(--text-color);
    text-decoration: none;
}

.chapter-item a:hover {
    color: var(--link-color);
    text-decoration: none;
}

.manga-page {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 0 auto 10px auto;
    border: 1px solid var(--border-color);
    border-radius: 3px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.chapter-navigation {
    text-align: center;
    margin-top: 20px;
    padding-bottom: 20px;
}

.chapter-navigation a {
    display: inline-block;
    margin: 0 10px;
    padding: 8px 15px;
    background-color: var(--link-color);
    color: white;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
}

.chapter-navigation a:hover {
    background-color: var(--link-hover-color);
    text-decoration: none;
}

.chapter-navigation a.disabled {
    background-color: #ccc;
    cursor: default;
    pointer-events: none;
}

/* About Berserk Section */
.about-section {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.manga-posters {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 20px 0;
    flex-wrap: wrap;
}

.manga-posters img {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: 5px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

@media (min-width: 600px) {
    .manga-posters img {
        width: 48%;
    }
}

/* Information Table */
.info-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    background-color: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.info-table th,
.info-table td {
    border: 1px solid var(--border-color);
    padding: 12px 15px;
    text-align: left;
}

.info-table th {
    background-color: var(--table-header-bg);
    font-weight: bold;
    color: var(--text-color);
}

.info-table tbody tr:nth-child(even) {
    background-color: #f2f2f2;
}

.info-table tbody tr:hover {
    background-color: #e6e6e6;
}

/* Character Page Specific Styles */
.characters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 25px;
    margin-top: 30px;
    padding: 20px;
    background-color: white; /* Changed from f8f8f8 for contrast */
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.05);
}

.character-card {
    background-color: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    text-align: center;
    padding: 15px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.character-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.1);
}

.character-card a {
    display: block;
    text-decoration: none;
    color: var(--text-color);
}

.character-card img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin-bottom: 10px;
    object-fit: cover;
    aspect-ratio: 3/4;
}

.character-card h3 {
    margin: 0;
    font-size: 1.2em;
    font-weight: bold;
    color: var(--link-color);
}

.character-card h3:hover {
    text-decoration: underline;
}

/* FAQ Section */
.faq-section {
    margin-top: 40px;
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
}

.faq-item {
    margin-bottom: 10px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    overflow: hidden;
}

.faq-question {
    background-color: #f2f2f2;
    color: var(--text-color);
    padding: 15px 20px;
    width: 100%;
    text-align: left;
    border: none;
    outline: none;
    font-size: 1.1em;
    cursor: pointer;
    transition: background-color 0.3s ease;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.faq-question:hover {
    background-color: #e6e6e6;
}

.faq-question::after {
    content: '+';
    font-size: 1.5em;
    line-height: 1;
    margin-left: 10px;
}

.faq-question.active::after {
    content: '-';
}

.faq-answer {
    padding: 0 20px;
    background-color: white;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.faq-answer p {
    padding-bottom: 15px;
    margin: 0;
}

footer {
    text-align: center;
    padding: 20px 0;
    margin-top: 40px;
    border-top: 1px solid var(--border-color);
    color: #666;
    font-size: 0.9em;
}

/* Scroll to top button (from functions.php) */
#scrollToTopBtn {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 99;
    font-size: 24px;
    border: none;
    outline: none;
    background-color: var(--link-color);
    color: white;
    cursor: pointer;
    padding: 10px 15px;
    border-radius: 5px;
    opacity: 0.8;
    transition: opacity 0.3s ease-in-out;
}

#scrollToTopBtn:hover {
    opacity: 1;
    background-color: var(--link-hover-color);
}