/*
Theme Name: Car Games Unblocked Child
Theme URI: https://car-gamesunblocked.com
Description: Child theme for Car Games Unblocked based on My Arcade theme.
Author: Antigravity
Template: cargamesunblocked
Version: 1.0.0
Text Domain: cargamesunblocked
*/

/* Global Dark Theme Variables */
:root {
    --bg-dark: #121212;
    --bg-card: #252525;
    --text-primary: #ffffff;
    --text-secondary: #b3b3b3;
    --accent-color: #6c5ce7;
    /* CrazyGames Purple/Blue Vibe */
    --accent-hover: #5649c0;
    --header-bg: #1a1a1a;
    --sidebar-bg: #1a1a1a;
    --card-radius: 12px;
}

body,
html {
    background-color: var(--bg-dark) !important;
    background: var(--bg-dark) !important;
    color: var(--text-secondary);
    font-family: 'Open Sans', sans-serif;
    margin: 0 !important;
    padding: 0 !important;
}

/* Force override of parent theme containers */
div.all,
div.bdcn,
div.cont,
.boxed-cont {
    background-color: transparent !important;
    background: transparent !important;
    max-width: 100% !important;
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
    border: 0 !important;
}

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

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

/* --- FIXES FOR PARENT THEME OVERRIDES --- */
.bdcn {
    background-color: var(--bg-dark) !important;
    padding: 0 !important;
    max-width: 100% !important;
}

.all {
    background-color: var(--bg-dark) !important;
}

/* Header Styles */
.header-child {
    background-color: var(--header-bg);
    padding: 0;
    height: 90px;
    /* Increased height for bigger logo */
    display: flex;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.6);
    border-bottom: 3px solid var(--accent-color);
}

.header-container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.custom-logo {
    max-height: 70px;
    /* Bigger logo */
    width: auto;
    filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.1));
}

.main-nav ul {
    list-style: none;
    display: flex;
    margin: 0;
    padding: 0;
    align-items: center;
}

.main-nav li {
    margin: 0 25px;
}

.main-nav a {
    color: var(--text-primary);
    font-family: 'Russo One', sans-serif;
    /* Gaming font */
    text-transform: uppercase;
    font-size: 18px;
    /* Larger font */
    letter-spacing: 1px;
    text-shadow: 2px 2px 0px rgba(0, 0, 0, 0.5);
    padding: 5px 0;
    position: relative;
}

.main-nav a:hover {
    color: var(--accent-color);
    text-shadow: 0 0 10px var(--accent-color);
}

.social-section .social-icon {
    color: var(--text-primary);
    font-size: 22px;
    margin-left: 20px;
    transition: transform 0.2s;
}

.social-section .social-icon:hover {
    color: var(--accent-color);
    transform: scale(1.2);
}

/* Homepage Layout (CrazyGames Style) */
.crazy-layout-container {
    display: flex;
    min-height: 100vh;
    padding-top: 20px;
    /* Space below sticky header */
}

/* Fixed Sidebar */
.crazy-sidebar-wrapper {
    width: 240px;
    flex-shrink: 0;
    padding: 0 20px;
    position: sticky;
    top: 90px;
    height: calc(100vh - 90px);
    overflow-y: auto;
    /* Hide scrollbar for cleaner look */
    scrollbar-width: thin;
    scrollbar-color: #333 transparent;
}

.crazy-sidebar-wrapper::-webkit-scrollbar {
    width: 6px;
}

.crazy-sidebar-wrapper::-webkit-scrollbar-thumb {
    background-color: #333;
    border-radius: 3px;
}

/* Main Content Area */
.crazy-main-content {
    flex-grow: 1;
    padding: 0 30px 40px 10px;
    overflow: hidden;
}

.crazy-section {
    margin-bottom: 50px;
}

.section-title {
    color: var(--text-primary);
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
}

.section-title i {
    color: var(--accent-color);
    margin-right: 15px;
    font-size: 20px;
}

/* Games Grid - FORCE HORIZONTAL */
.games-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)) !important;
    gap: 20px !important;
    width: 100% !important;
    margin-top: 20px;
}

.featured-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)) !important;
    /* Larger for featured */
}

/* Game Cards */
.game-card {
    background-color: var(--bg-card);
    border-radius: var(--card-radius);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    /* Internal vertical stack is correct for card */
    height: 100%;
}

.game-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4);
    z-index: 2;
}

.game-card a {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
}

.card-image {
    position: relative;
    width: 100%;
    aspect-ratio: 4/3;
    /* Enforce aspect ratio */
    background-color: #000;
    overflow: hidden;
}

.card-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    transition: transform 0.3s ease;
}

.game-card:hover .card-image img {
    transform: scale(1.1);
    opacity: 0.8;
}

/* Featured Card Play Icon */
.play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    background: var(--accent-color);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 20px;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    opacity: 0;
}

.game-card:hover .play-icon {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

/* Card Info (Featured) */
.card-info {
    padding: 15px;
    background: var(--bg-card);
}

.game-title {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.game-rating {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 5px;
    display: block;
}

.game-rating i {
    color: #ffd700;
}

/* Card Overlay Info (Standard Grid) */
.card-overlay-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
    padding: 20px 10px 10px;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.game-card:hover .card-overlay-info {
    transform: translateY(0);
}

.card-overlay-info h3 {
    margin: 0;
    font-size: 14px;
    color: #fff;
    text-align: center;
    font-weight: 600;
}

/* Sidebar Styles - Professional & Refined */
.child-sidebar {
    background: transparent;
    padding: 0;
}

.sidebar-categories h3,
.sidebar-quick-links h3 {
    color: var(--text-primary);
    font-family: 'Russo One', sans-serif;
    font-size: 18px;
    text-transform: uppercase;
    /* border-left: 4px solid var(--accent-color); */
    /* Removed side border for cleaner look */
    padding-left: 0;
    margin-bottom: 20px;
    letter-spacing: 0.5px;
    text-shadow: 1px 1px 2px #000;
}

/* Category Grid in Sidebar/Footer */
.category-images-list {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    /* 4 Columns like homepage */
    gap: 20px !important;
    list-style: none !important;
    /* NO BULLETS */
    padding: 0 !important;
    margin: 0 !important;
}

/* Ensure links act as block cards */
.category-images-list li {
    display: block !important;
    width: 100% !important;
    list-style: none !important;
    list-style-type: none !important;
    background: none !important;
    /* Remove any background image bullets */
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
}

.category-images-list li::before,
.category-images-list li::after {
    content: none !important;
    /* Kill pseudo-element bullets */
    display: none !important;
    background: none !important;
    width: 0 !important;
    height: 0 !important;
}

.cat-link {
    display: block;
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    width: 100%;
    aspect-ratio: 16/9;
    /* Widescreen card shape */
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.05);
    background: #000;
}

.cat-link img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94), opacity 0.4s;
    opacity: 0.8;
}

/* Responsive adjustment for sidebar grid */
@media (max-width: 900px) {
    .category-images-list {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 600px) {
    .category-images-list {
        grid-template-columns: 1fr !important;
    }
}

/* Professional Hover Effect */
.cat-link:hover {
    border-color: var(--accent-color);
    box-shadow: 0 0 20px rgba(108, 92, 231, 0.6), inset 0 0 10px rgba(108, 92, 231, 0.2);
    z-index: 10;
}

.cat-link:hover img {
    transform: scale(1.05);
    /* Subtle zoom */
    opacity: 1;
}

.cat-name {
    /* Adjusted to be more subtle/professional */
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
    color: #fff;
    font-family: 'Russo One', sans-serif;
    font-size: 16px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
    transform: translateY(100%);
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 15px 10px 10px;
    text-align: center;
    transition: transform 0.3s ease;
}

.cat-link:hover .cat-name {
    transform: translateY(0);
}

/* Sidebar Footer / Legal Section Styling */
.sidebar-divider {
    height: 1px;
    background: #333;
    margin: 20px 0;
}

.sidebar-legal ul {
    list-style: none;
    padding: 0;
}

.sidebar-legal li {
    margin-bottom: 8px;
}

.sidebar-legal a {
    color: var(--text-secondary);
    font-size: 13px;
    display: flex;
    align-items: center;
    transition: color 0.2s;
}

.sidebar-legal i {
    width: 20px;
    text-align: center;
    margin-right: 8px;
    font-size: 12px;
    color: #555;
    transition: color 0.2s;
}

.sidebar-legal a:hover {
    color: #fff;
}

.sidebar-legal a:hover i {
    color: var(--accent-color);
}

.sidebar-copyright {
    margin-top: 30px;
    font-size: 11px;
    color: #555;
    text-align: center;
    line-height: 1.4;
    border-top: 1px solid #222;
    padding-top: 15px;
}

/* Sidebar when appearing as a bottom section (Non-Home Pages) */
body:not(.home) .crazy-sidebar-wrapper,
body:not(.home) .sdbr-cn,
.page .crazy-sidebar-wrapper,
.page .sdbr-cn {
    width: 100% !important;
    max-width: 100% !important;
    padding: 40px 0 !important;
    background: transparent !important;
    border: none !important;
    height: auto !important;
    position: static !important;
    /* Unstick it */
    top: auto !important;
    overflow: visible !important;
    display: block !important;
    float: none !important;
    margin-top: 40px !important;
    border-top: 1px solid #222 !important;
}

/* Hide scrollbar completely */
.crazy-sidebar-wrapper::-webkit-scrollbar {
    display: none;
}

/* Ensure inner content fits well */
.child-sidebar {
    padding-bottom: 0px !important;
}

/* Fix Card Images */
.card-image img {
    object-fit: cover;
    width: 100%;
    height: 100%;
}

/* Footer Styles */
.child-footer {
    background-color: var(--header-bg);
    color: var(--text-secondary);
    margin-top: 0;
    /* Connected to layout */
    padding-top: 40px;
    position: relative;
    z-index: 10;
}

.footer-widgets-area .cont {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.footer-widget-column {
    flex: 1;
    min-width: 250px;
    margin-bottom: 30px;
    padding: 0 15px;
}

.footer-widget-column h4 {
    color: var(--accent-color);
    margin-bottom: 20px;
}

.footer-link-bar {
    border-top: 1px solid #333;
    padding: 20px 0;
}

.footer-legal-links {
    list-style: none;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    padding: 0;
    margin: 0;
}

.footer-legal-links li {
    margin: 0 15px;
}

.footer-legal-links a {
    color: var(--text-secondary);
    font-size: 14px;
}

/* Pagination */
.pagination {
    margin-top: 30px;
    text-align: center;
    width: 100%;
    grid-column: 1 / -1;
    display: flex;
    justify-content: center;
    gap: 10px;
}

.pagination a,
.pagination span {
    padding: 8px 16px;
    background: var(--bg-card);
    border-radius: 4px;
    color: var(--text-primary);
    font-weight: bold;
}

.pagination .current {
    background: var(--accent-color);
    color: #fff;
}

/* Hiding unwanted modals and login widgets */
#modal-login,
.widget_mabp_user_login,
.modal,
#login-modal,
.user-panel,
.search-form-modal {
    display: none !important;
}

/* --- GREAT FOOTER (Rich/Futuristic) - FORCED FIX --- */
#crazy-custom-footer {
    background-color: #0d0d0d !important;
    background-image: linear-gradient(to bottom, #1a1a1a, #0d0d0d) !important;
    border-top: 3px solid var(--accent-color) !important;
    color: #a0a0a0 !important;
    padding-top: 60px !important;
    margin-top: 50px !important;
    font-size: 14px !important;
    position: relative !important;
    z-index: 100 !important;
    display: block !important;
    width: 100% !important;
    float: none !important;
    clear: both !important;
}

#crazy-custom-footer .footer-content-wrapper {
    max-width: 1400px !important;
    width: 100% !important;
    margin: 0 auto !important;
    padding: 0 40px !important;
    display: block !important;
    box-sizing: border-box !important;
}

/* --- SIMPLIFIED LAYOUT & GRID --- */
.crazy-layout-container {
    display: block;
    width: 100%;
}

.crazy-main-content.full-width-content {
    display: block;
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
    padding: 20px 40px;
    box-sizing: border-box;
}

.crazy-section {
    margin-bottom: 60px;
    width: 100%;
    display: block;
}

/* Category Grid - 4 Columns */
.home-category-grid {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 20px !important;
    width: 100%;
}

.home-cat-card {
    display: block;
    aspect-ratio: 16/9;
    position: relative;
    border-radius: 12px;
    overflow: hidden;
}

/* Games Grid - Auto Fill */
.games-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)) !important;
    gap: 20px !important;
    width: 100%;
}

/* --- NEW MODERN FOOTER CSS --- */
#modern-footer {
    background: #0a0a0a;
    border-top: 1px solid #333;
    padding: 60px 20px;
    margin-top: 60px;
    color: #888;
    font-size: 14px;
}

.footer-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    /* Safety wrap */
    gap: 40px;
}

/* Brand Section */
.footer-brand {
    flex: 1;
    min-width: 250px;
    padding-right: 20px;
}

.footer-logo-img {
    height: 50px;
    width: auto;
    margin-bottom: 15px;
    filter: brightness(0.9);
}

.footer-tagline {
    color: #fff;
    font-family: 'Russo One', sans-serif;
    font-size: 16px;
    margin: 0 0 10px 0;
    letter-spacing: 0.5px;
}

.footer-desc {
    font-size: 13px;
    line-height: 1.5;
    color: #666;
    max-width: 300px;
}

/* Navigation Section */
.footer-nav {
    flex: 2;
    min-width: 300px;
}

.footer-heading {
    display: block;
    color: #fff;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 1px;
    margin-bottom: 20px;
    opacity: 0.6;
}

.footer-links-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    /* 3 Columns of links */
    gap: 15px 30px;
}

.footer-links-grid a {
    color: #aaa;
    text-decoration: none;
    transition: color 0.2s, transform 0.2s;
    font-weight: 500;
}

.footer-links-grid a:hover {
    color: var(--accent-color);
    transform: translateX(5px);
}

/* --- TOP PICKS SLIDER (Scroll Snap) --- */
.horizontal-scroll-snap {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-bottom: 20px;
    /* Space for scrollbar if visible */
    width: 100%;
    -webkit-overflow-scrolling: touch;
}

.featured-slide-item {
    flex: 0 0 calc(20% - 16px);
    /* 5 items visible (100% / 5 = 20%) minus gap adjustment */
    min-width: 200px;
    /* Minimum width safety */
    scroll-snap-align: start;
}

/* Hide scrollbar but keep functionality */
.horizontal-scroll-snap::-webkit-scrollbar {
    height: 8px;
}

.horizontal-scroll-snap::-webkit-scrollbar-track {
    background: #1a1a1a;
    border-radius: 4px;
}

.horizontal-scroll-snap::-webkit-scrollbar-thumb {
    background: var(--accent-color);
    border-radius: 4px;
}

@media (max-width: 1200px) {
    .featured-slide-item {
        flex: 0 0 calc(25% - 15px);
    }

    /* 4 items */
}

@media (max-width: 900px) {
    .featured-slide-item {
        flex: 0 0 calc(33.33% - 14px);
    }

    /* 3 items */
}

@media (max-width: 600px) {
    .featured-slide-item {
        flex: 0 0 calc(50% - 10px);
    }

    /* 2 items */
}

/* Social Section */
.footer-social {
    flex: 1;
    min-width: 200px;
    text-align: right;
}

.social-links {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-bottom: 20px;
}

.social-pill {
    background: #222;
    color: #fff;
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    transition: background 0.3s;
    border: 1px solid #333;
}

.social-pill:hover {
    background: var(--accent-color);
    border-color: var(--accent-color);
}

.footer-copy {
    font-size: 12px;
    color: #444;
}

/* Responsive Footer */
@media (max-width: 900px) {
    .footer-container {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .footer-brand,
    .footer-nav,
    .footer-social {
        width: 100%;
        padding: 0;
        text-align: center;
    }

    .footer-links-grid {
        justify-content: center;
        max-width: 400px;
        margin: 0 auto;
    }

    .social-links {
        justify-content: center;
    }
}

/* HIDE PARENT THEME FOOTER ELEMENTS */
.footer-copyright,
.site-info,
.copyright,
#footer-bottom,
.footer-bottom-simple,
.copyright-section {
    display: none !important;
}

/* Ensure my footer is visible */
#crazy-custom-footer {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Responsive Footer */
/* End of Child Theme Styles */