/**
 * Nihonkuni Dark Theme - Optimized CSS
 * Version: 2.0
 * Size: ~50KB (vs 1.4MB old file)
 * 
 * This file replaces the old main.css with a clean, optimized version
 * containing only what's needed for the dark theme manga website.
 * 
 * External dependencies (loaded separately):
 * - Bootstrap 4.6 Grid & Utilities
 * - Font Awesome Icons
 * - Owl Carousel (for sliders)
 */

/* ============================================
   CSS VARIABLES - DARK THEME
   ============================================ */
:root {
    /* Background Colors - Warmer Dark Tones */
    --bg-primary: #0f1419;
    --bg-secondary: #1a1f26;
    --bg-tertiary: #1f2937;
    --bg-hover: #252d38;
    --bg-elevated: #2d3748;
    --bg-card: #374151;

    /* Border Colors */
    --border-primary: #374151;
    --border-hover: #4b5563;
    --border-accent: rgba(16, 185, 129, 0.3);

    /* Text Colors */
    --text-primary: #ffffff;
    --text-secondary: #e5e7eb;
    --text-muted: #9ca3af;
    --text-dim: #6b7280;
    --text-accent: #10b981;
    --text-chapter: #22d3ee;

    /* Gradient Colors - New Emerald/Teal Theme */
    --gradient-primary: linear-gradient(135deg, #10b981 0%, #06b6d4 100%);
    --gradient-secondary: linear-gradient(135deg, #f97316 0%, #f59e0b 100%);
    --gradient-warning: linear-gradient(135deg, #ef4444 0%, #ec4899 100%);
    --gradient-success: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --gradient-info: linear-gradient(135deg, #06b6d4 0%, #3b82f6 100%);
    --gradient-accent: linear-gradient(90deg, #06b6d4, #3b82f6, #8b5cf6);

    /* Glassmorphism */
    --glass-bg: rgba(31, 41, 55, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

/* ============================================
   GLOBAL STYLES
   ============================================ */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-secondary);
    background: var(--bg-primary);
    margin: 0;
    padding: 0;
    padding-top: 100px;
    /* Space for floating navbar */
}

a {
    color: var(--text-accent);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--text-accent);
    text-decoration: none;
}

img {
    max-width: 100%;
    height: auto;
}

/* ============================================
   LAYOUT
   ============================================ */
.wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.content-wrapper {
    flex: 1;
    padding: 20px 15px;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

.mt-5rem {
    margin-top: 5rem;
}

/* ============================================
   CARD COMPONENT
   ============================================ */
.card {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    overflow: hidden;
    box-shadow: var(--glass-shadow), 0 0 0 1px rgba(16, 185, 129, 0.1);
    margin-bottom: 24px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(16, 185, 129, 0.2);
}

.card-header {
    padding: 24px 28px;
    background: rgba(16, 185, 129, 0.05);
    border-bottom: 1px solid var(--glass-border);
}

.card-title {
    font-size: 1.5rem;
    font-weight: 800;
    margin: 0;
    color: var(--text-primary);
    display: flex;
    gap: 12px;
    align-items: center;
    letter-spacing: -0.02em;
}

.card-title i {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.card-body {
    padding: 24px;
}

.font-title {
    font-weight: 800;
}

/* ============================================
   MANGA GRID SYSTEM
   ============================================ */
.manga-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 18px;
    padding: 10px;
}

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

@media (max-width: 991px) {
    .manga-grid.view-grid-4 {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 767px) {
    .manga-grid.view-grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

.manga-grid.sidebar {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

/* ============================================
   MANGA CARD
   ============================================ */
.manga-card {
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 0;
    border: 1px solid var(--border-primary);
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.manga-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 0;
}

.manga-card:hover {
    background: var(--bg-hover);
    transform: translateY(-8px);
    border-color: var(--border-accent);
    box-shadow: 0 12px 32px rgba(16, 185, 129, 0.2), 0 0 0 1px rgba(16, 185, 129, 0.1);
}

.manga-card:hover::before {
    opacity: 0.05;
}

.manga-cover {
    display: block;
    width: 100%;
    height: 240px;
    background-size: cover;
    background-position: center;
    border-radius: 0;
    position: relative;
    z-index: 1;
}

.sidebar .manga-cover {
    height: 140px;
}

.manga-info {
    margin-top: 0;
    padding: 14px;
    min-height: 100px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    z-index: 1;
}

.sidebar .manga-info {
    min-height: 80px;
    padding: 12px;
}

.manga-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    display: block;
    margin-bottom: 8px;
    height: 2.8em;
    /* Exactly 2 lines with line-height 1.4 */
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-clamp: 2;
    line-height: 1.4;
}

.manga-chap {
    display: inline-block;
    margin-bottom: 6px;
    color: var(--text-chapter);
    font-weight: 600;
    font-size: 0.95rem;
    transition: color 0.3s ease;
}

.manga-chap:hover {
    color: #67e8f9;
}

.manga-time {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* ============================================
   BREADCRUMB
   ============================================ */
.breadcrumb-navigation {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    padding: 14px 24px;
    background: rgba(16, 185, 129, 0.05);
    border-radius: 12px;
    margin-bottom: 24px;
    border: 1px solid var(--glass-border);
}

.breadcrumb-item {
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 500;
}

.breadcrumb-item a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.breadcrumb-item a:hover {
    color: var(--text-accent);
}

.breadcrumb-item.active {
    color: var(--text-primary);
    font-weight: 700;
}

.breadcrumb-separator {
    color: var(--text-accent);
    font-weight: 300;
    opacity: 0.4;
}

/* ============================================
   BUTTONS
   ============================================ */
/* Delete button (Grid View) */
.delete-btn {
    width: 28px;
    height: 28px;
    background: rgba(239, 68, 68, 0.05);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 6px;
    color: #ef4444;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.75rem;
}

.delete-btn:hover {
    background: #ef4444;
    border-color: #ef4444;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.modern-button {
    padding: 16px 28px;
    border-radius: 14px;
    border: none;
    font-weight: 700;
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.modern-button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.modern-button:hover::before {
    width: 300px;
    height: 300px;
}

.modern-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.modern-button-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.modern-button-primary:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.5);
    color: white;
}

/* ============================================
   EMPTY STATES
   ============================================ */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-muted);
    grid-column: 1 / -1;
}

.empty-state i {
    font-size: 72px;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 24px;
    opacity: 0.7;
}

.empty-state p {
    font-size: 17px;
    margin-bottom: 24px;
    font-weight: 500;
}

.empty-state-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: var(--gradient-primary);
    color: white;
    padding: 14px 28px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 700;
    font-size: 15px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.empty-state-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.5);
    color: white;
}

.genre-item:hover {
    background: #1f2026;
    border-color: #3a3b43;
    color: #fff;
}

@media (max-width: 480px) {
    .genre-item {
        font-size: 0.85rem;
    }
}

/* SEARCH ADVANCED ICONS */
.icon-tick::before {
    content: "\f00c";
    font-family: "Font Awesome 5 Pro";
    font-weight: 900;
    color: #2ecc71;
    margin-right: 5px;
}

.icon-cross::before {
    content: "\f00d";
    font-family: "Font Awesome 5 Pro";
    font-weight: 900;
    color: #e74c3c;
    margin-right: 5px;
}

.icon-checkbox::before {
    content: "\f0c8";
    font-family: "Font Awesome 5 Pro";
    font-weight: 400;
    /* Regular for empty square */
    color: #95a5a6;
    margin-right: 5px;
}

/* =========================================
   UTILITIES
   ========================================= */
.text-primary {
    color: var(--primary-color) !important;
}

.text-gradient-primary {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.content-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.1) 50%, transparent 100%);
    margin: 20px 0;
}

.float-right {
    float: right;
}

.link_right {
    color: var(--text-accent);
    font-size: 14px;
}

.link_right:hover {
    color: #7d90ff;
}

.tiny-text {
    font-size: 13px;
}

.text-sm-left {
    text-align: left;
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes pulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.5;
        transform: scale(1.1);
    }
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 480px) {
    .manga-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }

    .manga-grid.sidebar {
        grid-template-columns: 1fr;
    }

    .breadcrumb-navigation {
        padding: 10px 15px;
        font-size: 13px;
    }

    .card-header {
        padding: 15px 20px;
    }

    .card-body {
        padding: 15px;
    }
}

@media (max-width: 768px) {
    .content-wrapper {
        padding: 15px 10px;
    }

    .card-title {
        font-size: 1.1rem;
    }
}

@media (min-width: 1024px) {
    .content-wrapper {
        padding: 20px 80px;
    }
}

/* ============================================
   DARK MODE SPECIFIC
   ============================================ */
.dark-mode {
    background: var(--bg-primary);
    color: var(--text-secondary);
}

.hold-transition {
    transition: none;
}

/* ============================================
   LOADING STATES
   ============================================ */
.loading-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid rgba(102, 126, 234, 0.2);
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.skeleton {
    background: linear-gradient(90deg,
            rgba(255, 255, 255, 0.05) 25%,
            rgba(255, 255, 255, 0.1) 50%,
            rgba(255, 255, 255, 0.05) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* ============================================
   BOOTSTRAP GRID COMPATIBILITY
   ============================================ */
.row {
    display: flex;
    flex-wrap: wrap;
    margin-right: -15px;
    margin-left: -15px;
}

.col,
.col-md-4,
.col-md-8,
.col-md-12 {
    position: relative;
    width: 100%;
    padding-right: 15px;
    padding-left: 15px;
}

.col-md-12 {
    flex: 0 0 100%;
    max-width: 100%;
}

@media (min-width: 768px) {
    .col-md-4 {
        flex: 0 0 33.333333%;
        max-width: 33.333333%;
    }

    .col-md-8 {
        flex: 0 0 66.666667%;
        max-width: 66.666667%;
    }
}

/* ============================================
   OWL CAROUSEL COMPATIBILITY
   ============================================ */
.owl-carousel {
    display: block;
    width: 100%;
}

.owl-carousel .owl-stage-outer {
    position: relative;
    overflow: hidden;
}

.owl-carousel .owl-item {
    float: left;
    min-height: 1px;
}

.owl-carousel .owl-dots {
    text-align: center;
    margin-top: 15px;
}

.owl-carousel .owl-dot {
    display: inline-block;
    margin: 0 5px;
}

.owl-carousel .owl-dot span {
    width: 10px;
    height: 10px;
    margin: 5px 7px;
    background: rgba(255, 255, 255, 0.3);
    display: block;
    border-radius: 30px;
    transition: all 0.3s ease;
}

.owl-carousel .owl-dot.active span,
.owl-carousel .owl-dot:hover span {
    background: var(--text-accent);
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
    body {
        background: white;
        color: black;
    }

    .card {
        border: 1px solid #ddd;
        box-shadow: none;
    }
}

/* ============================================
   RATING SYSTEM - MODERN DESIGN
   ============================================ */
.h0rating {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 8px 0;
}

.rating-stars {
    display: inline-flex;
    gap: 4px;
}

.rating-star {
    font-size: 24px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    color: #4a4d5e;
    position: relative;
}

.rating-star::before {
    content: "\f005";
    font-family: "Font Awesome 5 Pro";
    font-weight: 400;
}

/* Filled star */
.rating-star.filled::before {
    font-weight: 900;
    color: #ffcf6b;
}

/* Partial-filled star (for exact decimal ratings like 2.6, 4.8) */
.rating-star.partial-filled::before {
    content: "\f005";
    font-family: "Font Awesome 5 Pro";
    font-weight: 900;
    /* Color will be applied via gradient in JS */
}

/* Hover effect */
.rating-star.hover::before {
    font-weight: 900;
    color: #ffd700;
    transform: scale(1.2);
}

/* Voted stars (disabled) */
.rating-star.voted {
    cursor: default;
    opacity: 0.8;
}

/* Thanks message */
.rating-thanks {
    margin-left: 12px;
    font-size: 14px;
    color: #2ecc71;
    font-weight: 600;
    animation: fadeIn 0.3s ease;
}

/* Error state */
.rating-error {
    color: var(--text-muted);
    font-size: 13px;
    font-style: italic;
}

/* Wrapper styling for manga info */
.manga-rating-wrapper {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
}

/* ============================================
   GLOBAL READ CHAPTER STYLING
   ============================================ */
.chapter-read,
a.chapter-read {
    opacity: 0.5;
    color: #8a92a3 !important;
    /*text-decoration: line-through !important; */
}

.chapter-read:hover,
a.chapter-read:hover {
    opacity: 0.7;
    color: #8a92a3 !important;
}

/* Specific overrides for different widgets */
.history-continue.chapter-read {
    background: rgba(138, 146, 163, 0.1);
    color: #8a92a3 !important;
}

.manga-chap.chapter-read {
    color: #8a92a3 !important;
}

/* ============================================================
   LAZY LOADING STYLES - ALL IMAGES GET FADE-IN
   ============================================================ */

/* CSS Variable for stagger animation */
.eager-item,
.lazy-item {
    --anim-delay: 0ms;
}

/* Manga image default state */
.manga-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.4s ease, transform 0.4s ease;
}

/* ========== EAGER ITEMS (Above fold - first 12) ========== */
.eager-item .manga-img {
    opacity: 0;
    transform: scale(0.96);
}

.eager-item.loaded .manga-img {
    opacity: 1;
    transform: scale(1);
    animation: eagerFadeIn 0.5s ease forwards;
    animation-delay: var(--anim-delay);
}

/* ========== LAZY ITEMS (Below fold) ========== */
.lazy-item {
    position: relative;
}

.lazy-item .manga-img {
    opacity: 0;
    transform: scale(0.96);
}

.lazy-item.loaded .manga-img {
    opacity: 1;
    transform: scale(1);
    animation: lazyFadeIn 0.4s ease forwards;
}

/* ========== LOADING STATE ========== */
.lazy-item.loading {
    pointer-events: none;
}

/* Shimmer for All Grid-style Views */
.manga-card.loading .manga-cover::after,
.sidebar-manga-item.loading .item-cover::after,
.history-item.loading .history-cover::after,
.manga-cover-wrapper.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg,
            transparent,
            rgba(255, 255, 255, 0.1),
            transparent);
    transform: translateX(-100%);
    animation: shimmer 1.2s infinite;
    pointer-events: none;
    z-index: 2;
}

/* Shimmer for List View */
.list-manga-card.loading .lmc-thumbnail::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg,
            transparent,
            rgba(255, 255, 255, 0.1),
            transparent);
    transform: translateX(-100%);
    animation: shimmer 1.2s infinite;
    pointer-events: none;
    z-index: 2;
}

/* ========== ERROR STATE ========== */
.eager-item.error .manga-img,
.lazy-item.error .manga-img {
    opacity: 0.5;
}

/* ========== ANIMATIONS ========== */
@keyframes eagerFadeIn {
    0% {
        opacity: 0;
        transform: scale(0.96) translateY(10px);
    }

    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes lazyFadeIn {
    0% {
        opacity: 0;
        transform: scale(0.96);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* ========== CONTAINER STYLES ========== */

/* Grid view - manga cover */
.manga-grid .manga-cover {
    display: block;
    width: 100%;
    aspect-ratio: 2/3;
    position: relative;
    overflow: hidden;
    background: #23232b;
}

.manga-grid .manga-cover .manga-img {
    display: block;
    width: 100%;
    height: 100%;
}

/* List view - thumbnail container */
.lmc-thumbnail {
    position: relative;
    overflow: hidden;
    background: #23232b;
}

/* ============================================================
   PERFORMANCE OPTIMIZATIONS
   ============================================================ */

.manga-card,
.list-manga-card {
    transform: translateZ(0);
    will-change: transform;
}

.manga-card:hover,
.list-manga-card:hover {
    backface-visibility: hidden;
}

.lmc-thumbnail,
.manga-cover {
    contain: layout style paint;
}

/* ============================================================
   LIST VIEW - COMPLETELY REDESIGNED
   ============================================================ */

.manga-grid.view-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 0;
}

/* ========== List Card Container ========== */
.list-manga-card {
    display: grid;
    grid-template-columns: 160px 1fr 80px;
    gap: 20px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.list-manga-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity 0.3s;
}

.list-manga-card:hover {
    border-color: var(--border-accent);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
    transform: translateX(4px);
}

.list-manga-card:hover::before {
    opacity: 1;
}

/* ========== Thumbnail ========== */
.lmc-thumbnail {
    position: relative;
    width: 160px;
    height: 220px;
    flex-shrink: 0;
}

.thumb-link {
    display: block;
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.thumb-link img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease, opacity 0.4s ease;
}

.list-manga-card:hover .thumb-link img {
    transform: scale(1.08);
}

.thumb-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, transparent 50%);
    display: flex;
    align-items: flex-end;
    padding: 12px;
    opacity: 0;
    transition: opacity 0.3s;
}

.list-manga-card:hover .thumb-overlay {
    opacity: 1;
}

.view-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #fff;
}

.view-badge i {
    color: var(--text-accent);
    font-size: 0.7rem;
}

/* ========== Content ========== */
.lmc-content {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 18px 0;
    min-width: 0;
}

.lmc-header {
    margin-bottom: 12px;
}

.lmc-title {
    margin: 0 0 8px 0;
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.4;
}

.lmc-title a {
    color: var(--text-primary);
    text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-clamp: 2;
    overflow: hidden;
    transition: color 0.2s;
}

.lmc-title a:hover {
    color: var(--text-accent);
}

.lmc-author {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* ========== Tags ========== */
.lmc-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.lmc-tags .tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 10px;
    background: rgba(16, 185, 129, 0.1);
    color: var(--text-accent);
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
    line-height: 1;
    white-space: nowrap;
    height: 26px;
    /* Explicit height for perfect centering */
}

.lmc-tags .tag:hover {
    background: rgba(16, 185, 129, 0.2);
    color: #fff;
}

/* ========== Description ========== */
.lmc-desc {
    margin: 0 0 12px 0;
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-clamp: 2;
    overflow: hidden;
}

/* ========== Footer ========== */
.lmc-footer {
    display: flex;
    align-items: center;
    gap: 16px;
    padding-top: 12px;
    margin-top: auto;
    border-top: 1px solid var(--border-primary);
}

.chapter-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: var(--gradient-primary);
    color: #fff;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s;
}

.chapter-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
    color: #fff;
    background: var(--gradient-primary);
}

.update-time {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ========== Actions ========== */
.lmc-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 18px 16px;
    background: rgba(0, 0, 0, 0.2);
    justify-content: center;
}

.btn-action {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: var(--bg-secondary);
    color: var(--text-muted);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--border-primary);
    cursor: pointer;
    outline: none;
}

.btn-read:hover {
    background: var(--gradient-primary);
    color: #fff;
}

.btn-info:hover {
    background: var(--bg-elevated);
    color: var(--text-primary);
}

/* Specific Action: Delete (List View) */
.btn-delete-history {
    background: rgba(239, 68, 68, 0.05) !important;
    color: #ef4444 !important;
    border-color: rgba(239, 68, 68, 0.2) !important;
}

.btn-delete-history:hover {
    background: #ef4444 !important;
    color: #fff !important;
    border-color: #ef4444 !important;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3) !important;
    transform: translateY(-2px) scale(1.05) !important;
}

/* ============================================================
   RESPONSIVE DESIGN (GLOBAL)
   ============================================================ */

@media (max-width: 1024px) {
    .list-manga-card {
        grid-template-columns: 140px 1fr 70px;
    }

    .lmc-thumbnail {
        width: 140px;
        height: 195px;
    }
}

@media (max-width: 768px) {
    .list-manga-card {
        grid-template-columns: 110px 1fr;
    }

    .lmc-thumbnail {
        width: 110px;
        height: 155px;
    }

    .lmc-desc {
        display: none;
    }
}

@media (max-width: 480px) {
    .list-manga-card {
        grid-template-columns: 80px 1fr 40px;
        gap: 10px;
        align-items: stretch;
        padding-right: 0;
    }

    .lmc-thumbnail {
        width: 80px;
        height: 110px;
    }

    .lmc-content {
        padding: 4px 0;
        justify-content: flex-start;
        gap: 6px;
    }

    .lmc-header {
        margin-bottom: 4px;
    }

    .lmc-title {
        font-size: 1rem;
        margin-bottom: 4px;
        line-height: 1.3;
        height: auto;
        max-height: 2.6em;
        /* Limit to 2 lines visually */
    }

    .lmc-title a {
        -webkit-line-clamp: 2;
        line-clamp: 2;
    }

    .lmc-author {
        font-size: 0.75rem;
        margin-bottom: 4px;
        display: none;
        /* Hide author on very small screens to save space */
    }

    .lmc-footer {
        padding-top: 6px;
        margin-top: 4px;
        flex-wrap: wrap;
        gap: 8px;
        border-top: none;
        /* Cleaner look on mobile */
        padding-right: 4px;
    }

    .chapter-link {
        padding: 4px 10px;
        font-size: 0.75rem;
        width: auto;
        justify-content: center;
        flex-grow: 0;
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .update-time {
        font-size: 0.7rem;
    }

    .lmc-actions {
        display: flex;
        flex-direction: column;
        padding: 4px;
        background: rgba(0, 0, 0, 0.1);
        gap: 8px;
        border-left: 1px solid rgba(255, 255, 255, 0.05);
        justify-content: center;
        align-items: center;
    }

    .btn-action {
        width: 30px;
        height: 30px;
        font-size: 0.8rem;
    }
}