/* UmeTruyen - Main Stylesheet */
/* Extracted from Tailwind CSS and converted to vanilla CSS */

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

:root {
    /* Colors */
    --primary: #000000;
    --primary-hover: #000000;
    --secondary: #000000;
    --accent-blue: #000000;
    --badge-cyan: #000000;
    --yellow-300: #000000;
    --yellow-400: #facc15;

    /* Backgrounds */
    --bg-light: #f3f4f6;
    --bg-dark: #0f172a;
    --card-light: #ffffff;
    --card-dark: #1e293b;

    /* Text */
    --text-light: #1f2937;
    --text-dark: #e2e8f0;
    --text-muted-light: #6b7280;
    --text-muted-dark: #9ca3af;

    /* Borders */
    --border-light: #e5e7eb;
    --border-dark: #374151;

    /* Fonts */
    --font-display: 'Nunito', 'Inter', sans-serif;
    --font-body: 'Inter', 'Roboto', sans-serif;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-light);
    color: var(--text-light);
    line-height: 1.5;
    transition: background-color 0.2s, color 0.2s;
}

body.dark {
    background-color: var(--bg-dark);
    color: var(--text-dark);
    --bg-light: var(--bg-dark);
    --card-light: var(--card-dark);
    --text-light: var(--text-dark);
    --text-muted-light: var(--text-muted-dark);
    --border-light: var(--border-dark);
}

/* ========== Typography ========== */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.2;
}

h1 {
    font-size: 2rem;
}

h2 {
    font-size: 1.5rem;
}

h3 {
    font-size: 1.25rem;
}

h4 {
    font-size: 1.125rem;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s;
}

/* ========== Container ========== */
.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* ========== Header ========== */
header {
    background: linear-gradient(to right, var(--primary), #0c0c0c);
    color: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 50;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 4rem;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    font-family: var(--font-display);
    color: var(--yellow-300);
    letter-spacing: 0.05em;
    transition: color 0.2s;
}

.logo:hover {
    color: #fef08a;
}

.main-nav {
    display: none;
    gap: 1.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.main-nav a:hover {
    color: #fde047;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.search-btn,
.menu-btn,
.theme-toggle {
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 9999px;
    color: white;
    cursor: pointer;
    transition: background 0.2s;
}

.search-btn:hover,
.menu-btn:hover,
.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ========== Sub Header ========== */
.sub-header {
    background: var(--card-light);
    border-bottom: 1px solid var(--border-light);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

body.dark .sub-header {
    background: var(--card-dark);
    border-color: var(--border-dark);
}

.sub-header-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 0.75rem 0;
}

.category-nav {
    display: flex;
    gap: 1.5rem;
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--text-muted-light);
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: none;
}

.category-nav::-webkit-scrollbar {
    display: none;
}

.category-nav a:hover {
    color: var(--primary);
}

body.dark .category-nav {
    color: var(--text-muted-dark);
}

body.dark .category-nav a:hover {
    color: var(--secondary);
}

.auth-buttons {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.875rem;
}

.btn-auth {
    padding: 0.375rem 1.25rem;
    border: 1px solid var(--text-muted-light);
    border-radius: 9999px;
    background: transparent;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-auth:hover {
    background: var(--bg-light);
    color: var(--primary);
}

body.dark .btn-auth {
    border-color: var(--text-muted-dark);
}

body.dark .btn-auth:hover {
    background: var(--border-dark);
    color: white;
}

/* ========== Grid System ========== */
.grid {
    display: grid;
    gap: 1rem;
}

.grid-cols-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-cols-3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-cols-4 {
    grid-template-columns: repeat(4, 1fr);
}

.grid-cols-6 {
    grid-template-columns: repeat(6, 1fr);
}

/* ========== Story Card ========== */
.story-card {
    position: relative;
    cursor: pointer;
}

.story-cover {
    aspect-ratio: 2/3;
    overflow: hidden;
    border-radius: 0.5rem;
    position: relative;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    background: var(--border-light);
}

body.dark .story-cover {
    background: var(--border-dark);
}

.story-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}

.story-card:hover .story-cover img {
    transform: scale(1.1);
}

.time-badge {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    background: var(--badge-cyan);
    color: white;
    font-size: 0.625rem;
    font-weight: 700;
    padding: 0.125rem 0.5rem;
    border-radius: 0.25rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    z-index: 10;
}

.chapter-badge {
    position: absolute;
    bottom: 0.5rem;
    left: 0.5rem;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 0.125rem 0.5rem;
    border-radius: 0.25rem;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.story-title {
    margin-top: 0.5rem;
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--text-light);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.2s;
}

.story-card:hover .story-title {
    color: var(--primary);
}

body.dark .story-title {
    color: var(--text-dark);
}

body.dark .story-card:hover .story-title {
    color: var(--secondary);
}

/* ========== Section Header ========== */
.section-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 0.5rem;
}

body.dark .section-header {
    border-color: var(--border-dark);
}

.section-icon {
    background: var(--primary);
    padding: 0.25rem;
    border-radius: 0.25rem;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 6px rgba(126, 34, 206, 0.3);
    transform: skewX(-6deg);
}

.section-icon .material-icons-round {
    font-size: 0.875rem;
    transform: skewX(6deg);
}

.section-title {
    font-size: 1.25rem;
    font-family: var(--font-display);
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-light);
    letter-spacing: -0.025em;
}

body.dark .section-title {
    color: white;
}

/* ========== Buttons ========== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 2.5rem;
    font-weight: 600;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    font-size: 0.875rem;
}

.btn-primary {
    background: var(--accent-blue);
    color: white;
    box-shadow: 0 4px 6px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover {
    background: #2563eb;
    transform: translateY(-2px);
}

.btn-primary:active {
    transform: translateY(0);
}

/* ========== Sidebar ========== */
.sidebar-card {
    background: var(--card-light);
    border: 1px solid var(--border-light);
    border-radius: 0.5rem;
    padding: 1.25rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

body.dark .sidebar-card {
    background: var(--card-dark);
    border-color: var(--border-dark);
}

.sidebar-header {
    display: inline-block;
    background: var(--primary);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 0.25rem 1rem;
    border-radius: 0.125rem;
    margin-bottom: 1.25rem;
    box-shadow: 0 2px 4px rgba(126, 34, 206, 0.3);
}

.sidebar-item {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    cursor: pointer;
}

.sidebar-item+.sidebar-item {
    margin-top: 1.25rem;
}

.sidebar-thumb {
    width: 4rem;
    aspect-ratio: 2/3;
    flex-shrink: 0;
    overflow: hidden;
    border-radius: 0.25rem;
    background: var(--border-light);
}

body.dark .sidebar-thumb {
    background: var(--border-dark);
}

.sidebar-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.sidebar-item:hover .sidebar-thumb img {
    transform: scale(1.1);
}

.sidebar-info {
    flex: 1;
    font-size: 0.875rem;
}

.sidebar-info h4 {
    font-weight: 700;
    font-size: 0.875rem;
    color: var(--text-light);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.3;
    margin-bottom: 0.375rem;
    transition: color 0.2s;
}

.sidebar-item:hover .sidebar-info h4 {
    color: var(--primary);
}

body.dark .sidebar-info h4 {
    color: var(--text-dark);
}

body.dark .sidebar-item:hover .sidebar-info h4 {
    color: var(--secondary);
}

.sidebar-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.6875rem;
    color: var(--text-muted-light);
}

body.dark .sidebar-meta {
    color: var(--text-muted-dark);
}

.sidebar-meta .chapter-tag {
    background: var(--bg-light);
    border: 1px solid var(--border-light);
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
}

body.dark .sidebar-meta .chapter-tag {
    background: var(--border-dark);
    border-color: var(--text-muted-dark);
}

/* ========== Footer ========== */
footer {
    background: var(--card-light);
    border-top: 1px solid var(--border-light);
    margin-top: 3rem;
    padding: 2.5rem 0;
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-muted-light);
}

body.dark footer {
    background: var(--card-dark);
    border-color: var(--border-dark);
    color: var(--text-muted-dark);
}

footer p {
    line-height: 1.7;
    max-width: 56rem;
    margin: 0 auto 1.5rem;
}

footer .footer-links {
    display: block;
    align-items: center;
}

footer .footer-links a {
    font-weight: 500;
    transition: color 0.2s;
}

footer .footer-links a:hover {
    color: var(--primary);
}

body.dark footer .footer-links a:hover {
    color: white;
}

/* ========== Responsive ========== */
@media (min-width: 640px) {
    .grid-cols-sm-3 {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 768px) {
    .main-nav {
        display: flex;
    }

    .menu-btn {
        display: none;
    }

    .sub-header-content {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }

    .grid-cols-md-4 {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (min-width: 1024px) {
    .grid-cols-lg-6 {
        grid-template-columns: repeat(6, 1fr);
    }

    .grid-cols-lg-4 {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ========== Utilities ========== */
.text-center {
    text-align: center;
}

.mt-12 {
    margin-top: 3rem;
}

.mb-6 {
    margin-bottom: 1.5rem;
}

.py-8 {
    padding-top: 2rem;
    padding-bottom: 2rem;
}

.space-y-12>*+* {
    margin-top: 3rem;
}

.flex {
    display: flex;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.gap-8 {
    gap: 2rem;
}

/* ========== Scrollbar ========== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

body.dark ::-webkit-scrollbar-thumb {
    background: #555;
}

body.dark ::-webkit-scrollbar-thumb:hover {
    background: #777;
}

/* ========== Home Intro Section ========== */
.home-intro-card {
    border: none;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
    padding: 3rem;
    position: relative;
    overflow: hidden;
}

body.dark .home-intro-card {
    background: var(--card-dark);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3);
}

.home-intro-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(to bottom, var(--primary), var(--secondary));
}

.home-intro-content {
    line-height: 1.8;
    color: var(--text-light);
    font-size: 1.0625rem;
}

body.dark .home-intro-content {
    color: var(--text-dark);
}

.home-intro-content h1,
.home-intro-content h2,
.home-intro-content h3 {
    color: var(--primary);
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    font-weight: 800;
}

body.dark .home-intro-content h1,
body.dark .home-intro-content h2,
body.dark .home-intro-content h3 {
    color: var(--secondary);
}

.home-intro-content p {
    margin-bottom: 1.25rem;
}

.home-intro-content strong {
    color: var(--primary);
}

body.dark .home-intro-content strong {
    color: var(--secondary);
}

.home-intro-content a {
    color: var(--primary);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 4px;
}

.home-intro-content a:hover {
    color: var(--primary-hover);
}

/* ========== Responsive ========== */
@media (max-width: 768px) {
    .home-intro-card {
        padding: 1.5rem;
    }
}