/* ===== Global Variables & Reset ===== */
:root {
    --bg-dark: #bed3e0;
    --text-primary: #1e293b; /* Dark slate for contrast against light blue */
    --font-main: 'Outfit', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    user-select: none; /* OS-like feel */
}

body, html {
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    font-family: var(--font-main);
    color: var(--text-primary);
    background-color: var(--bg-dark);
}

/* ===== Background Animation ===== */
.dynamic-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: linear-gradient(135deg, #bed3e0 0%, #a4c3d8 50%, #e0ebf2 100%);
    overflow: hidden;
    filter: blur(60px);
}

.blob {
    position: absolute;
    border-radius: 50%;
    animation: drift 20s infinite alternate ease-in-out;
}

.shape-1 {
    width: 40vw;
    height: 40vw;
    background: rgba(43, 108, 176, 0.4); /* Royal Blue */
    top: -10%;
    left: -10%;
}

.shape-2 {
    width: 30vw;
    height: 30vw;
    background: rgba(144, 203, 251, 0.6); /* Cyan / Light Blue */
    bottom: -10%;
    right: -5%;
    animation-delay: -5s;
}

.shape-3 {
    width: 25vw;
    height: 25vw;
    background: rgba(255, 255, 255, 0.5); /* White highlight */
    top: 40%;
    left: 40%;
    animation-delay: -10s;
}

@keyframes drift {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(10vw, 10vh) scale(1.2); }
}

/* ===== Boot Screen Overlay ===== */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 1s ease, backdrop-filter 1s ease;
    background-color: var(--bg-dark); /* Solid background initially */
}

.overlay.hidden {
    opacity: 0;
    pointer-events: none;
    z-index: -10;
}

.boot-content {
    text-align: center;
    width: 300px;
}

.logo {
    font-size: 3.5rem;
    font-weight: 600;
    letter-spacing: 2px;
    margin-bottom: 2rem;
    color: var(--text-primary);
    animation: bootPulse 2s infinite ease-in-out;
}

.loading-bar-container {
    width: 100%;
    height: 6px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.loading-bar {
    height: 100%;
    width: 0%;
    background: #2b6cb0; /* Royal blue */
    transition: width 0.2s ease;
}

#boot-text {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-primary);
    opacity: 0.8;
}

@keyframes bootPulse {
    0%, 100% { opacity: 0.6; transform: scale(0.98); }
    50% { opacity: 1; transform: scale(1.02); }
}

/* ===== GlassMorphism Panels & Login UI ===== */
.glass-panel {
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 16px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.1);
}

.login-panel {
    padding: 3rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 380px;
    transition: transform 0.3s ease;
}

.avatar {
    border-radius: 50%;
    border: 4px solid rgba(255,255,255,0.8);
    margin-bottom: 1rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.login-subtext {
    color: var(--text-primary);
    opacity: 0.7;
    font-size: 0.95rem;
    margin-bottom: 2rem;
}

.primary-btn {
    padding: 0.8rem 2.5rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    color: white;
    cursor: pointer;
    background: #2b6cb0; /* Royal blue */
    border: none;
    box-shadow: 0 4px 15px rgba(43, 108, 176, 0.4);
    transition: all 0.3s ease;
}

.primary-btn:hover {
    background: #1e4b82;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(43, 108, 176, 0.6);
}

/* ===== Main Desktop Environment ===== */
#desktop {
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    transition: opacity 1s ease;
}

#desktop.hidden {
    opacity: 0;
    pointer-events: none;
}

#desktop-grid {
    flex-grow: 1;
    padding: 2rem;
    position: relative;
    /* Grid system will go here for icons */
}

/* ===== Taskbar ===== */
#taskbar {
    height: 56px;
    margin: 12px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1rem;
    z-index: 9000;
}

.glass-icon {
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.glass-icon:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.taskbar-apps {
    flex-grow: 1;
    display: flex;
    gap: 0.5rem;
    padding: 0 1.5rem;
}

.taskbar-status {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    font-size: 0.95rem;
    font-family: var(--font-mono);
    font-weight: 600;
    color: var(--text-primary);
}

/* ===== Desktop Icons ===== */
#desktop-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    align-content: flex-start;
}

.desktop-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 80px;
    cursor: pointer;
    transition: transform 0.2s;
    z-index: 10;
}

.desktop-icon:hover {
    transform: scale(1.05);
}

.icon-img {
    width: 60px;
    height: 60px;
    font-size: 2rem;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 14px;
    margin-bottom: 0.5rem;
}

.icon-label {
    text-shadow: 0 1px 4px rgba(0,0,0,0.3);
    font-size: 0.9rem;
    font-weight: 500;
}

/* ===== OS Window ===== */
.os-window {
    position: absolute;
    top: 10%;
    left: 10%;
    width: 500px;
    height: 350px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 100;
}

.window-header {
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1rem;
    cursor: move; /* Indicates the window can be grabbed */
}

.window-title {
    font-weight: 600;
    font-size: 0.95rem;
}

.window-controls {
    display: flex;
    gap: 8px;
}

.control-btn {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
}

.btn-close { background-color: #ff5f56; }
.btn-min { background-color: #ffbd2e; }
.btn-max { background-color: #27c93f; }

.window-content {
    flex-grow: 1;
    background: rgba(255, 255, 255, 0.5);
    padding: 1rem;
    overflow-y: auto;
    transition: opacity 0.2s;
}

/* Window States */
.window-maximized {
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: calc(100vh - 80px) !important; /* leaves room for taskbar */
    border-radius: 0 !important;
    transform: none !important;
}

.window-minimized {
    height: 40px !important; /* Only shows header */
}
.window-minimized .window-content {
    opacity: 0;
}

/* ===== Terminal App ===== */
.terminal-container {
    background-color: rgba(10, 10, 15, 0.85); /* Dark transparent background */
    height: 100%;
    width: 100%;
    border-radius: 8px;
    padding: 1rem;
    font-family: var(--font-mono);
    color: #4ade80; /* Hacker green */
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    font-size: 0.9rem;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.5);
}

#terminal-output div {
    margin-bottom: 0.3rem;
    word-wrap: break-word;
}

.terminal-input-line {
    display: flex;
    margin-top: 0.5rem;
}

.prompt {
    color: #60a5fa; /* Blue prompt */
    margin-right: 0.5rem;
    white-space: nowrap;
}

#term-input {
    background: transparent;
    border: none;
    color: #4ade80;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    flex-grow: 1;
    outline: none;
}
