/* Reset everything to native app feel */
* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Inter', sans-serif; }
body, html { width: 100%; height: 100%; overflow: hidden; background-color: #050505; }

/* LAYER 1: 3D Canvas */
#renderCanvas {
    width: 100%;
    height: 100%;
    touch-action: none;
    outline: none;
}

/* LAYER 2: UI Overlay */
#os-ui-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none; /* Lets clicks pass through the invisible UI layer */
}

/* The 2D App Windows */
.glass-panel {
    background: rgba(20, 20, 20, 0.7);
    backdrop-filter: blur(15px); /* Modern frosted glass effect */
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 30px;
    color: white;
    text-align: center;
    pointer-events: auto; /* Turn clicks back on for the window */
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.glass-panel h2 { margin-bottom: 10px; font-weight: 600; }
.glass-panel p { color: #aaa; margin-bottom: 20px; }
.glass-panel button {
    background: #00ba5d;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
}
.glass-panel button:hover { background: #00964b; }

/* Utility class to hide windows */
.hidden { opacity: 0; transform: scale(0.9); pointer-events: none; }

/* Add these new rules to the bottom of your CSS file */
.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 15px;
    padding-bottom: 10px;
}
.panel-header h2 { margin-bottom: 0; }
.close-btn { background: transparent !important; color: #888 !important; font-size: 1.2rem; padding: 0 !important; }
.close-btn:hover { color: #ff4444 !important; }

.app-window-large {
    width: 90%;
    max-width: 800px;
    height: 80vh; /* Takes up 80% of the screen height */
    display: flex;
    flex-direction: column;
}
.ql-toolbar { background: #f3f4f6; border-radius: 8px 8px 0 0; } /* Styles the editor toolbar */

.os-btn { background: #333; color: white; border: 1px solid #555; padding: 8px 15px; border-radius: 6px; cursor: pointer; transition: 0.2s; }
.os-btn:hover { background: #00ba5d; border-color: #00ba5d; }

/* --- MESSENGER APP STYLES --- */
.chat-box {
    flex-grow: 1;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    overflow-y: auto; /* Adds a scrollbar when full */
    display: flex;
    flex-direction: column;
    gap: 10px;
    height: 350px;
}

.chat-message {
    background: #2a2a2a;
    padding: 10px 15px;
    border-radius: 15px 15px 15px 2px;
    width: fit-content;
    max-width: 80%;
    text-align: left;
    font-size: 0.95rem;
}

/* Messages sent by the user */
.chat-message.self {
    background: #00ba5d;
    color: white;
    align-self: flex-end;
    border-radius: 15px 15px 2px 15px;
}

.chat-input-area {
    display: flex;
    gap: 10px;
}

.chat-input-area input {
    flex-grow: 1;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    outline: none;
}

.chat-input-area input:focus {
    border-color: #00ba5d;
}

.chat-input-area button {
    padding: 10px 20px;
    border-radius: 8px;
    background: #00ba5d;
    color: white;
    border: none;
    cursor: pointer;
    font-weight: bold;
    transition: 0.2s;
}

.chat-input-area button:hover {
    background: #00964b;
}


/* --- LAYER 1: Deep Space Background (Bottom) --- */
.space-bg {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-image: url('../assets/deep-space.jpg'); 
    background-size: cover;
    background-position: center;
    z-index: 1; /* Explicitly set as the bottom layer */
}

/* --- LAYER 3: Roku City Foreground (Top) --- */
.roku-city-track {
    position: absolute;
    bottom: 50px; 
    left: 0;
    width: 100%;
    height: 150px;
    z-index: 3; /* Sits directly in front of the 3D globe */
    overflow: hidden;
    pointer-events: none; 
}

.moving-scenery {
    display: flex;
    align-items: flex-end;
    gap: 250px; /* Space between the rover, ads, and other items */
    width: max-content;
    height: 100%;
    /* 30s is the speed. Linear keeps it smooth. Infinite makes it loop! */
    animation: driveAcrossScreen 30s linear infinite; 
}

/* The actual side-scrolling animation */
@keyframes driveAcrossScreen {
    0% { transform: translateX(100vw); } /* Start completely off the right side */
    100% { transform: translateX(-100%); } /* Drive completely off the left side */
}

/* Make the Ads Clickable again! */
.billboard-ad {
    pointer-events: auto; 
    background: #222;
    border: 2px solid #00ba5d;
    padding: 10px;
    border-radius: 8px;
    text-align: center;
}

.billboard-ad p {
    margin: 0 0 5px 0;
    font-size: 0.7rem;
    color: #888;
    letter-spacing: 2px;
}

.billboard-ad img {
    height: 80px;
    border-radius: 4px;
}

/* --- LAYER 2: The 3D OS Canvas (Middle) --- */
#renderCanvas {
    position: absolute; /* Forces it to sit neatly over the background */
    top: 0; left: 0; width: 100%; height: 100%;
    background-color: transparent !important; /* Force clear glass */
    touch-action: none;
    outline: none;
    z-index: 2; /* Sits directly on top of the space background */
}

/* --- BOOT & LOGIN SCREEN STYLES --- */
.boot-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: #050505; /* Solid dark background to hide the OS */
    z-index: 9999999 !important; /* Forces it over absolutely everything */
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: monospace;
}

.login-box {
    background: rgba(0, 20, 10, 0.8);
    padding: 40px;
    border: 1px solid #00ba5d;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 0 30px rgba(0, 186, 93, 0.15);
    width: 300px;
}

.login-box input {
    width: 90%;
    padding: 12px;
    margin: 10px 0;
    background: #111;
    border: 1px solid #333;
    border-radius: 4px;
    color: #00ba5d;
    font-family: monospace;
    outline: none;
    transition: 0.3s;
}

.login-box input:focus {
    border-color: #00ba5d;
    box-shadow: 0 0 10px rgba(0, 186, 93, 0.3);
}

.login-box button {
    width: 100%;
    padding: 12px;
    margin-top: 15px;
    background: #00ba5d;
    color: black;
    font-weight: bold;
    font-family: monospace;
    letter-spacing: 1px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: 0.3s;
}

.login-box button:hover {
    background: #00ff80;
    box-shadow: 0 0 15px #00ba5d;
}

/* --- THE FUTURISTIC DOCK --- */
#os-dock {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 20px;
    background: rgba(0, 20, 10, 0.6);
    border: 1px solid rgba(0, 186, 93, 0.4);
    backdrop-filter: blur(10px); /* The frosted glass effect */
    padding: 10px 20px;
    border-radius: 12px;
    z-index: 10005 !important;
    pointer-events: auto !important; /* Make sure it is clickable! */
    box-shadow: 0 0 20px rgba(0, 186, 93, 0.2);
}

.dock-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid #333;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease-in-out;
}

.dock-btn:hover {
    background: rgba(0, 186, 93, 0.2);
    border-color: #00ba5d;
    box-shadow: 0 0 15px #00ba5d;
    transform: translateY(-5px); /* Pops up when you hover */
}

.dock-icon {
    font-size: 24px;
    margin-bottom: 3px;
}

.dock-label {
    font-family: monospace;
    font-size: 10px;
    color: #00ba5d;
    letter-spacing: 1px;
}