/*
  File: style.css
  Purpose: Main stylesheet for the Desktop Environment application.
  Project: Desktop Environment Application
  Author: AI
  Last Updated: 2024-08-07T10:00:00Z
*/

body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    background-color: #333;
    color: #fff;
    user-select: none; /* Prevent text selection on desktop elements */
    -webkit-tap-highlight-color: transparent; /* Disable tap highlight on mobile browsers */
}

#desktop {
    width: 100%;
    height: 100%; /* Ensure wallpaper covers the entire screen */
    position: relative;
    background-image: url('assets/wallpapers/default.jpg'); /* Default wallpaper */
    background-size: cover;
    background-position: center;
    overflow: hidden; /* Prevent scrollbars if content overflows, windows handle their own scroll */
}

#desktop-icons-container {
    position: absolute;
    top: 0;    /* Align to parent's top */
    left: 0;   /* Align to parent's left */
    width: 100%;  /* Fill parent's width */
    height: 100%; /* Fill parent's height */
    padding: 20px; /* Create the 20px inset for icons */
    box-sizing: border-box; /* IMPORTANT: Padding is included within width/height */
    /* right: 20px; */ /* Remove, using width/height/padding now */
    /* bottom: 20px !important; */ /* Remove */
    /* height: 500px !important; */   /* Remove temporary explicit height */
    z-index: 10;
    /* background-color: rgba(255, 0, 0, 0.2); */ /* Optional: Can remove visual debugging background */
    overflow: hidden !important; /* Keep if no scrollbars desired on this container */
}

/* Grid Overlay for Debugging */
#desktop-grid-overlay {
    position: absolute;
    top: 0; /* Relative to desktopIconsContainer */
    left: 0; /* Relative to desktopIconsContainer */
    width: 100%;
    height: 100%;
    pointer-events: none; /* Allow clicks to pass through */
    z-index: 1; /* Below icons (which are typically higher or default to higher z-index in their container) */
    overflow: hidden; /* Ensure lines don't cause scroll on the overlay itself */
}

.grid-line {
    position: absolute;
    background-color: rgba(255, 255, 255, 0.15); /* Faint white lines for visibility */
    pointer-events: none;
}

.grid-line.horizontal {
    /* width: 100%; */ /* Width will be set by JS to match grid content area */
    height: 1px;
}

.grid-line.vertical {
    /* height: 100%; */ /* Height will be set by JS to match grid content area */
    width: 1px;
}
/* End Grid Overlay */

#windows-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none; /* Allows clicks to pass through to desktop unless a window is interactive */
}

/* Basic styling for context menus - will be enhanced */
#context-menu-container {
    position: fixed; /* Fixed position to overlay everything */
    z-index: 10000; /* High z-index to be on top */
    /* Further styling in ContextMenu.js or specific CSS */
}

.context-menu {
    background-color: #2c2c2c;
    border: 1px solid #444;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    min-width: 150px;
    border-radius: 4px;
    padding: 5px 0;
}

.context-menu-item {
    padding: 8px 15px;
    cursor: pointer;
    font-size: 14px;
    color: #ccc;
}

.context-menu-item:hover {
    background-color: #0078d4;
    color: #fff;
}

.context-menu-separator {
    height: 1px;
    background-color: #444;
    margin: 5px 0;
}

/* Add a bit more style to ensure it's visible if accidentally active */
#windows-container > .app-window {
    pointer-events: auto; /* Re-enable pointer events for interactive elements */
}

/* Login Screen Styles */
#login-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--login-screen-background-color, #2c3e50);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10001; /* Higher than taskbar and context menu container */
    font-family: var(--global-font-family, sans-serif);
}

.login-container {
    background-color: var(--login-container-background-color, #fff);
    padding: 30px 40px;
    border-radius: var(--login-container-border-radius, 8px);
    box-shadow: var(--login-container-box-shadow, 0 10px 25px rgba(0,0,0,0.2));
    color: var(--login-container-text-color, #333);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-container h2 {
    margin-top: 0;
    margin-bottom: 25px;
    color: var(--login-heading-color, #333);
    font-size: 24px;
}

.login-form .form-group {
    margin-bottom: 20px;
    text-align: left;
}

.login-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: var(--login-label-color, #555);
}

.login-form input[type="text"],
.login-form input[type="password"] {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--login-input-border-color, #ccc);
    border-radius: var(--ui-elements-border-radius, 4px);
    box-sizing: border-box;
    font-size: 16px;
}

.login-form input[type="text"]:focus,
.login-form input[type="password"]:focus {
    border-color: var(--ui-accent-color, #007bff);
    box-shadow: 0 0 0 2px var(--ui-accent-focus-shadow-color, rgba(0,123,255,.25));
    outline: none;
}

/* Using .button and .primary from main.css, but can add overrides if needed */
#login-button {
    width: 100%;
    padding: 12px;
    font-size: 16px;
    margin-top: 10px; /* Add some space above the message */
}

.login-message {
    margin-top: 15px;
    font-size: 14px;
    color: var(--login-message-error-color, #e74c3c); /* Default to error color */
    min-height: 20px; /* Reserve space for messages */
}

.login-message.success {
    color: var(--login-message-success-color, #2ecc71);
}

/* Utility class */
.hidden {
    display: none !important;
} 