/* ==========================================================================
   King Verse Encyclopedia - MYKD Cyber Gaming Theme Design System
   ========================================================================== */

@import url("https://fonts.googleapis.com/css2?family=Barlow:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,400;1,500;1,600&family=Poppins:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500&display=swap");

:root {
    --kv-bg-base: #0f1629;
    --kv-bg-surface: #131b31;
    --kv-bg-card: rgba(18, 26, 48, 0.75);
    --kv-bg-card-hover: rgba(28, 38, 70, 0.9);
    --kv-border: rgba(69, 248, 130, 0.2);
    --kv-border-gold: rgba(229, 169, 60, 0.3);
    
    --kv-primary: #45f882;      /* MYKD Bright Cyber Green */
    --kv-primary-glow: rgba(69, 248, 130, 0.35);
    --kv-gold: #e5a93c;         /* MYKD Tournament Amber/Gold */
    --kv-gold-glow: rgba(229, 169, 60, 0.35);
    --kv-blue: #00e5ff;         /* Cyan Neon */
    --kv-red: #ff3e3e;          /* Crimson Danger */
    --kv-purple: #9d4edd;
    
    --kv-text-primary: #f8fafc;
    --kv-text-secondary: #94a3b8;
    --kv-text-muted: #64748b;
    
    --tg-heading-font-family: 'Barlow', sans-serif;
    --tg-body-font-family: 'Poppins', sans-serif;
    --font-heading: 'Barlow', sans-serif;
    --font-body: 'Poppins', sans-serif;
    
    --radius-lg: 12px;
    --radius-md: 8px;
    --radius-sm: 4px;
}

/* Base Body Adjustments */
body {
    background-color: #0b0e17;
    background-image: 
        radial-gradient(circle at 10% 15%, rgba(69, 248, 130, 0.04) 0%, transparent 40%),
        radial-gradient(circle at 90% 85%, rgba(229, 169, 60, 0.04) 0%, transparent 40%),
        linear-gradient(180deg, #0b0e17 0%, #0f1629 100%);
    background-attachment: fixed;
    color: var(--kv-text-primary);
    font-family: var(--tg-body-font-family);
    min-height: 100vh;
}

/* Breadcrumb / Hero Section */
.encyclopedia-breadcrumb {
    position: relative;
    padding: 160px 0 60px;
    background: radial-gradient(circle at 50% 20%, rgba(69, 248, 130, 0.08) 0%, rgba(15, 22, 41, 0.98) 75%), url('/mykd_assets/img/bg/breadcrumb_bg01.jpg') center/cover no-repeat;
    overflow: hidden;
    border-bottom: 1px solid rgba(69, 248, 130, 0.15);
}

.encyclopedia-breadcrumb::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--kv-primary), transparent);
}

.encyclopedia-hero-title {
    font-family: var(--tg-heading-font-family);
    font-size: 3rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #fff;
    margin-bottom: 10px;
}

.encyclopedia-hero-title span {
    color: var(--kv-primary);
    text-shadow: 0 0 20px rgba(69, 248, 130, 0.5);
}

.encyclopedia-hero-desc {
    color: var(--kv-text-secondary);
    font-size: 1.05rem;
    max-width: 650px;
    margin: 0 auto 25px;
}

.encyclopedia-stats-bar {
    display: inline-flex;
    align-items: center;
    gap: 2rem;
    background: rgba(18, 26, 48, 0.85);
    border: 1px solid var(--kv-border);
    padding: 10px 28px;
    border-radius: 99px;
    backdrop-filter: blur(12px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.9rem;
    color: var(--kv-text-secondary);
}

.stat-item .stat-value {
    font-family: var(--tg-heading-font-family);
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--kv-primary);
}

/* Main Section Layout */
.encyclopedia-section {
    padding: 60px 0 100px;
}

.encyclopedia-layout {
    display: grid;
    grid-template-columns: 290px 1fr;
    gap: 2rem;
}

@media (max-width: 991px) {
    .encyclopedia-layout {
        grid-template-columns: 1fr;
    }
}

/* Sidebar Navigation */
.sidebar-nav {
    background: var(--kv-bg-card);
    backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    height: fit-content;
    position: sticky;
    top: 100px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.35);
}

.sidebar-title {
    font-family: var(--tg-heading-font-family);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--kv-gold);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    gap: 8px;
}

.sidebar-title::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 14px;
    background: var(--kv-primary);
}

.nav-menu-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nav-item-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0.9rem 1.1rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
    color: var(--kv-text-secondary);
    font-family: var(--tg-heading-font-family);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: left;
    position: relative;
    overflow: hidden;
}

.nav-item-btn .item-left {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.nav-item-btn i {
    font-size: 1.15rem;
    width: 24px;
    text-align: center;
    color: var(--kv-text-muted);
    transition: all 0.25s ease;
}

.nav-item-btn .count-badge {
    font-size: 0.75rem;
    font-family: var(--tg-body-font-family);
    padding: 2px 10px;
    border-radius: 99px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--kv-text-muted);
    font-weight: 600;
    transition: all 0.25s ease;
}

.nav-item-btn:hover {
    background: rgba(69, 248, 130, 0.05);
    color: #fff;
    border-color: rgba(69, 248, 130, 0.2);
    transform: translateX(4px);
}

.nav-item-btn:hover i {
    color: var(--kv-primary);
}

.nav-item-btn.active {
    background: linear-gradient(135deg, rgba(69, 248, 130, 0.15) 0%, rgba(229, 169, 60, 0.1) 100%);
    border-color: var(--kv-primary);
    color: #fff;
    box-shadow: 0 0 20px rgba(69, 248, 130, 0.2);
}

.nav-item-btn.active i {
    color: var(--kv-primary);
}

.nav-item-btn.active .count-badge {
    background: var(--kv-primary);
    color: #0b0e17;
    font-weight: 700;
}

/* Controls Card (Search Bar & Filter) */
.content-area {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.controls-card {
    background: var(--kv-bg-card);
    backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.search-box {
    flex: 1;
    min-width: 280px;
    position: relative;
}

.search-box i {
    position: absolute;
    left: 1.2rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--kv-text-muted);
    font-size: 1rem;
    transition: color 0.2s ease;
}

.search-input {
    width: 100%;
    padding: 0.9rem 1rem 0.9rem 3.2rem;
    background: rgba(11, 14, 23, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md);
    color: #fff;
    font-family: var(--tg-body-font-family);
    font-size: 0.95rem;
    outline: none;
    transition: all 0.25s ease;
}

.search-input:focus {
    border-color: var(--kv-primary);
    box-shadow: 0 0 20px rgba(69, 248, 130, 0.2);
    background: rgba(11, 14, 23, 0.9);
}

.search-input:focus + i {
    color: var(--kv-primary);
}

.filter-group {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.select-custom {
    padding: 0.9rem 1.4rem;
    background: rgba(11, 14, 23, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md);
    color: var(--kv-text-primary);
    font-size: 0.9rem;
    font-family: var(--tg-heading-font-family);
    font-weight: 600;
    outline: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.select-custom:focus {
    border-color: var(--kv-primary);
}

.select-custom option {
    background: #0f1629;
    color: #fff;
}

/* Sub-filter Chips */
.subfilter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding-bottom: 0.5rem;
}

.chip-btn {
    padding: 0.45rem 1.1rem;
    background: rgba(18, 26, 48, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 99px;
    color: var(--kv-text-secondary);
    font-size: 0.85rem;
    font-family: var(--tg-heading-font-family);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.chip-btn:hover {
    border-color: var(--kv-primary);
    color: #fff;
    background: rgba(69, 248, 130, 0.05);
}

.chip-btn.active {
    background: var(--kv-primary);
    color: #0b0e17;
    font-weight: 700;
    border-color: var(--kv-primary);
    box-shadow: 0 0 15px rgba(69, 248, 130, 0.4);
}

/* Category Title Header */
.category-title-header {
    font-family: var(--tg-heading-font-family);
    font-size: 1.75rem;
    font-weight: 800;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.category-title-header i {
    color: var(--kv-primary);
}

/* Cards Grid */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.25rem;
}

.encyclopedia-card {
    background: var(--kv-bg-card);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.encyclopedia-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--kv-primary), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.encyclopedia-card:hover {
    transform: translateY(-5px);
    background: var(--kv-bg-card-hover);
    border-color: var(--kv-primary);
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.4), 0 0 20px rgba(69, 248, 130, 0.15);
}

.encyclopedia-card:hover::before {
    opacity: 1;
}

.card-header-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
}

.card-icon-wrapper {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-sm);
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

.card-icon-wrapper img {
    max-width: 82%;
    max-height: 82%;
    object-fit: contain;
}

.badge-tag {
    font-size: 0.7rem;
    font-weight: 700;
    font-family: var(--tg-heading-font-family);
    padding: 3px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-premium {
    background: rgba(229, 169, 60, 0.15);
    color: var(--kv-gold);
    border: 1px solid rgba(229, 169, 60, 0.3);
}

.badge-element {
    background: rgba(69, 248, 130, 0.15);
    color: var(--kv-primary);
    border: 1px solid rgba(69, 248, 130, 0.3);
}

.card-title {
    font-family: var(--tg-heading-font-family);
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.3;
}

.card-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    background: rgba(0, 0, 0, 0.3);
    padding: 0.65rem;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.04);
    font-size: 0.8rem;
}

.stat-pair {
    display: flex;
    flex-direction: column;
}

.stat-pair .label {
    color: var(--kv-text-muted);
    font-size: 0.7rem;
    font-family: var(--tg-heading-font-family);
    text-transform: uppercase;
}

.stat-pair .val {
    font-weight: 600;
    color: var(--kv-text-primary);
}

.card-footer-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 0.6rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 0.82rem;
}

.price-tag {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-weight: 600;
    font-family: var(--tg-heading-font-family);
}

.price-gold { color: var(--kv-gold); }
.price-tokens { color: var(--kv-primary); }

/* Pagination Wrapper */
.pagination-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--kv-bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md);
    padding: 1rem 1.5rem;
    margin-top: 1.5rem;
}

.btn-page {
    padding: 0.65rem 1.4rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-sm);
    color: var(--kv-text-primary);
    font-family: var(--tg-heading-font-family);
    font-weight: 700;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.25s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-page:hover:not(:disabled) {
    background: var(--kv-primary);
    color: #0b0e17;
    border-color: var(--kv-primary);
    box-shadow: 0 0 15px rgba(69, 248, 130, 0.4);
}

.btn-page:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

/* Modal Popup Viewer */
.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(5, 8, 15, 0.85);
    backdrop-filter: blur(14px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-backdrop.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: #0f1629;
    border: 1px solid var(--kv-border);
    border-radius: var(--radius-lg);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8), 0 0 30px rgba(69, 248, 130, 0.15);
    width: 100%;
    max-width: 680px;
    max-height: 90vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-backdrop.active .modal-content {
    transform: scale(1);
}

.modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, rgba(69, 248, 130, 0.08) 0%, transparent 100%);
}

.modal-header h3 {
    font-family: var(--tg-heading-font-family);
    font-size: 1.35rem;
    font-weight: 700;
    color: #fff;
    margin: 0;
}

.btn-close-modal {
    background: transparent;
    border: none;
    color: var(--kv-text-muted);
    font-size: 1.6rem;
    cursor: pointer;
    transition: color 0.2s ease;
    line-height: 1;
}

.btn-close-modal:hover { color: var(--kv-red); }

.modal-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.swf-preview-container {
    width: 100%;
    height: 240px;
    background: #000;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.effect-box {
    background: rgba(69, 248, 130, 0.05);
    border: 1px solid rgba(69, 248, 130, 0.2);
    border-radius: var(--radius-sm);
    padding: 1rem;
    font-size: 0.9rem;
    color: #e2e8f0;
}
