/* Arquivo: css/style.css */

/* ===================================== */
/* 0. VARIÁVEIS E ROOT                   */
/* ===================================== */
:root {
    --main-red: #e60012;
    --scrollbar-track-color: #f8f8f8;
}

html, body {
    min-width: 512px;
    min-height: 440px;
    
    overflow: auto;
}

/* ===================================== */
/* 1. SCROLLBAR CUSTOM                   */
/* ===================================== */
/* WebKit Browsers (Chrome, Safari, Edge) */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--scrollbar-track-color);
}
::-webkit-scrollbar-thumb {
    background: var(--main-red);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: #c00010;
}

/* Firefox Browsers */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--main-red) var(--scrollbar-track-color);
}

/* ===================================== */
/* 2. FONTES PERSONALIZADAS              */
/* ===================================== */
@font-face {
    font-family: 'SuperFamiFont';
    src: url('../assets/fonts/SuperFamifont-Bgmw.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

/* ===================================== */
/* 3. BODY & ESTILOS GERAIS              */
/* ===================================== */
body {
    background-color: #f8f9fa;
    font-family: 'SuperFamiFont', 'Segoe UI', Tahoma, Verdana, sans-serif;
    overflow-x: hidden;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ===================================== */
/* 4. CABEÇALHO & SFC BAR                */
/* ===================================== */
header {
    background-color: white;
    padding: 15px 0;
}
.sfc-bar {
    display: flex;
    width: 100%;
    height: 8px;
}
.sfc-bar div {
    flex: 1;
}
.bg-green   { background-color: #00a04c; }
.bg-yellow  { background-color: #fecf08; }
.bg-blue    { background-color: #007ac0; }
.bg-red     { background-color: #e60012; }

/* ===================================== */
/* 5. GRID & BLOCOS                      */
/* ===================================== */
.custom-grid-container {
    display: contents;
}

.grid-wrapper {
    display: grid;
    
    grid-template-columns: repeat(auto-fill, 100px);
    
    gap: 15px;
    
    justify-content: center;
    
    width: clamp(465px, 100vw, 1395px);
    margin: 0 auto;
    padding: 10px;
}

.container-main {
    width: 100%;
}

.grid-item {
    width: 100px;
    height: 100px;
    border-radius: 12px;
    cursor: pointer;
    position: relative;
    
    justify-self: start;
}

.grid-item:hover {
    z-index: 5;
}

.double-item {
    grid-column: span 2;
    width: 215px;
    height: 100px;
}

#categories-container::before {
    content: "";
    grid-column: 1 / -1; /* 👈 ocupa a linha inteira */
    height: 0;
}

/* ===================================== */
/* 6. STICKY BLOCK & LOGO BUSCA          */
/* ===================================== */

.sticky-block {
    position: sticky;
    top: 20px;
    z-index: 1000;
    background-color: transparent;
}

.logos-search-wrapper {
    display: flex;
    width:100%;
    height:100%;
    padding: 10px 15px;
    border: 1px solid #e6e6e6;
    border-radius: 12px;
    background: #fff;
    justify-content: space-between;
    align-items: center;
}

.left-sidebar {
    display: flex;
    flex-direction: column;
    width: 35px;
    
    border-right: 1px solid #ccc;
    position: relative;
    
    bottom: -25px;
    left: 35px;
    
    height: calc(100% - 30px);
}

.sidebar-btn {
    flex: 1;
    display: flex;
    cursor: pointer;
    background: #fff;
    transition: background 0.2s;
    justify-content: center;
    align-items: center;
    margin: 13px;
    
    position: relative;
    bottom: -25px;
    left: -18px;
}

.sidebar-btn:hover {
    background-color: #f2f2f2;
}

.border-bottom-gray {
    border-bottom: 1px solid #ccc;
    position: relative;
    left: -50px;
    width: calc(100% + 99px);
}

.search-icon {
    color: #444;
}

.top-logo-area {
    position: absolute;
    bottom: 60px;
    left: 35px;
}

.btn-todos {
    width: 100%;
    background: linear-gradient(135deg, #ff1d25, #ff5e64);
    border-radius: 12px;
}

/* Responsividade do sidebar/logo */
@media (max-width: 600px) {
    .logo-search-wrapper {
        max-width: 90%;
        margin: 0 auto;
    }
    .left-sidebar {
        width: 45px;
    }
}

/* ===================================== */
/* 7. JOGOS → IMAGENS & OVERLAY          */
/* ===================================== */
.game-wrapper {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    border: 3px solid;
    border-radius: 12px;
    overflow: hidden;
    box-sizing: border-box;
}
.game-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.game-overlay {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    padding-bottom: 5px;
    background-color: rgba(0, 0, 0, 0.6);
    opacity: 0;
    transition: opacity 0.2s ease-in-out;
    justify-content: flex-end;
    align-items: center;
}
.game-wrapper:hover .game-overlay {
    opacity: 1;
}

/* Estrelas de avaliação */
.game-rating {
    display: flex;
    gap: 1px;
    margin-bottom: 2px;
    font-size: 0.7rem;
    color: #ffd700;
}
.game-rating i {
    color: #ffd700;
    text-shadow: 1px 1px 0 rgba(0,0,0,0.3);
}

.game-rating i .far {
    color: rgba(255,255,255,0.5);
}

/* Título do jogo no overlay */
.game-title-overlay {
    font-family: 'SuperFamiFont', sans-serif;
    color: white;
    font-size: 0.65rem;
    text-align: center;
    line-height: 0.8;
    word-break: break-word;
    max-width: 90%;
    padding-bottom: 8px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.7);
}

/* ===================================== */
/* 8. BOX DE CATEGORIAS                  */
/* ===================================== */
.cat-wrapper-todos {
    display: flex;
    
    text-align: center;
    
    width: 100%;
    height: 100%;
    
    background-color: #FF3D44;
    border-radius: 12px;
    border: 1px solid #ddd;
    padding: 10px 15px;
    color: #FFFFFF;
    
    justify-content: center;
    align-items: center;
}

.cat-wrapper-todos:hover {
    background-color: #F03040;
    border-color: #bbb;
    
    justify-content: center;
    align-items: center;
}

.cat-wrapper-todos i {
    font-size: 1.5rem;
    
    color: #FFFFFF;
    
    justify-content: center;
    align-items: center;
    text-align: center;
}

.cat-wrapper {
    display: flex;
    
    width: 100%;
    height: 100%;
    
    background-color: #eeeeee;
    border-radius: 12px;
    border: 1px solid #ddd;
    
    padding: 10px 15px;
    color: #333;
    
    align-items: center;
    justify-content: center;
    
    flex-direction: column;
}

.cat-wrapper:hover {
    background-color: #e0e0e0;
    border-color: #bbb;
}

.cat-wrapper i {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: #222;
}

.cat-text {
    font-size: 0.75rem;
    font-weight: bold;
    text-transform: uppercase;
    text-align: center;
}

/* Responsividade categorias */
@media (max-width: 600px) {
    .cat-wrapper {
        justify-content: center;
        text-align: center;
        flex-direction: column;
        gap: 5px;
        padding: 12px;
    }
    .cat-wrapper i {
        margin: 0;
    }
}

/* ===================================== */
/* 9. SOBRE PAGE SIDEBAR                 */
/* ===================================== */
.sobre-sidebar-wrapper {
    width: 203px;
    margin: 0;
}

.info-roms-p {
    display: flex;
    gap: 2px;
}

@media (max-width: 600px) {
    .sobre-sidebar-wrapper {
        width: 95%;
        margin: 0 auto;
    }
}

/* ===================================== */
/* 10. FOOTER & BOTÃO LEVEL UP           */
/* ===================================== */
.footer-box {
    width: 100%;
    position: relative;
    background-color: transparent;
}

.footer-box .container {
    position: relative;
    justify-content: center;
    align-items: center;
}


/* Responsividade footer */
@media (max-width: 600px) {
    .level-up-btn {
        position: static;
        margin: 20px auto;
    }
    .footer-box {
        text-align: center;
    }
}

/* ===================================== */
/* 11. MODAL DE BUSCA (FULLSCREEN)       */
/* ===================================== */
.modal-search-content {
    width: 100%;
    height: 100vh;
    background-color: #f8f8f8;
}

.modal-header-custom {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 20px 15px 10px 15px;
    background: transparent;
}

.modal-body-search {
    margin-top: 30px;
}

.btn-close-custom {
    background: none;
    border: none;
    align-self: flex-start;
    padding: 0;
    cursor: pointer;
    margin: 20px;
    font-size: 1.5rem;
    color: #333;
}

.btn-close-custom i {
    color: rgba(0,0,0,0.7);
    transition: 0.2s;
}

.btn-close-custom:hover i {
    color: #000;
}

.search-box-container {
    width: 100%;
    display: flex;
    justify-content: center;
    padding: 10px;
}

.search-box {
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 650px;
    background-color: #fff;
    border-radius: 50px;
    padding: 8px 15px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.search-input {
    flex-grow: 1;
    border: none;
    outline: none;
    padding: 0;
    font-size: 1rem;
    color: #333;
}

.search-input::placeholder {
    color: #888;
    font-weight: 500;
}

.search-loading-icon {
    font-size: 1.2rem;
    color: #007ac0;
    margin-right: 10px;
}

.search-button-modal {
    background: none;
    border: none;
    margin-left: 10px;
    font-size: 1rem;
    color: #999;
    cursor: pointer;
}

/* ===================================== */
/* 12. CHIPS DE CATEGORIAS              */
/* ===================================== */
.category-chips-container {
    height: 50px;
    overflow-x: auto;
    margin-top: 30px;
    margin-bottom: 30px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.category-chips-container::-webkit-scrollbar {
    display: none;
}

.cat-wrapper-chips {
    width: fit-content; /* Adicione essa linha */
    height: 100%;
    background-color: #eeeeee;
    border-radius: 12px;
    border: 1px solid #ddd;
    padding: 10px 15px;
    color: #333;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}


.category-chip-scroll {
    margin-left: 25px;
    margin-right: 25px;
    display: flex;
    gap: 10px;
}

.category-chip {
    text-decoration: none;
    color: #fff;
    padding: 8px 15px;
    border-radius: 50px;
    border: 2px solid transparent;
    font-size: 0.85rem;
    font-weight: bold;
    text-transform: uppercase;
    white-space: nowrap;
}

.category-chip:hover {
    opacity: 0.8;
}

.blue-chip   { background-color: #007ac0; }
.red-chip    { background-color: #e60012; }
.green-chip  { background-color: #00a04c; }
.yellow-chip { background-color: #fecf08; color: #333; }
.active-chip { border-color: #fff; }

/* Responsive Chips Centralization */
@media (max-width: 600px) {
    .category-chips-container {
        justify-content: center;
    }
}