@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;700;900&display=swap");

body {
    font-family: "Inter", Arial, sans-serif;
    margin: 0;
    background-color: #0a0c10;
    color: white;
    overflow: hidden; /* Prevents scrolling, acts like an OS */
}

/* =========================================
   CORE LAYOUT (SIDEBAR + WORKSPACE)
========================================= */
.webos-container {
    display: flex;
    height: 100vh;
    width: 100vw;
}

/* =========================================
   SIDEBAR
========================================= */
.sidebar {
    width: 280px;
    background: rgba(20, 24, 32, 0.95);
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    padding: 30px 20px;
    box-shadow: 5px 0 30px rgba(0, 0, 0, 0.5);
    z-index: 10;
}

/* =========================================
   SIDEBAR BRANDING (LOGO & TEXT)
========================================= */
.brand {
    display: flex;
    align-items: center;
    gap: 18px; 
    margin-bottom: 50px;
    padding-left: 10px;
}

.sidebar-logo {
    width: 60px;  
    height: 60px; 
    filter: drop-shadow(0 0 12px rgba(255, 75, 75, 0.6)); 
}

.brand h2 {
    font-size: 1.9rem; 
    font-weight: 900;
    margin: 0;
    letter-spacing: 1.5px;
}

/* =========================================
   NAVIGATION MENU
========================================= */
.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.nav-item {
    background: transparent;
    border: none;
    color: #8b949e;
    text-align: left;
    padding: 15px 20px;
    font-size: 1.1rem;
    font-weight: 500;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: white;
}

.nav-item.active {
    background: linear-gradient(90deg, rgba(255, 75, 75, 0.15), transparent);
    color: white;
    border-left: 4px solid #ff4b4b;
}

/* =========================================
   GD7 OS WIDGET
========================================= */
.gd7-widget {
    margin-top: auto;
    background: linear-gradient(135deg, #1f0505, #3a0000);
    border: 1px solid #5a1010;
    padding: 25px 20px;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(255, 0, 0, 0.15);
    transition: transform 0.3s;
}

.gd7-widget:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(255, 0, 0, 0.25);
}

.widget-title {
    margin: 0 0 15px 0;
    color: #ffb3b3;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
}

.yt-btn {
    display: block;
    background: #ff0000;
    color: white;
    text-decoration: none;
    padding: 12px 0;
    border-radius: 8px;
    font-weight: 700;
    font-size: 1.1rem;
    transition: background 0.2s;
}

.yt-btn:hover {
    background: #cc0000;
}

/* =========================================
   MAIN WORKSPACE
========================================= */
.workspace {
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at top right, #1a1e29 0%, #0a0c10 70%);
    position: relative;
}

.launch-center {
    width: 100%;
    max-width: 800px;
    padding: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: fadeIn 0.8s ease-out;
}

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

.system-title {
    font-size: 4.5rem;
    font-weight: 900;
    margin: 0;
    letter-spacing: -1px;
    background: linear-gradient(90deg, #ffffff, #a0aab5);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.subtitle {
    color: #8b949e;
    font-size: 1.2rem;
    font-weight: 500;
    margin: 15px 0 50px 0;
}

/* =========================================
   SEARCH BAR
========================================= */
.search-box {
    display: flex;
    width: 100%;
    gap: 15px;
    margin-bottom: 40px;
}

/* SCRAMJET ID PATCHES START HERE */
#sj-address {
    flex-grow: 1;
    background: rgba(255, 255, 255, 0.03);
    border: 2px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    padding: 22px 30px;
    border-radius: 16px;
    font-size: 1.2rem;
    font-family: inherit;
    outline: none;
    transition: all 0.3s ease;
    box-shadow: inset 0 2px 10px rgba(0,0,0,0.5);
}

#sj-address:focus {
    border-color: #ff4b4b;
    background: rgba(0, 0, 0, 0.6);
    box-shadow: 0 0 20px rgba(255, 75, 75, 0.2);
}

.launch-btn {
    background: #ff4b4b;
    border: none;
    color: white;
    font-weight: 800;
    font-size: 1.2rem;
    padding: 0 40px;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.2s;
    letter-spacing: 1px;
}

.launch-btn:hover {
    background: #ff6b6b;
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(255, 75, 75, 0.3);
}

/* =========================================
   ERRORS & PROXY FRAME
========================================= */
#sj-error-code:empty { display: none; }
#sj-error { color: #ff4d4d !important; margin-top: 20px; font-weight: bold; }
#sj-error-code { font-size: 14px; color: #ffb3b3; background: rgba(0,0,0,0.5); padding: 15px; border-radius: 8px; margin-top: 15px; }

/* =========================================
   NEW BROWSER TOP BAR
========================================= */
#proxy-top-bar {
    display: flex;
    align-items: center;
    background: #141820; /* Slightly matched to your sidebar color */
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    height: 60px;
    padding: 0 20px;
    gap: 20px;
    
    /* THE FIX: Lock width to the exact screen size */
    width: 100%;
    box-sizing: border-box; 
    
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1000;
}

#proxy-top-bar.hidden {
    display: none !important;
}

#home-ui.hidden {
    display: none !important;
}

.nav-controls button {
    background: transparent;
    border: none;
    color: #8b949e;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 10px;
    border-radius: 8px;
    transition: all 0.2s;
}

.nav-controls button:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.top-search-box {
    flex-grow: 1;
    display: flex;
    /* Optional: Limit how wide the search bar gets so it looks like a real browser */
    max-width: 800px; 
    margin: 0 auto; 
}

#top-address {
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 75, 75, 0.5); /* Copied your red border aesthetic */
    color: white;
    padding: 10px 20px;
    border-radius: 20px;
    font-family: inherit;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s;
}

#top-address:focus {
    border-color: #ff4b4b;
    background: rgba(0, 0, 0, 0.6);
}

.top-brand {
    font-weight: 900;
    color: #ff4b4b;
    letter-spacing: 1.5px;
    /* THE FIX: Force the text to stay on one line and not get squished */
    white-space: nowrap; 
    padding-right: 10px;
}

/* =========================================
   ERRORS & PROXY FRAME (UPDATED)
========================================= */
#sj-error-code:empty { display: none; }
#sj-error { color: #ff4d4d !important; margin-top: 20px; font-weight: bold; }
#sj-error-code { font-size: 14px; color: #ffb3b3; background: rgba(0,0,0,0.5); padding: 15px; border-radius: 8px; margin-top: 15px; }

/* The frame now sits BELOW the 60px top bar */
#sj-frame { 
    border: none; 
    position: absolute; 
    top: 60px; 
    left: 0; 
    width: 100vw; 
    height: calc(100vh - 60px); 
    background-color: #fff; 
    z-index: 999; 
}
/* =========================================
   SLIDE-DOWN AD BANNER (FROM TOP)
========================================= */
#proxy-ad-banner {
    position: absolute;
    top: 0; 
    left: 50%;
    transform: translateX(-50%) translateY(-120%); 
    width: 100%;
    max-width: 760px;
    background: #141820;
    border: 1px solid rgba(255, 75, 75, 0.3);
    border-top: none; 
    border-radius: 0 0 12px 12px; 
    z-index: 2000;
    text-align: center;
    padding: 15px;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.8); 
    transition: transform 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}

#proxy-ad-banner.show {
    transform: translateX(-50%) translateY(0); 
}

#proxy-ad-banner.hidden {
    display: none !important;
}

#close-ad-btn {
    position: absolute;
    bottom: -15px; 
    right: -10px;
    background: #ff4b4b;
    color: white;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    transition: background 0.2s, transform 0.2s;
}

#close-ad-btn:hover {
    background: #ff1a1a;
    transform: scale(1.1);
}