/* Desktop Environment Styles */

/* Desktop Container */
#desktop {
    width: 100vw;
    height: 100vh;
    background: url('../img/wallpaper-kronberg.svg') center center / cover no-repeat,
                linear-gradient(135deg, #1a3a4a 0%, #0d2535 50%, #051520 100%);
    position: relative;
    overflow: hidden;
}

/* Desktop Icons */
.desktop-icons {
    position: absolute;
    top: 16px;
    left: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.desktop-icon {
    width: 80px;
    padding: 8px;
    text-align: center;
    cursor: pointer;
    border: 1px solid transparent;
    border-radius: 2px;
}

.desktop-icon:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
}

.desktop-icon.selected {
    background: rgba(0, 0, 128, 0.5);
    border-color: rgba(255, 255, 255, 0.5);
}

.desktop-icon-img {
    width: 48px;
    height: 48px;
    margin: 0 auto 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
}

.desktop-icon-label {
    font-size: 12px;
    color: white;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
    word-wrap: break-word;
}

/* Taskbar */
#taskbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--taskbar-height);
    background: var(--taskbar-bg);
    border-top: 2px outset var(--window-border);
    display: flex;
    align-items: center;
    padding: 2px 4px;
    z-index: 9999;
}

/* Start Button */
#start-button {
    height: 28px;
    padding: 2px 8px;
    background: var(--sap-light-gray);
    border: 2px outset var(--window-border);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: bold;
    font-size: 12px;
}

#start-button:active {
    border: 2px inset var(--sap-dark-gray);
}

#start-button .icon {
    font-size: 16px;
}

/* Taskbar Items */
.taskbar-items {
    display: flex;
    gap: 2px;
    margin-left: 8px;
    flex: 1;
    overflow-x: auto;
}

.taskbar-item {
    height: 26px;
    min-width: 120px;
    max-width: 180px;
    padding: 2px 8px;
    background: var(--sap-light-gray);
    border: 2px outset var(--window-border);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
}

.taskbar-item.active {
    border: 2px inset var(--sap-dark-gray);
    background: #d0d0d0;
}

.taskbar-item:hover {
    background: #f0f0f0;
}

.taskbar-item .icon {
    font-size: 14px;
}

.taskbar-item .title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* System Tray */
.system-tray {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 8px;
    border-left: 2px inset var(--sap-dark-gray);
    margin-left: auto;
    height: 100%;
}

.tray-icon {
    font-size: 14px;
    cursor: pointer;
    padding: 2px;
}

.tray-icon:hover {
    background: rgba(0, 0, 0, 0.1);
}

.tray-clock {
    font-size: 12px;
    padding: 4px 8px;
    border: 1px inset var(--sap-dark-gray);
    background: var(--sap-light-gray);
    min-width: 70px;
    text-align: center;
}

/* Start Menu */
#start-menu {
    position: fixed;
    bottom: var(--taskbar-height);
    left: 0;
    width: 280px;
    background: var(--sap-gray);
    border: 2px outset var(--window-border);
    display: none;
    z-index: 10000;
}

#start-menu.visible {
    display: block;
}

.start-menu-header {
    background: linear-gradient(to bottom, var(--sap-blue), var(--sap-dark-blue));
    color: white;
    padding: 8px;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 8px;
}

.start-menu-header .avatar {
    width: 40px;
    height: 40px;
    background: var(--sap-light-gray);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.start-menu-items {
    padding: 4px;
}

.start-menu-item {
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    font-size: 12px;
}

.start-menu-item:hover {
    background: var(--sap-blue);
    color: white;
}

.start-menu-item .icon {
    font-size: 20px;
    width: 24px;
    text-align: center;
}

.start-menu-separator {
    height: 1px;
    background: var(--sap-dark-gray);
    margin: 4px 8px;
}

/* Status Indicators */
.status-indicators {
    position: fixed;
    top: 16px;
    right: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 100;
}

.status-indicator {
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 150px;
}

.status-indicator .icon {
    font-size: 16px;
}

.status-indicator .bar {
    flex: 1;
    height: 8px;
    background: #333;
    border-radius: 4px;
    overflow: hidden;
}

.status-indicator .bar-fill {
    height: 100%;
    transition: width 0.3s, background-color 0.3s;
}

.status-indicator .bar-fill.energy {
    background: linear-gradient(to right, #f39c12, #f1c40f);
}

.status-indicator .bar-fill.low {
    background: linear-gradient(to right, #e74c3c, #c0392b);
}

.status-indicator .bar-fill.stress {
    background: linear-gradient(to right, #e74c3c, #9b59b6);
}

/* Game HUD */
#game-hud {
    position: fixed;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 24px;
    border-radius: 8px;
    display: flex;
    gap: 24px;
    font-size: 12px;
    z-index: 100;
}

.hud-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.hud-item .icon {
    font-size: 16px;
}

.hud-item .value {
    font-weight: bold;
    font-family: var(--font-mono);
}

.hud-item .value.positive {
    color: #2ecc71;
}

.hud-item .value.negative {
    color: #e74c3c;
}

.hud-item.clickable {
    cursor: pointer;
    padding: 4px 8px;
    margin: -4px -8px;
    border-radius: 4px;
    transition: background-color 0.15s ease, transform 0.1s ease;
}

.hud-item.clickable:hover {
    background: rgba(255, 255, 255, 0.15);
}

.hud-item.clickable:active {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(0.97);
}

/* Dual Level Display in HUD */
.hud-levels {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.hud-level-row {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    line-height: 1.2;
}

.hud-level-row .icon {
    font-size: 12px;
}

.hud-level-row:first-child {
    color: #90caf9; /* SAP blue tint */
}

.hud-level-row:last-child {
    color: #a5d6a7; /* Career green tint */
}

/* Responsive HUD */
@media (max-width: 768px) {
    #game-hud {
        padding: 6px 12px;
        gap: 12px;
        font-size: 11px;
        top: 8px;
    }

    .hud-item .icon {
        font-size: 14px;
    }

    .hud-item.clickable {
        padding: 4px 6px;
        margin: -4px -6px;
    }

    /* Hide weekday on smaller screens */
    #hud-weekday {
        display: none;
    }
}

@media (max-width: 540px) {
    #game-hud {
        padding: 6px 10px;
        gap: 8px;
        font-size: 10px;
        border-radius: 6px;
    }

    .hud-item .icon {
        font-size: 12px;
    }

    /* Compact mode - hide some text */
    #hud-day {
        display: none;
    }

    #hud-level {
        max-width: 60px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

@media (max-width: 400px) {
    #game-hud {
        width: calc(100% - 16px);
        left: 8px;
        transform: none;
        justify-content: space-between;
        gap: 4px;
    }

    .hud-item.clickable {
        padding: 4px;
        margin: -4px;
    }
}

/* Notification Toast */
.notification-toast {
    position: fixed;
    bottom: 60px;
    right: 16px;
    background: white;
    border: 2px outset var(--window-border);
    padding: 12px 16px;
    min-width: 280px;
    max-width: 350px;
    z-index: 9000;
    animation: slideIn 0.3s ease-out;
    cursor: pointer;
}

.notification-toast.hiding {
    animation: slideOut 0.3s ease-in forwards;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

.notification-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-weight: bold;
    font-size: 12px;
}

.notification-header .icon {
    font-size: 16px;
}

.notification-body {
    font-size: 12px;
    color: #333;
}

.notification-toast.email .notification-header {
    color: #2980b9;
}

.notification-toast.phone .notification-header {
    color: #27ae60;
}

.notification-toast.meeting .notification-header {
    color: #8e44ad;
}

.notification-toast.boss .notification-header {
    color: #c0392b;
}

/* ==========================================================================
   CONTEXT MENU - Windows 98 Style
   ========================================================================== */

.context-menu {
    display: none;
    position: fixed;
    z-index: 99999;
    min-width: 180px;
    max-width: 280px;
    background: #c0c0c0;
    border: 2px outset #dfdfdf;
    box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    padding: 2px;
    font-size: 13px;
}

.context-menu-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 24px 4px 4px;
    cursor: default;
    white-space: nowrap;
    position: relative;
}

.context-menu-item:hover:not(.disabled) {
    background: #000080;
    color: white;
}

.context-menu-item.disabled {
    color: #808080;
    cursor: not-allowed;
}

.context-menu-item.disabled:hover {
    background: transparent;
    color: #808080;
}

.context-menu-icon {
    width: 20px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.context-menu-label {
    flex: 1;
}

.context-menu-shortcut {
    font-size: 11px;
    color: #666;
    margin-left: 16px;
}

.context-menu-item:hover:not(.disabled) .context-menu-shortcut {
    color: #ccc;
}

.context-menu-arrow {
    font-size: 8px;
    margin-left: 8px;
}

.context-menu-separator {
    height: 1px;
    background: #808080;
    margin: 3px 2px;
    box-shadow: 0 1px 0 #ffffff;
}

/* Submenu indicator */
.context-menu-item.has-submenu::after {
    content: '';
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    border: 4px solid transparent;
    border-left-color: currentColor;
}

/* Animation */
.context-menu {
    animation: contextMenuFadeIn 0.1s ease-out;
}

@keyframes contextMenuFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Disclaimer Footer */
#disclaimer-footer {
    position: fixed;
    bottom: 42px;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 10px;
    color: rgba(255, 255, 255, 0.4);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    pointer-events: none;
    z-index: 50;
}

/* ==========================================================================
   WINDOWS 95 LOGIN SCREEN
   ========================================================================== */

.windows-login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #008080;
    z-index: 99999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease;
}

.windows-login-overlay.fade-out {
    opacity: 0;
}

.win95-login-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 32px;
}

/* Windows 95 Logo */
.win95-logo {
    display: flex;
    align-items: center;
    gap: 16px;
}

.win95-logo-flag {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    width: 64px;
    height: 64px;
    gap: 2px;
    transform: perspective(200px) rotateY(-10deg) rotateX(5deg);
}

.flag-red {
    background: linear-gradient(135deg, #ff0000 0%, #cc0000 100%);
    border-radius: 2px 0 0 0;
}

.flag-green {
    background: linear-gradient(135deg, #00ff00 0%, #00cc00 100%);
    border-radius: 0 2px 0 0;
}

.flag-blue {
    background: linear-gradient(135deg, #0000ff 0%, #0000cc 100%);
    border-radius: 0 0 0 2px;
}

.flag-yellow {
    background: linear-gradient(135deg, #ffff00 0%, #cccc00 100%);
    border-radius: 0 0 2px 0;
}

.win95-logo-text {
    display: flex;
    flex-direction: column;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.win-text {
    font-family: 'Arial', sans-serif;
    font-size: 42px;
    font-weight: bold;
    font-style: italic;
    letter-spacing: -2px;
}

.version-text {
    font-family: 'Arial', sans-serif;
    font-size: 28px;
    font-weight: normal;
    margin-top: -8px;
    margin-left: 4px;
}

/* Login Dialog */
.win95-login-dialog {
    background: #c0c0c0;
    border: 2px outset #dfdfdf;
    width: 380px;
    box-shadow: 4px 4px 10px rgba(0, 0, 0, 0.4);
}

.win95-dialog-titlebar {
    background: linear-gradient(90deg, #000080 0%, #1084d0 100%);
    color: white;
    padding: 3px 4px;
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    font-weight: bold;
}

.titlebar-icon {
    font-size: 14px;
}

.titlebar-text {
    flex: 1;
}

.titlebar-buttons {
    display: flex;
    gap: 2px;
}

.titlebar-btn {
    width: 16px;
    height: 14px;
    background: #c0c0c0;
    border: 2px outset #dfdfdf;
    font-size: 10px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.titlebar-btn:active {
    border: 2px inset #808080;
}

.win95-dialog-content {
    padding: 16px;
}

.login-icon {
    float: left;
    margin-right: 16px;
    margin-bottom: 8px;
}

.key-icon {
    font-size: 48px;
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #c0c0c0;
    border: 2px inset #808080;
}

.login-message {
    font-size: 12px;
    line-height: 1.5;
    margin-bottom: 16px;
    min-height: 64px;
}

.login-form {
    clear: both;
    margin-bottom: 16px;
}

.form-row {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.form-row label {
    width: 100px;
    font-size: 12px;
    text-align: right;
    padding-right: 8px;
}

.win95-input {
    flex: 1;
    height: 22px;
    padding: 2px 4px;
    font-family: 'MS Sans Serif', 'Segoe UI', Tahoma, sans-serif;
    font-size: 12px;
    border: 2px inset #808080;
    background: white;
    outline: none;
}

.win95-input:focus {
    background: #ffffcc;
}

.login-buttons {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
}

.win95-btn {
    min-width: 75px;
    height: 23px;
    padding: 0 12px;
    font-family: 'MS Sans Serif', 'Segoe UI', Tahoma, sans-serif;
    font-size: 12px;
    background: #c0c0c0;
    border: 2px outset #dfdfdf;
    cursor: pointer;
}

.win95-btn:hover:not(:disabled) {
    background: #d4d4d4;
}

.win95-btn:active:not(:disabled),
.win95-btn.pressed {
    border: 2px inset #808080;
}

.win95-btn:disabled {
    color: #808080;
    cursor: not-allowed;
}

.win95-btn.ready {
    border: 2px solid #000080;
    box-shadow: inset 0 0 0 1px #000080;
}

/* Logging In State */
.logging-in {
    text-align: center;
    padding: 24px 16px;
}

.logging-in-icon {
    font-size: 48px;
    margin-bottom: 16px;
    animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.logging-in-text {
    font-size: 13px;
    margin-bottom: 12px;
}

.logging-in-user {
    font-size: 16px;
    font-weight: bold;
    color: #000080;
    margin-bottom: 4px;
}

.logging-in-motto {
    font-size: 12px;
    font-style: italic;
    color: #666;
}

/* Subtitle */
.win95-subtitle {
    color: white;
    font-size: 14px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    opacity: 0.8;
}
