/*
 * Theme Name: KM Manga - Professional Manga Reader Theme
 * Theme URI: https://wordpress.ymwebseo.com
 * Description: Beautiful and fast manga reading WordPress theme, designed for KM Manga plugin. Inspired by professional manga sites like kingsmanga.net
 * Version: 1.0.0
 * Author: YM WebSEO
 * Author URI: https://ymwebseo.com
 * License: GPL v2 or later
 * License URI: https://www.gnu.org/licenses/gpl-2.0.html
 * Text Domain: km-manga-theme
 * Domain Path: /languages/
 * Requires at least: 5.0
 * Requires PHP: 7.4
 * Tags: manga, comic, reader, responsive, fast, dark-mode, accessibility
 *
 * This theme is designed to work with KM Manga plugin
 */

:root {
	--primary-color: #ff6b35;
	--primary-dark: #d43d1a;
	--primary-light: #ff8a54;
	--secondary-color: #1a1a1a;
	--accent-color: #4ecdc4;
	--success-color: #52b788;
	--warning-color: #f77f00;
	--danger-color: #d62828;
	--light-bg: #f8f9fa;
	--light-text: #333333;
	--light-border: #e0e0e0;
	--dark-bg: #1a1a1a;
	--dark-text: #ffffff;
	--dark-border: #333333;
	--transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	--shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.1);
	--shadow-md: 0 4px 16px rgba(0, 0, 0, 0.15);
	--shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.2);
}

* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

html {
	scroll-behavior: smooth;
}

body {
	font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
	font-size: 16px;
	line-height: 1.6;
	color: var(--light-text);
	background-color: var(--light-bg);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
	font-weight: 700;
	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;
}

h5 {
	font-size: 1.1rem;
}

h6 {
	font-size: 1rem;
}

p {
	margin-bottom: 1rem;
}

a {
	color: var(--primary-color);
	text-decoration: none;
	transition: color var(--transition);
}

a:hover {
	color: var(--primary-dark);
}

/* Container */
.container {
	max-width: 1200px;
	margin: 0 auto;
	padding: 0 20px;
}

.content-wrapper {
	display: grid;
	grid-template-columns: 1fr 300px;
	gap: 30px;
	margin: 40px 0;
}

/* Header */
.site-header {
	background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
	color: white;
	padding: 1.5rem 0;
	box-shadow: var(--shadow-md);
	position: sticky;
	top: 0;
	z-index: 1000;
}

.site-header-inner {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 1rem 0;
}

.site-logo {
	font-size: 1.8rem;
	font-weight: 700;
	color: white;
	display: flex;
	align-items: center;
	gap: 10px;
}

.site-logo a {
	color: white;
}

.site-logo a:hover {
	opacity: 0.9;
}

/* Navigation */
.site-nav {
	display: flex;
	gap: 2rem;
	list-style: none;
}

.site-nav a {
	color: white;
	transition: opacity var(--transition);
	padding: 0.5rem 0;
	border-bottom: 2px solid transparent;
}

.site-nav a:hover,
.site-nav .current-menu-item a {
	border-bottom-color: white;
}

.search-box {
	display: flex;
	background: rgba(255, 255, 255, 0.2);
	border-radius: 24px;
	padding: 0.5rem 1rem;
	border: 1px solid rgba(255, 255, 255, 0.3);
}

.search-box input {
	background: transparent;
	border: none;
	color: white;
	width: 200px;
	outline: none;
}

.search-box input::placeholder {
	color: rgba(255, 255, 255, 0.7);
}

.search-box button {
	background: none;
	border: none;
	color: white;
	cursor: pointer;
	font-size: 1.1rem;
}

/* Main Content */
main {
	flex: 1;
}

.section-title {
	font-size: 1.8rem;
	margin-bottom: 2rem;
	padding-bottom: 1rem;
	border-bottom: 3px solid var(--primary-color);
	color: var(--secondary-color);
}

/* Manga Grid */
.manga-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
	gap: 1.5rem;
	margin-bottom: 3rem;
}

.manga-card {
	background: white;
	border-radius: 8px;
	overflow: hidden;
	box-shadow: var(--shadow-sm);
	transition: all var(--transition);
	cursor: pointer;
}

.manga-card:hover {
	transform: translateY(-8px);
	box-shadow: var(--shadow-lg);
}

.manga-cover {
	width: 100%;
	height: 250px;
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	overflow: hidden;
	position: relative;
}

.manga-cover img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform var(--transition);
}

.manga-card:hover .manga-cover img {
	transform: scale(1.05);
}

.manga-status {
	position: absolute;
	top: 10px;
	right: 10px;
	background: var(--primary-color);
	color: white;
	padding: 0.3rem 0.8rem;
	border-radius: 20px;
	font-size: 0.75rem;
	font-weight: 600;
	text-transform: uppercase;
}

.manga-info {
	padding: 1rem;
}

.manga-title {
	font-size: 1rem;
	font-weight: 600;
	margin-bottom: 0.5rem;
	line-height: 1.3;
	min-height: 2.6rem;
}

.manga-title a {
	color: var(--light-text);
}

.manga-title a:hover {
	color: var(--primary-color);
}

.manga-meta {
	display: flex;
	justify-content: space-between;
	font-size: 0.85rem;
	color: #999;
}

.manga-rating {
	color: #ffc107;
	font-weight: 600;
}

.manga-chapters {
	font-size: 0.85rem;
	color: var(--primary-color);
}

/* Sidebar */
.sidebar {
	background: white;
	border-radius: 8px;
	padding: 2rem;
	box-shadow: var(--shadow-sm);
	height: fit-content;
	position: sticky;
	top: 100px;
}

.sidebar-widget {
	margin-bottom: 2rem;
}

.sidebar-widget:last-child {
	margin-bottom: 0;
}

.sidebar-title {
	font-size: 1.1rem;
	font-weight: 600;
	margin-bottom: 1rem;
	padding-bottom: 0.5rem;
	border-bottom: 2px solid var(--primary-color);
}

.widget-list {
	list-style: none;
}

.widget-list li {
	padding: 0.5rem 0;
	border-bottom: 1px solid var(--light-border);
}

.widget-list li:last-child {
	border-bottom: none;
}

.widget-list a {
	display: block;
	color: var(--light-text);
	transition: color var(--transition);
	padding-left: 10px;
}

.widget-list a:hover {
	color: var(--primary-color);
	padding-left: 15px;
}

/* Footer */
.site-footer {
	background: var(--secondary-color);
	color: white;
	padding: 3rem 0 1rem;
	margin-top: 4rem;
}

.footer-content {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
	gap: 2rem;
	margin-bottom: 2rem;
}

.footer-widget h3 {
	color: white;
	margin-bottom: 1rem;
}

.footer-widget a {
	color: #ccc;
	display: block;
	padding: 0.3rem 0;
	transition: color var(--transition);
}

.footer-widget a:hover {
	color: white;
}

.footer-bottom {
	text-align: center;
	padding-top: 1rem;
	border-top: 1px solid #333;
	color: #999;
}

/* Breadcrumb */
.breadcrumb {
	background: white;
	padding: 1rem;
	border-radius: 4px;
	margin-bottom: 2rem;
	font-size: 0.9rem;
}

.breadcrumb a {
	color: var(--primary-color);
}

.breadcrumb .separator {
	margin: 0 0.5rem;
	color: #ccc;
}

/* Chapter Reader */
.chapter-reader {
	margin: 2rem 0;
	background: white;
	border-radius: 8px;
	overflow: hidden;
	box-shadow: var(--shadow-md);
}

.chapter-images {
	display: flex;
	flex-direction: column;
	gap: 0;
}

.chapter-page {
	display: flex;
	justify-content: center;
	align-items: center;
	padding: 1rem;
	background: #f5f5f5;
}

.chapter-page img {
	max-width: 100%;
	height: auto;
	display: block;
	border-radius: 4px;
	box-shadow: var(--shadow-sm);
	transition: transform var(--transition);
}

.chapter-page img:hover {
	transform: scale(1.02);
}

.chapter-controls {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 2rem;
	padding: 1.5rem;
	background: var(--light-bg);
	border-top: 1px solid var(--light-border);
}

.btn-chapter-nav {
	padding: 0.8rem 1.5rem;
	background-color: var(--primary-color);
	color: white;
	border: none;
	border-radius: 4px;
	cursor: pointer;
	font-weight: 600;
	transition: all var(--transition);
}

.btn-chapter-nav:hover {
	background-color: var(--primary-dark);
	transform: translateY(-2px);
}

.btn-chapter-nav:active {
	transform: translateY(0);
}

.chapter-counter {
	font-weight: 600;
	color: var(--secondary-color);
	min-width: 80px;
	text-align: center;
	font-size: 1.1rem;
}

/* Single Post Styling */
.post-single {
	background: white;
	border-radius: 8px;
	padding: 2rem;
	box-shadow: var(--shadow-sm);
}

.post-header {
	margin-bottom: 2rem;
	padding-bottom: 1rem;
	border-bottom: 2px solid var(--light-border);
}

.post-title {
	margin-bottom: 1rem;
	color: var(--secondary-color);
}

.post-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 2rem;
	font-size: 0.95rem;
	color: #666;
}

.post-meta span {
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.post-thumbnail {
	margin-bottom: 2rem;
	border-radius: 8px;
	overflow: hidden;
	box-shadow: var(--shadow-md);
}

.post-thumbnail img {
	width: 100%;
	height: auto;
	display: block;
}

.post-content {
	margin-bottom: 2rem;
	line-height: 1.8;
}

.post-content p {
	margin-bottom: 1rem;
}

/* Chapters Section */
.chapters-section {
	margin-top: 3rem;
	padding-top: 2rem;
	border-top: 2px solid var(--light-border);
}

.chapters-section h2 {
	margin-bottom: 1.5rem;
	padding-bottom: 0.5rem;
	border-bottom: 3px solid var(--primary-color);
}

.chapters-list {
	background: var(--light-bg);
	border-radius: 4px;
	max-height: 600px;
	overflow-y: auto;
}

.chapter-item {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 1rem;
	border-bottom: 1px solid var(--light-border);
	transition: background-color var(--transition);
}

.chapter-item:hover {
	background-color: white;
}

.chapter-item a {
	flex: 1;
	color: var(--primary-color);
	font-weight: 500;
}

.chapter-item a:hover {
	color: var(--primary-dark);
	text-decoration: underline;
}

.chapter-date {
	color: #999;
	font-size: 0.9rem;
	white-space: nowrap;
	margin-left: 1rem;
}

.no-chapter-content {
	background: var(--light-bg);
	padding: 3rem;
	border-radius: 8px;
	text-align: center;
	color: #999;
}

/* Responsive */
@media (max-width: 768px) {
	.content-wrapper {
		grid-template-columns: 1fr;
	}

	.sidebar {
		order: -1;
	}

	.manga-grid {
		grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
		gap: 1rem;
	}

	.site-nav {
		gap: 1rem;
		font-size: 0.9rem;
	}

	.search-box input {
		width: 150px;
	}

	h1 {
		font-size: 2rem;
	}

	h2 {
		font-size: 1.5rem;
	}
}

@media (max-width: 480px) {
	.site-header-inner {
		flex-direction: column;
		gap: 1rem;
	}

	.site-nav {
		flex-direction: column;
		gap: 0.5rem;
	}

	.manga-grid {
		grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
	}

	.section-title {
		font-size: 1.3rem;
	}
}
