/* ==========================================================================
   GAMING UI REDESIGN STYLES
   ========================================================================== */

/* --- Layout Structure --- */
.gaming-layout {
    display: flex;
    min-height: 100vh;
    background-color: var(--bg-color);
    overflow: hidden;
}

/* --- Mobile Header --- */
.mobile-header {
    display: none;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: var(--surface-color);
    border-bottom: 1px solid var(--border-color);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.mobile-logo {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-color);
    text-shadow: 0 0 10px var(--primary-color);
}

.mobile-menu-btn {
    background: transparent;
    border: none;
    color: var(--text-color);
    cursor: pointer;
}

/* --- Sidebar Navigation --- */
.gaming-sidebar {
    width: 280px;
    background: var(--surface-color);
    border-left: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 30px 0;
    z-index: 100;
    transition: transform 0.3s ease;
    box-shadow: -5px 0 30px var(--shadow-color);
    flex-shrink: 0;
}

.sidebar-profile {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 20px 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.profile-img-wrapper {
    position: relative;
    margin-bottom: 15px;
}

.profile-img-wrapper .player-logo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid var(--primary-color);
    box-shadow: 0 0 20px rgba(187, 134, 252, 0.3);
    object-fit: cover;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.profile-img-wrapper:hover .player-logo {
    transform: scale(1.05);
    box-shadow: 0 0 30px var(--primary-color);
}

.online-status {
    position: absolute;
    bottom: 5px;
    right: 5px;
    width: 15px;
    height: 15px;
    background: #00e676;
    border-radius: 50%;
    border: 2px solid var(--surface-color);
    box-shadow: 0 0 10px #00e676;
}

.sidebar-profile .player-info {
    text-align: center;
}

.sidebar-profile h1 {
    font-size: 1.3rem;
    margin-bottom: 5px;
    color: var(--text-color);
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}

.sidebar-profile p {
    font-size: 0.85rem;
    color: var(--primary-color);
    font-weight: 600;
}

/* Sidebar Menu */
.sidebar-menu {
    flex-grow: 1;
    padding: 20px 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 20px;
    color: var(--text-muted-color);
    text-decoration: none;
    border-radius: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.menu-item:hover {
    color: var(--text-color);
    background: rgba(255, 255, 255, 0.05);
    transform: translateX(-5px);
}

.menu-item.active {
    color: var(--text-color);
    background: linear-gradient(90deg, rgba(187, 134, 252, 0.15) 0%, transparent 100%);
    border-right: 4px solid var(--primary-color);
}

.menu-item.active svg {
    color: var(--primary-color);
    filter: drop-shadow(0 0 5px var(--primary-color));
}

/* Sidebar Bottom (Action Buttons) */
.sidebar-bottom {
    padding: 0 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sidebar-bottom .menu-btn {
    width: 100%;
    justify-content: flex-start;
    padding: 12px 20px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-muted-color);
}

.sidebar-bottom .menu-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-color);
    border-color: rgba(255, 255, 255, 0.1);
}

/* Custom coloring for specific buttons */
.sidebar-bottom .btn-chat { border-color: rgba(255, 107, 107, 0.2); color: #ff6b6b; }
.sidebar-bottom .btn-chat:hover { background: rgba(255, 107, 107, 0.1); box-shadow: 0 0 15px rgba(255, 107, 107, 0.2); }
.sidebar-bottom .btn-notifications { border-color: rgba(3, 218, 198, 0.2); color: var(--secondary-color); }
.sidebar-bottom .btn-notifications:hover { background: rgba(3, 218, 198, 0.1); box-shadow: 0 0 15px rgba(3, 218, 198, 0.2); }

/* --- Main Content Area --- */
.gaming-main-content {
    flex-grow: 1;
    overflow-y: auto;
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* Custom Scrollbar for Main Content */
.gaming-main-content::-webkit-scrollbar {
    width: 8px;
}
.gaming-main-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}
.gaming-main-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}
.gaming-main-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* --- Hero Banner --- */
.hero-banner {
    position: relative;
    width: 100%;
    min-height: 300px;
    background-image: url('https://i.ibb.co/wF463tbK/d06dfc3d-91fb-45fb-aba8-52f5d87d38e0.png');
    background-size: 100% auto;
    background-position: top center;
    background-repeat: no-repeat;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 0;
    /* NO border-bottom — transition is done via gradient */
}

.hero-overlay {
    position: absolute;
    inset: 0;
    /* Fade from semi-dark at top → fully opaque bg-color at bottom so no seam */
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.15) 0%,
        rgba(0, 0, 0, 0.4) 40%,
        var(--bg-color) 100%
    );
}

.hero-content {
    position: relative;
    z-index: 2;
    padding: 40px 40px 36px;
    max-width: 700px;
    /* Sits at the bottom of the banner so text blends into content below */
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 900;
    margin-bottom: 8px;
    color: #fff;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.9), 0 0 30px var(--primary-color);
}

.hero-subtitle {
    font-size: 1.05rem;
    color: rgba(255, 255, 255, 0.75);
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.9);
    margin-bottom: 20px;
}

/* The library section title sits right inside the hero area — seamless */
.hero-section-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-color);
    opacity: 0.9;
    position: relative;
    padding-right: 15px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* SPA views container: negative top margin pulls it up to overlap the hero fade */
#spa-views-container {
    margin-top: -2px;
    position: relative;
    z-index: 2;
    background: var(--bg-color);
}

/* Invisible continuation gradient at top of content — zero visible border */
#view-library > .container::before {
    content: '';
    display: block;
    height: 1px; /* Collapsed — bg-color continuation is seamless via hero overlay */
}

/* --- Games Grid Enhancements --- */
.games-header {
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    position: relative;
    padding-right: 15px;
}

.section-title::before {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 5px;
    height: 70%;
    background: var(--primary-color);
    border-radius: 5px;
    box-shadow: 0 0 10px var(--primary-color);
}

/* Elevate Game Cards (Keeping horizontal aspect ratio) */
.game-card {
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.game-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit; /* match card's border-radius exactly */
    border: 2px solid transparent;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    pointer-events: none;
    z-index: 3;
}

.game-card:hover::after {
    border-color: var(--primary-color);
    box-shadow: inset 0 0 20px rgba(var(--primary-color-rgb, 187, 134, 252), 0.15);
}

.game-card-content {
    background: linear-gradient(to top, rgba(0,0,0,0.95) 0%, rgba(0,0,0,0.7) 60%, transparent 100%);
    padding: 20px 15px 15px;
    transform: translateY(10px);
}

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

.game-name {
    font-size: 1rem;
    letter-spacing: 0.5px;
}

.play-icon {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
    width: 60px;
    height: 60px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.game-card:hover .play-icon {
    transform: scale(1.1) translateY(-10px);
    background: var(--primary-color);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 10px 20px rgba(187, 134, 252, 0.4);
}

/* Ensure the main container has enough padding */
.gaming-main-content .container {
    padding: 24px 40px 120px;
}

/* Library view specifically — smaller top gap since hero already sets context */
#view-library .container {
    padding-top: 28px;
}

/* Smooth visual separator for non-library views that don't have a hero */
.page-view:not(#view-library) .container {
    padding-top: 36px;
}

/* Footer position */
.gaming-main-content .site-footer {
    margin-top: auto;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(0, 0, 0, 0.2);
}

/* --- Mobile Responsiveness --- */
@media (max-width: 992px) {
    .mobile-header {
        display: flex;
    }
    
    .gaming-layout {
        flex-direction: column;
    }
    
    .gaming-main-content {
        height: calc(100vh - 60px);
        margin-top: 60px;
    }

    .gaming-sidebar {
        position: fixed;
        top: 60px;
        bottom: 0;
        right: -280px;
        width: 280px;
        border-left: none;
        border-right: 1px solid rgba(255, 255, 255, 0.05);
    }
    
    .gaming-sidebar.active {
        right: 0;
    }
    
    .hero-banner {
        padding: 30px 20px;
        min-height: 200px;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .gaming-main-content .container {
        padding: 20px;
        padding-bottom: 80px;
    }
}

/* --- Professional Settings Modal --- */
#settingsModal .modal-content {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    box-shadow: 0 20px 50px var(--shadow-color), inset 0 0 0 1px var(--border-color);
    border-radius: 20px;
    max-width: 650px;
    color: var(--text-color);
    padding: 30px;
}

#settingsModal h3 {
    text-align: center;
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 25px;
    color: var(--text-color);
    text-shadow: 0 0 15px var(--primary-color);
    letter-spacing: 1px;
}

/* Settings Tabs */
.settings-tabs {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 15px;
}

.settings-tab {
    background: transparent;
    border: none;
    color: var(--text-muted-color);
    font-size: 1.1rem;
    font-weight: 600;
    padding: 10px 20px;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.settings-tab:hover {
    color: var(--text-color);
    background: var(--bg-color-light);
}

.settings-tab.active {
    color: var(--bg-color); /* Contrast for active state */
    background: var(--primary-color);
    box-shadow: 0 0 15px var(--primary-color);
}

/* Form Elements */
.form-group label {
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.05rem;
}

.form-group select, .form-input {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    border-radius: 12px;
    padding: 12px 15px;
    font-size: 1rem;
    transition: all 0.3s ease;
    width: 100%;
}

.form-group select:focus, .form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 15px rgba(var(--primary-color), 0.3);
}

.form-group select option {
    background: var(--bg-color);
    color: var(--text-color);
}

/* Theme Previews */
.theme-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 15px;
    margin-top: 10px;
}

.theme-preview {
    border-radius: 12px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.theme-preview::before {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0.8;
    z-index: 1;
}

.theme-preview-label {
    position: relative;
    z-index: 2;
    font-weight: 700;
    font-size: 0.9rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.8);
    color: #fff;
    text-align: center;
    padding: 5px;
}

.theme-preview:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
}

.theme-preview.selected {
    border-color: #fff;
    transform: scale(1.05);
}

.theme-preview.selected::after {
    content: '✓';
    position: absolute;
    top: 5px;
    right: 5px;
    background: #fff;
    color: #000;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    z-index: 3;
}

/* Theme specific preview backgrounds */
/* === THEME PREVIEWS === */
.theme-preview.theme-dark::before { background: linear-gradient(135deg, #1e1e1e, #bb86fc); }
.theme-preview.theme-stealth-red::before { background: linear-gradient(135deg, #130303, #e53935); }
.theme-preview.theme-toxic-green::before { background: linear-gradient(135deg, #031a03, #69f542); }
.theme-preview.theme-glacier-blue::before { background: linear-gradient(135deg, #020c1b, #29b6f6); }
.theme-preview.theme-cyberpunk::before { background: linear-gradient(135deg, #0d0220, #f9e600, #ff2d55); }
.theme-preview.theme-esports-purple::before { background: linear-gradient(135deg, #0e001a, #ce93d8); }
.theme-preview.theme-midnight-oled::before { background: linear-gradient(135deg, #000000, #2c2c2c, #e0e0e0); }
.theme-preview.theme-arctic-white::before { background: linear-gradient(135deg, #eef2f7, #ffffff); }
.theme-preview.theme-solar-flare::before { background: linear-gradient(135deg, #1c0700, #ff8f00); }
.theme-preview.theme-synthwave::before { background: linear-gradient(135deg, #0f001e, #e040fb, #00e5ff); }
.theme-preview.theme-light-gaming::before { background: linear-gradient(135deg, #eef2f7, #0077cc, #7c3aed); }
.theme-preview.theme-brawler-toon::before { background: linear-gradient(135deg, #1a0a2e, #ff6b35, #ffd700); }
.theme-preview.theme-pixel-adventure::before { background: linear-gradient(135deg, #1a2a1a, #7dda58, #f5c842); }

/* Custom Save Button */
.settings-actions {
    margin-top: 30px;
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 20px;
}

.btn-save-settings {
    background: var(--primary-gradient);
    color: #fff;
    border: none;
    padding: 12px 30px;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.btn-save-settings:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4), 0 0 15px var(--primary-color);
}


.collections-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 20px;
}

.games-selection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 10px;
    max-height: 250px;
    overflow-y: auto;
    padding: 10px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}
.game-select-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    cursor: pointer;
    padding: 5px;
    border-radius: 8px;
    transition: all 0.3s;
    border: 2px solid transparent;
}
.game-select-item img {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    object-fit: cover;
    margin-bottom: 5px;
}
.game-select-item.selected {
    border-color: var(--primary-color);
    background: rgba(var(--primary-color-rgb), 0.2);
}
.game-select-name {
    font-size: 0.75rem;
    color: var(--text-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.collection-folder {
    background: color-mix(in srgb, var(--surface-color) 80%, transparent);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}
.collection-folder:hover {
    transform: translateY(-5px);
    border-color: var(--primary-color);
    box-shadow: 0 5px 20px rgba(0,0,0,0.3);
}
.folder-icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
}
.folder-name {
    font-weight: bold;
    color: var(--text-color);
    margin-bottom: 5px;
}
.folder-count {
    font-size: 0.8rem;
    color: var(--text-muted-color);
}
.add-new-folder {
    border: 1px dashed var(--border-color);
    background: transparent;
}
.add-new-folder:hover {
    border-color: var(--primary-color);
    background: color-mix(in srgb, var(--primary-color) 10%, transparent);
}


/* ==========================================================================
   SETTINGS PAGE VIEW - Full Page Layout
   ========================================================================== */

#view-settings.settings-view {
    background: transparent;
}

#view-settings .container {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 30px 80px;
}

#view-settings .pro-tabs {
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.07);
    padding: 8px;
    margin-bottom: 30px;
    gap: 6px;
    justify-content: flex-start;
    flex-wrap: wrap;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

#view-settings .pro-tabs .settings-tab {
    border-radius: 8px;
    border: none;
    padding: 10px 20px;
    font-size: 0.95rem;
    margin-bottom: 0;
    border-bottom: none;
}

#view-settings .pro-tabs .settings-tab.active {
    background: var(--primary-color);
    color: #000;
    border-bottom-color: transparent;
}

#view-settings .pro-modal-header {
    border-bottom: none;
    text-align: right;
    padding: 0 0 20px 0;
}

#view-settings .pro-modal-header h3 {
    font-size: 2rem;
    font-weight: 700;
}

#view-settings .form-group {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 14px;
    padding: 20px 22px;
    margin-bottom: 16px;
}

#view-settings .form-group label {
    display: block;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 12px;
}

#view-settings .form-group select,
#view-settings .form-group input[type="text"] {
    width: 100%;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--text-color);
    padding: 10px 14px;
    font-size: 0.95rem;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

#view-settings .form-group select:focus,
#view-settings .form-group input[type="text"]:focus {
    outline: none;
    border-color: var(--primary-color);
}

#view-settings .pro-settings-form {
    padding: 0;
}

#view-settings .pro-settings-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 24px 0 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    margin-top: 20px;
    gap: 12px;
    flex-wrap: wrap;
}

#view-settings .theme-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
}

#view-settings .cursor-preview-grid {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}
