/*
Theme Name: My Gaming Theme
Theme URI: https://tvojsajt.com
Author: Tvoje Ime
Description: Custom gaming tema sa collapsible sidebarom
Version: 1.0
*/

/* Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: #0a0c15;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #e0e0e0;
}

/* Layout */
.site-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Collapsible Sidebar - SKUPLJENO STANJE (samo ikonice) */
.game-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 70px;
    height: 100vh;
    background: linear-gradient(135deg, #1a1e2c 0%, #0f1119 100%);
    overflow-x: hidden;
    overflow-y: auto;
    transition: width 0.3s ease;
    z-index: 1000;
}

/* Hover - širi se na 250px */
.game-sidebar:hover {
    width: 250px;
}

/* Main content - pomera se kad je sidebar proširen */
.main-content {
    flex: 1;
    margin-left: 70px;
    transition: margin-left 0.3s ease;
    padding: 20px;
}

.game-sidebar:hover + .main-content,
.game-sidebar:hover ~ .main-content {
    margin-left: 250px;
}

/* Menu stilovi */
.sidebar-menu {
    list-style: none;
    padding: 20px 0;
}

.sidebar-menu li {
    margin: 0;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: #b8c0e0;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.2s;
}

.sidebar-menu a:hover {
    background: rgba(108, 92, 231, 0.15);
    color: white;
}

/* Ikonice - Font Awesome ili Dashicons */
.sidebar-menu .menu-item a:before {
    font-family: dashicons;
    font-size: 20px;
    min-width: 24px;
}

/* Tekst - sakriven u skupljenom stanju */
.sidebar-menu .menu-text {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s 0.1s;
}

/* Na hover - prikaži tekst */
.game-sidebar:hover .menu-text {
    opacity: 1;
    visibility: visible;
}

/* Game cards */
.game-card {
    background: #1a1e2c;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 20px;
    transition: transform 0.2s;
}

.game-card:hover {
    transform: translateY(-5px);
}

.game-thumbnail img {
    width: 100%;
    border-radius: 8px;
}

/* Responsive */
@media (max-width: 768px) {
    .game-sidebar {
        width: 60px;
    }
     .main-content {
        margin-left: 10 !important;
        transition: none !important;
        width: 100% !important;
        position: relative !important;
        align-items: center !important;
    }
    
    /* Osiguraj da sidebar ne utiče na main content */
    .game-sidebar {
        position: fixed !important;
        left: 0 !important;
        top: 0 !important;
        transform: translateX(-100%);
        transition: transform 0.3s ease !important;
    }
    
    .game-sidebar.mobile-open {
        transform: translateX(0) !important;
    }
    
    /* Override bilo kakvih inline stilova */
    body, .site-wrapper, .content-wrapper {
        margin-left: 0 !important;
        padding-left: 0 !important;
    }
}


/* ==================== */
/* GORNJI HEADER + SEARCH */
/* ==================== */
.site-header {
    background: linear-gradient(135deg, #1a1e2c 0%, #0f1119 100%);
    padding: 15px 20px;
    border-bottom: 1px solid #2c2f3f;
    position: sticky;
    top: 0;
    z-index: 999;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
}

.search-container {
    display: flex;
    justify-content: center;
}

.search-wrapper {
    position: relative;
    width: 100%;
    max-width: 500px;
}

.search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #6c5ce7;
    z-index: 1;
}

#ajaxGameSearch {
    width: 100%;
    padding: 14px 20px 14px 45px;
    background: #0a0c15;
    border: 2px solid #2c2f3f;
    border-radius: 50px;
    color: white;
    font-size: 16px;
    transition: all 0.3s;
}

#ajaxGameSearch:focus {
    outline: none;
    border-color: #6c5ce7;
    box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.2);
}

/* Dropdown rezultata pretrage */
.search-results-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #1a1e2c;
    border-radius: 12px;
    margin-top: 10px;
    max-height: 400px;
    overflow-y: auto;
    display: none;
    z-index: 1000;
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
    border: 1px solid #2c2f3f;
}

.search-results-dropdown.active {
    display: block;
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    text-decoration: none;
    color: #e0e0e0;
    transition: background 0.2s;
    border-bottom: 1px solid #2c2f3f;
}

.search-result-item:hover {
    background: #2c2f3f;
}

.search-result-img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 8px;
}

.search-result-title {
    font-weight: 500;
    flex: 1;
}

/* ==================== */
/* MOBILE TOGGLE DUGME */
/* ==================== */
.mobile-sidebar-toggle {
    position: fixed;
    top: 15px;
    right: 20px;
    z-index: 1001;
    background: #6c5ce7;
    border: none;
    color: white;
    width: 45px;
    height: 45px;
    border-radius: 12px;
    font-size: 24px;
    cursor: pointer;
    display: none;
    box-shadow: 0 4px 12px rgba(108, 92, 231, 0.4);
    transition: all 0.2s;
}

.mobile-sidebar-toggle:hover {
    background: #5a4ad7;
    transform: scale(1.05);
}

/* Overlay za mobilni sidebar */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1002;
    display: none;
}

.sidebar-overlay.active {
    display: block;
}

/* Dugme za zatvaranje u sidebaru (samo mobile) */
.sidebar-close-mobile {
    display: none;
    background: transparent;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 10px;
}

/* ==================== */
/* SIDEBAR (desktop verzija) */
/* ==================== */
.game-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 70px;
    height: 100vh;
    background: linear-gradient(135deg, #1a1e2c 0%, #0f1119 100%);
    overflow-x: hidden;
    overflow-y: auto;
    transition: width 0.3s cubic-bezier(0.2, 0.9, 0.4, 1.1);
    z-index: 1003;
    box-shadow: 2px 0 20px rgba(0, 0, 0, 0.3);
}

.game-sidebar:hover {
    width: 250px;
}

/* Sidebar header (logo) */
.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #2c2f3f;
    margin-bottom: 20px;
}

.sidebar-logo img {
    max-width: 120px;
    height: auto;
}

.sidebar-logo {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s;
}

.game-sidebar:hover .sidebar-logo {
    opacity: 1;
    visibility: visible;
}

/* Menu stilovi (isti kao ranije) */
.sidebar-menu {
    list-style: none;
    padding: 0;
}

.sidebar-menu li {
    margin: 0;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: #b8c0e0;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.2s;
}

.sidebar-menu a:hover {
    background: rgba(108, 92, 231, 0.15);
    color: white;
}

.menu-icon {
    min-width: 24px;
    font-size: 20px;
}

.menu-text {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s 0.1s;
}

.game-sidebar:hover .menu-text {
    opacity: 1;
    visibility: visible;
}

/* Glavni sadržaj */
.main-content {
    flex: 1;
    margin-left: 70px;
    transition: margin-left 0.3s ease;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

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

/* ==================== */
/* MOBILNI RESPONSIVE */
/* ==================== */
@media (max-width: 768px) {
    /* Sakrij desktop hover sidebar */
    .game-sidebar {
        transform: translateX(-100%);
        width: 280px;
        transition: transform 0.3s ease;
    }
    
    .game-sidebar.mobile-open {
        transform: translateX(0);
    }
    
    .game-sidebar:hover {
        width: 280px; /* Ne širi se na hover na mobile */
    }
    
    /* Prikaži mobile toggle dugme */
    .mobile-sidebar-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .sidebar-close-mobile {
        display: block;
    }
    
    .sidebar-logo {
        opacity: 1;
        visibility: visible;
    }
    
    .menu-text {
        opacity: 1;
        visibility: visible;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .content-wrapper {
        padding: 15px;
    }
    
    .search-wrapper {
        max-width: 100%;
    }
}

/* Tablet (između 769px i 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
    .game-sidebar {
        width: 60px;
    }
    
    .game-sidebar:hover {
        width: 240px;
    }
    
    .main-content {
        margin-left: 60px;
    }
}



.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    margin-top: 20px;
}

.game-card {
    background: #1a1e2c;
    border-radius: 16px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
}

.game-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 28px rgba(108, 92, 231, 0.2);
}

.game-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.game-card-image img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.game-card-title {
    padding: 15px 15px 5px;
    font-size: 18px;
    color: white;
}

.game-card-excerpt {
    padding: 0 15px 10px;
    font-size: 14px;
    color: #b8c0e0;
}

.game-card-button {
    padding: 10px 15px 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #6c5ce7;
    font-weight: bold;
}

.pagination {
    grid-column: 1/-1;
    text-align: center;
    margin-top: 40px;
}

.pagination a, .pagination span {
    display: inline-block;
    padding: 10px 15px;
    margin: 0 5px;
    background: #1a1e2c;
    border-radius: 8px;
    text-decoration: none;
    color: white;
}