:root {
    --sidebar-width: 85px;
    --notch-width: 35px;
    --accent-pink: #5e99ff;
    --bg-dark: #000000;
    --panel-bg: #111111;
    --transition: 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

body, html {
    margin: 0;
    padding: 0;
    height: 100%;
    /* Added width to ensure flex-grow calculates correctly */
    width: 100vw; 
    background-color: #050505;
    color: white;
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    overflow: hidden;
    display: flex;
}

/* --- THE SIDEBAR SYSTEM --- */
.sidebar-container {
    position: fixed;
    left: 0;
    top: 0;
    height: 100%;
    display: flex;
    align-items: center;
    z-index: 1000;
    transform: translateX(calc(-1 * var(--sidebar-width)));
    transition: transform var(--transition);
}

.sidebar-container:hover {
    transform: translateX(0);
}

.sidebar-content {
    width: var(--sidebar-width);
    height: 100%;
    background-color: var(--bg-dark);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 25px 0;
    box-sizing: border-box;
}

.notch {
    width: var(--notch-width);
    height: 50px;
    background: var(--bg-dark);
    border: 2px solid var(--accent-pink);
    border-left: none;
    border-radius: 0 15px 15px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--accent-pink);
    transition: opacity 0.2s;
}

.sidebar-container:hover .notch {
    opacity: 0;
}

/* --- NAVIGATION ITEMS --- */
.nav-group {
    background: var(--panel-bg);
    border-radius: 30px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    border: 1px solid #222;
}

.nav-item {
    position: relative;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    cursor: pointer;
    color: #ccc;
    transition: all 0.2s;
}

/* Hover & Active States - NOW INCLUDES .active class */
.nav-item:hover, 
.nav-item.active {
    background-color: var(--accent-pink);
    color: white;
    box-shadow: 0 0 15px rgba(94, 118, 255, 0.4);
}

/* Tooltips */
.tooltip {
    position: absolute;
    left: 70px;
    background: var(--panel-bg);
    color: white;
    padding: 8px 15px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
    letter-spacing: 1px;
    opacity: 0;
    pointer-events: none;
    transform: translateX(-10px);
    transition: all 0.2s;
    border: 1px solid #333;
    text-transform: uppercase;
    z-index: 2000;
}

.tooltip::before {
    content: "";
    position: absolute;
    left: -6px;
    top: 50%;
    transform: translateY(-50%);
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    border-right: 6px solid var(--panel-bg);
}

.nav-item:hover .tooltip {
    opacity: 1;
    transform: translateX(0);
}

/* --- DYNAMIC VIEWPORT (FIXED FOR FULL WIDTH) --- */
.main-viewport {
    flex: 1; /* Take all remaining width */
    margin: 10px 10px 10px calc(var(--notch-width) + 10px); 
    height: calc(100vh - 20px);
    background: var(--panel-bg);
    border-radius: 24px;
    border: 1px solid #222;
    transition: margin-left var(--transition);
    box-sizing: border-box;
    overflow: hidden; /* Clips the iframe to the rounded corners */
    display: block;   /* Changed from flex to block to prevent centering issues */
}

/* Make the iframe take up every single pixel of the viewport */
.game-frame {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}   

/* Push viewport when sidebar opens */
.sidebar-container:hover ~ .main-viewport {
    margin-left: calc(var(--sidebar-width) + 10px);
}


/*Settings section starts here!!!/

/* --- SETTINGS SYSTEM --- */
.settings-wrapper {
    display: flex;
    height: 100%;
    background: var(--panel-bg);
}

.settings-nav {
    width: 200px;
    border-right: 1px solid #222;
    padding: 25px 15px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.settings-header {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #555;
    margin-bottom: 15px;
    padding-left: 10px;
    font-weight: 900;
}

.settings-nav-item {
    padding: 10px 15px;
    border-radius: 10px;
    font-size: 13px;
    color: #888;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: 0.2s;
}

.settings-nav-item:hover { background: #1a1a1a; color: white; }
.settings-nav-item.active { 
    background: rgba(94, 153, 255, 0.1); 
    color: var(--accent-pink); 
}

.settings-content {
    flex: 1;
    padding: 40px;
    overflow-y: auto;
}

.tab-content { display: none; }
.tab-content.active { display: block; animation: tabFade 0.3s ease; }

@keyframes tabFade {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

.section-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 30px;
    color: white;
}

.setting-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    border-bottom: 1px solid #1a1a1a;
}

.setting-info h3 { font-size: 15px; margin-bottom: 4px; }
.setting-info p { font-size: 12px; color: #666; }

/* Form Elements */
.settings-select, .settings-input {
    background: #000;
    border: 1px solid #333;
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 13px;
    outline: none;
}

.settings-input:focus { border-color: var(--accent-pink); }

/* Toggle Switch */
.switch { position: relative; width: 40px; height: 22px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
    position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0;
    background: #333; transition: .3s; border-radius: 34px;
}
.slider:before {
    position: absolute; content: ""; height: 16px; width: 16px;
    left: 3px; bottom: 3px; background: white; transition: .3s; border-radius: 50%;
}
input:checked + .slider { background: var(--accent-pink); }
input:checked + .slider:before { transform: translateX(18px); }

/* --- PROVIDER LIST STYLES --- */
.setting-item-vertical {
    padding: 20px 0;
    border-bottom: 1px solid #1a1a1a;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.provider-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
    width: 100%;
}

.provider-btn {
    background: #000;
    border: 1px solid #222;
    color: #666;
    padding: 12px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.provider-btn:hover {
    border-color: #444;
    color: #fff;
}

/* Matching your theme's blue accent */
.provider-btn.active {
    background: rgba(94, 153, 255, 0.05); /* Very subtle blue tint */
    border-color: var(--accent-pink);
    color: var(--accent-pink);
    box-shadow: 0 0 15px rgba(94, 153, 255, 0.2);
}