/* ==========================================================================
   PENTO MODERN GAMING DESIGN SYSTEM & THEME
   Elevates Header, Navigation, Explore, Cards, and General Page Layouts
   ========================================================================== */

:root {
    --pento-bg-dark: #0c0d14;
    --pento-surface-1: #131522;
    --pento-surface-2: #1b1e30;
    --pento-surface-glass: rgba(19, 21, 34, 0.88);
    --pento-surface-card: rgba(27, 30, 48, 0.92);
    --pento-border-subtle: rgba(255, 255, 255, 0.08);
    --pento-border-glow: rgba(138, 43, 226, 0.35);
    
    --pento-neon-purple: #8b5cf6;
    --pento-neon-pink: #ec4899;
    --pento-neon-rose: #f43f5e;
    --pento-neon-cyan: #06b6d4;
    --pento-neon-blue: #3b82f6;
    --pento-neon-green: #10b981;
    --pento-neon-amber: #f59e0b;
    
    --pento-text-main: #f9fafb;
    --pento-text-muted: #9ca3af;
    --pento-text-dim: #6b7280;
    
    --pento-font-sans: 'Vazirmatn', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --pento-header-height: 74px;
}

/* Global Font & Link Fixes (Overrides broken 1.4vw global links) */
body {
    font-family: var(--pento-font-sans) !important;
    background-color: var(--pento-bg-dark) !important;
    color: var(--pento-text-main);
}

a {
    font-size: inherit !important;
    text-decoration: none !important;
    transition: all 0.25s ease;
}

/* ==========================================================================
   HEADER & NAVIGATION BAR
   ========================================================================== */

#header-section {
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1050;
    background: var(--pento-surface-glass) !important;
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-bottom: 1px solid var(--pento-border-subtle);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
    transition: all 0.3s ease;
    padding: 0;
}

#header-section .overlay {
    background: transparent !important;
    padding: 0;
}

.pento-header-container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

.pento-navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: var(--pento-header-height);
    padding: 8px 0;
}

/* Brand Logo */
.pento-brand-logo {
    height: 44px;
    max-height: 44px;
    width: auto;
    filter: drop-shadow(0 0 12px rgba(138, 43, 226, 0.35));
    transition: transform 0.3s ease, filter 0.3s ease;
}

.pento-brand-logo:hover {
    transform: scale(1.05);
    filter: drop-shadow(0 0 16px rgba(236, 72, 153, 0.5));
}

/* Navbar Menu List */
.pento-navbar .main-menu {
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 0 auto;
    padding: 0;
    list-style: none;
}

.pento-navbar .main-menu > li {
    position: relative;
    list-style: none;
}

.pento-navbar .main-menu > li > a {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 15px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    color: rgba(255, 255, 255, 0.85) !important;
    border-radius: 12px;
    line-height: 1.4 !important;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.pento-navbar .main-menu > li > a:hover {
    color: #fff !important;
    background: rgba(255, 255, 255, 0.08);
}

/* Highlighted Menu Items */
.pento-navbar .main-menu > li > a.nav-link-explore {
    color: #f43f5e !important;
    background: rgba(244, 63, 94, 0.08);
    border: 1px solid rgba(244, 63, 94, 0.25);
}

.pento-navbar .main-menu > li > a.nav-link-explore:hover {
    background: rgba(244, 63, 94, 0.18);
    border-color: rgba(244, 63, 94, 0.5);
    box-shadow: 0 0 16px rgba(244, 63, 94, 0.3);
}

.pento-navbar .main-menu > li > a.nav-link-dev {
    color: #34d399 !important;
}

.pento-navbar .main-menu > li > a.nav-link-dev:hover {
    background: rgba(16, 185, 129, 0.12);
}

.pento-navbar .main-menu > li > a.nav-link-news {
    color: #38bdf8 !important;
}

.pento-navbar .main-menu > li > a.nav-link-news:hover {
    background: rgba(56, 189, 248, 0.12);
}

.pento-navbar .main-menu > li > a.nav-link-create-post {
    color: #fff !important;
    background: linear-gradient(135deg, #06b6d4 0%, #3b82f6 100%);
    box-shadow: 0 4px 14px rgba(6, 182, 212, 0.35);
    padding: 8px 16px !important;
}

.pento-navbar .main-menu > li > a.nav-link-create-post:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(6, 182, 212, 0.5);
}

.nav-badge-new {
    background: linear-gradient(135deg, #ec4899, #8b5cf6);
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 8px;
    letter-spacing: 0.5px;
    box-shadow: 0 0 10px rgba(236, 72, 153, 0.5);
}

/* Dropdown Sub-Menus */
.pento-navbar .pento-dropdown-menu,
.navbar-collapse .main-menu li .sub-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: 230px;
    background: var(--pento-surface-card) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--pento-border-subtle) !important;
    border-radius: 16px !important;
    padding: 8px !important;
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.65), 0 0 1px 1px rgba(255, 255, 255, 0.05) !important;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 100;
    display: block !important;
}

.pento-navbar .main-menu li:hover > .sub-menu,
.pento-navbar .main-menu li:hover > .pento-dropdown-menu,
.navbar-collapse .main-menu li:hover > .sub-menu {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) !important;
}

.pento-dropdown-menu li,
.sub-menu li {
    list-style: none !important;
    margin: 2px 0 !important;
    width: 100% !important;
}

.pento-dropdown-menu li a,
.sub-menu li a {
    display: flex !important;
    align-items: center !important;
    padding: 10px 14px !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    color: var(--pento-text-main) !important;
    border-radius: 10px !important;
    transition: all 0.2s ease !important;
    line-height: 1.4 !important;
}

.pento-dropdown-menu li a:hover,
.sub-menu li a:hover {
    background: rgba(255, 255, 255, 0.08) !important;
    color: #fff !important;
    transform: translateX(4px);
}

.pento-dropdown-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.07);
    margin: 6px 0;
}

.pento-flag-img {
    width: 22px;
    height: 16px;
    object-fit: cover;
    border-radius: 3px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
    display: inline-block;
    flex-shrink: 0;
}

/* User Profile Capsule / Auth Action Buttons */
.pento-user-capsule {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 30px;
    padding: 4px 14px 4px 6px;
    transition: all 0.25s ease;
}

.pento-user-capsule:hover {
    background: rgba(255, 255, 255, 0.09);
    border-color: rgba(138, 43, 226, 0.4);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.pento-username-label {
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    max-width: 130px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pento-signout-btn {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #f87171 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: all 0.2s ease;
}

.pento-signout-btn:hover {
    background: #ef4444;
    color: #fff !important;
    transform: scale(1.1);
}

/* Auth Buttons (Logged Out) */
.pento-btn-login {
    color: #fff !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    padding: 8px 18px !important;
    border-radius: 20px !important;
    border: 1px solid rgba(255, 255, 255, 0.18) !important;
    background: rgba(255, 255, 255, 0.06) !important;
    margin-right: 8px;
    transition: all 0.25s ease !important;
}

.pento-btn-login:hover {
    background: rgba(255, 255, 255, 0.15) !important;
    border-color: rgba(255, 255, 255, 0.35) !important;
    color: #fff !important;
}

.pento-btn-join {
    color: #fff !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    padding: 8px 22px !important;
    border-radius: 20px !important;
    background: linear-gradient(135deg, #7928ca 0%, #ff0080 100%) !important;
    box-shadow: 0 4px 16px rgba(255, 0, 128, 0.35) !important;
    border: none !important;
    transition: all 0.25s ease !important;
}

.pento-btn-join:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(255, 0, 128, 0.5) !important;
    color: #fff !important;
}

/* Mobile Toggler */
.pento-toggler {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: all 0.25s ease;
}

.pento-toggler:hover, .pento-toggler:focus {
    background: rgba(255, 255, 255, 0.14);
    outline: none !important;
    box-shadow: none !important;
}

@media (max-width: 991px) {
    .pento-navbar .navbar-collapse {
        background: var(--pento-surface-card);
        border: 1px solid var(--pento-border-subtle);
        border-radius: 18px;
        padding: 20px;
        margin-top: 15px;
        box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
        max-height: 80vh;
        overflow-y: auto;
    }
    
    .pento-navbar .main-menu {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        width: 100%;
    }
    
    .pento-navbar .main-menu > li > a {
        padding: 12px 16px !important;
        width: 100%;
        justify-content: space-between;
    }
    
    .pento-navbar .sub-menu {
        position: static !important;
        opacity: 1 !important;
        visibility: visible !important;
        transform: none !important;
        box-shadow: none !important;
        border: none !important;
        background: rgba(0, 0, 0, 0.25) !important;
        margin-top: 6px;
        padding: 6px !important;
        display: none !important;
    }

    .pento-navbar .main-menu li.show > .sub-menu {
        display: block !important;
    }
}

/* ==========================================================================
   EXPLORE CONTENT HUB ENHANCEMENTS
   ========================================================================== */

.explore-container {
    max-width: 1240px;
    margin: 30px auto 60px;
    padding: 0 16px;
}

.explore-header-card {
    background: radial-gradient(circle at 10% 20%, rgba(138, 43, 226, 0.15) 0%, rgba(20, 23, 36, 0.95) 70%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 25px 30px;
    margin-bottom: 25px;
    box-shadow: 0 16px 45px rgba(0, 0, 0, 0.4);
    position: relative;
    overflow: hidden;
}

.explore-header-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #ec4899, #8b5cf6, #3b82f6);
}

.explore-header-title {
    font-size: 24px;
    font-weight: 800;
    margin: 0;
    background: linear-gradient(135deg, #fff 30%, #ec4899 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.explore-search-input-box {
    position: relative;
    width: 100%;
}

.explore-search-input-box input {
    width: 100%;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 30px;
    padding: 12px 46px 12px 20px;
    color: #fff;
    font-size: 13px;
    outline: none;
    transition: all 0.25s ease;
}

.explore-search-input-box input:focus {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--pento-neon-purple);
    box-shadow: 0 0 20px rgba(138, 43, 226, 0.3);
}

.explore-search-input-box i {
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--pento-text-muted);
}

/* Filter Chips Strip */
.pento-filter-strip {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    padding: 12px 0 4px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.pento-filter-strip::-webkit-scrollbar {
    display: none;
}

.pento-chip {
    white-space: nowrap;
    padding: 8px 18px;
    border-radius: 30px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.09);
    color: var(--pento-text-muted);
    font-size: 13px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.25s ease;
    cursor: pointer;
}

.pento-chip:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.2);
}

.pento-chip.active {
    background: linear-gradient(135deg, #7928ca 0%, #ff0080 100%);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 4px 18px rgba(255, 0, 128, 0.4);
    font-weight: 700;
}

/* View Switcher Pills */
.pento-view-pills {
    display: inline-flex;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 4px;
    gap: 4px;
}

.pento-view-pills .view-mode-btn {
    border: none;
    background: transparent;
    color: var(--pento-text-muted);
    padding: 8px 16px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pento-view-pills .view-mode-btn:hover {
    color: #fff;
}

.pento-view-pills .view-mode-btn.active {
    background: var(--pento-neon-purple);
    color: #fff;
    box-shadow: 0 2px 10px rgba(138, 43, 226, 0.5);
}

/* Reels Vertical Feed Overhaul */
.reels-feed-container {
    max-width: 480px !important;
    height: 82vh !important;
    margin: 15px auto !important;
    border-radius: 24px !important;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.85), 0 0 35px rgba(138, 43, 226, 0.2) !important;
    position: relative;
    background: #000;
}

.reels-post-item {
    height: 82vh !important;
    min-height: 82vh !important;
    border-radius: 24px;
}

@media (max-width: 576px) {
    .reels-feed-container {
        max-width: 100% !important;
        height: calc(100vh - var(--pento-header-height)) !important;
        border-radius: 0 !important;
        margin: 0 !important;
        border: none !important;
    }
    .reels-post-item {
        height: calc(100vh - var(--pento-header-height)) !important;
        min-height: calc(100vh - var(--pento-header-height)) !important;
        border-radius: 0 !important;
    }
}

/* ==========================================================================
   HOMEPAGE & CATEGORIES REFINED CARDS
   ========================================================================== */

/* Modern Responsive Game Slideshow Container */
.slideshow-container {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 20px;
    padding: 24px 20px;
    margin: 30px 0 !important;
    position: relative;
}

.slideshow-container h2 {
    font-size: 22px !important;
    font-weight: 700 !important;
    color: #fff !important;
    margin-bottom: 18px !important;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.slideshow-container .slides {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding: 10px 4px 18px;
    scrollbar-width: thin;
    scrollbar-color: rgba(138, 43, 226, 0.4) transparent;
}

.slideshow-container .slides::-webkit-scrollbar {
    height: 6px;
}

.slideshow-container .slides::-webkit-scrollbar-thumb {
    background: rgba(138, 43, 226, 0.4);
    border-radius: 10px;
}

.slideshow-container .slide {
    flex: 0 0 auto !important;
    display: flex !important;
    flex-direction: column;
    align-items: center;
    width: 135px !important;
    transition: transform 0.25s ease;
}

.slideshow-container .slide:hover {
    transform: translateY(-4px);
}

.slideshow-container .gameposter {
    width: 100% !important;
    text-align: center;
}

.slideshow-container .slides img {
    width: 110px !important;
    height: 110px !important;
    border-radius: 18px !important;
    object-fit: cover;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
    border: 2px solid rgba(255, 255, 255, 0.08);
    transition: all 0.25s ease;
}

.slideshow-container .slide:hover img {
    border-color: var(--pento-neon-purple);
    box-shadow: 0 12px 30px rgba(138, 43, 226, 0.35);
}

.slideshow-container .slides h3 {
    font-size: 13px !important;
    font-weight: 600 !important;
    margin: 8px 0 4px !important;
    color: #fff !important;
    max-width: 120px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    text-align: center;
}

/* Category Page Controls */
.pento-category-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    background: var(--pento-surface-card);
    border: 1px solid var(--pento-border-subtle);
    border-radius: 18px;
    padding: 16px 20px;
    margin-bottom: 30px;
}

.pento-custom-select {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    color: #fff;
    padding: 8px 16px;
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s ease;
}

.pento-custom-select:focus {
    border-color: var(--pento-neon-purple);
}

.pento-category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 20px;
    padding: 15px 0;
}

/* Bootstrap 4 / 5 Compatibility & Modern Layout Utilities */
.gap-1 { gap: 0.25rem !important; }
.gap-2 { gap: 0.5rem !important; }
.gap-3 { gap: 1rem !important; }
.gap-4 { gap: 1.5rem !important; }
.gap-5 { gap: 3rem !important; }

.me-1 { margin-right: 0.25rem !important; }
.me-2 { margin-right: 0.5rem !important; }
.me-3 { margin-right: 1rem !important; }
.ms-1 { margin-left: 0.25rem !important; }
.ms-2 { margin-left: 0.5rem !important; }
.ms-3 { margin-left: 1rem !important; }

[dir="rtl"] .me-1 { margin-left: 0.25rem !important; margin-right: 0 !important; }
[dir="rtl"] .me-2 { margin-left: 0.5rem !important; margin-right: 0 !important; }
[dir="rtl"] .me-3 { margin-left: 1rem !important; margin-right: 0 !important; }
[dir="rtl"] .ms-1 { margin-right: 0.25rem !important; margin-left: 0 !important; }
[dir="rtl"] .ms-2 { margin-right: 0.5rem !important; margin-left: 0 !important; }
[dir="rtl"] .ms-3 { margin-right: 1rem !important; margin-left: 0 !important; }

.fw-bold { font-weight: 700 !important; }
.fw-semibold { font-weight: 600 !important; }
.fw-normal { font-weight: 400 !important; }

/* Enhanced Card & Glass Utilities */
.pento-glass-card {
    background: var(--pento-surface-card);
    border: 1px solid var(--pento-border-subtle);
    border-radius: 20px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}
