/* ========================================
   REGISTERED CUSTOM PROPERTIES (@property)
   Enables smooth interpolation for animations
   ======================================== */
@property --glass-alpha {
    syntax: '<number>';
    initial-value: 0.7;
    inherits: false;
}

@property --blur-amount {
    syntax: '<length>';
    initial-value: 24px;
    inherits: false;
}

@property --glow-intensity {
    syntax: '<number>';
    initial-value: 0.4;
    inherits: false;
}

@property --gradient-angle {
    syntax: '<angle>';
    initial-value: 135deg;
    inherits: false;
}

/* ========================================
   CASCADE LAYERS
   Organizes style precedence predictably
   ======================================== */
@layer base, theme, components, utilities;

/* ========================================
   DESIGN TOKENS (Base Layer)
   ======================================== */
@layer base {
    :root {
        /* Authentic Windows XP Luna color palette */
        /* Active title bar gradient */
        --xp-title-start: #0054E3;
        --xp-title-mid: #0062EA;
        --xp-title-light: #3D95FF;
        --xp-title-lightest: #5DB3FF;

        /* Inactive title bar */
        --xp-inactive-title: #7A96DF;
        --xp-inactive-light: #9DB9EB;
        --xp-inactive-text: #D8E4F8;

        /* Window & button surfaces */
        --xp-beige: #ECE9D8;
        --xp-beige-light: #F1EFE2;
        --xp-white: #ffffff;

        /* Button bevels & shadows */
        --xp-highlight: #F1EFE2;
        --xp-shadow: #ACA899;
        --xp-deep-shadow: #716F64;

        /* Selection & hover */
        --xp-selection: #316AC5;
        --xp-selection-text: #FFFFFF;

        /* Luna green (Start button, success) */
        --xp-green-dark: #008D00;
        --xp-green: #31A431;
        --xp-green-light: #5EDB5E;

        /* Warning orange */
        --xp-orange-light: #FF9933;
        --xp-orange: #DE5C2F;

        /* Links & accents */
        --xp-blue-link: #6487DC;
        --xp-blue-deep: #003399;

        /* Desktop blue */
        --xp-desktop: #3A6EA5;

        /* Neutral gray for scrollbars */
        --xp-gray: #D4D0C8;
        --xp-gray-light: #D4D0C8;
        --xp-gray-dark: #808080;
        --xp-black: #000000;

        /* Additional XP colors */
        --xp-blue: #0A64AD;
        --xp-yellow: #FFFFE1;

        /* Premium XP palette */
        --xp-blue-dark: #003cad;
        --xp-blue-mid: #1e70d8;
        --xp-blue-light: #58a4f3;
        --xp-green-start: #3bab33;
        --xp-green-highlight: #5dd544;
        --xp-gold: #f8d548;
        --xp-shadow: #001438;

        /* Base colors mapped to XP Luna */
        --bg-body: var(--xp-beige);
        --bg-surface: var(--xp-beige);
        --bg-elevated: var(--xp-beige-light);
        --bg-window: var(--xp-white);

        /* Text */
        --text-primary: var(--xp-black);
        --text-muted: var(--xp-gray-dark);
        --text-title: var(--xp-selection-text);

        /* Primary accent - XP blue gradient */
        --accent: var(--xp-title-mid);
        --accent-strong: var(--xp-title-start);
        --accent-light: var(--xp-title-light);

        /* Secondary accent - XP green */
        --secondary: var(--xp-green);
        --secondary-strong: var(--xp-green-dark);

        /* Tertiary accent - XP orange */
        --tertiary: var(--xp-orange);

        /* Semantic colors */
        --success: var(--xp-green);
        --warning: var(--xp-orange-light);
        --danger: var(--xp-orange);

        /* XP beveled borders */
        --border-raised-light: var(--xp-white);
        --border-raised-dark: var(--xp-shadow);
        --border-sunken-dark: var(--xp-shadow);
        --border-sunken-light: var(--xp-white);

        /* Spacing tokens - XP cramped 2/4/8px grid */
        --space-xs: 2px;
        --space-sm: 4px;
        --space-md: 8px;
        --space-lg: 8px;
        --space-xl: 8px;
        --space-2xl: 8px;

        /* NO border radius - XP is sharp! */
        --radius-sm: 0px;
        --radius-md: 0px;
        --radius-lg: 0px;
        --radius-xl: 0px;

        /* Typography scale */
        --text-xs: 0.75rem;
        --text-sm: 0.875rem;
        --text-base: 1rem;
        --text-lg: 1.125rem;
        --text-xl: 1.25rem;
        --text-2xl: 1.5rem;
        --text-3xl: 2rem;
        --text-4xl: 2.5rem;
        --text-5xl: 3rem;
    }

    /* Accessibility: High contrast mode */
    @media (prefers-contrast: more) {
        :root {
            --text-primary: #000000;
            --bg-surface: #ffffff;
            --accent: #004e98;
        }
    }
}

/* Inter font removed - XP uses only Tahoma/MS Sans Serif */

body {
    /* Windows XP Bliss wallpaper */
    background: url('/resources/bliss-wallpaper.jpg') center/cover fixed no-repeat #5A9FD4;
    color: var(--text-primary);
    font-size: 11px;
    font-family: "Tahoma", "MS Sans Serif", Arial, sans-serif;
    line-height: 1.4;
    font-weight: normal;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    position: relative;
    overflow: hidden;
}

/* Noise overlay removed - XP is clean */

/* Prevent pull down refresh when Streaming */
html.stream,
body.stream {
    overscroll-behavior: none !important;
    background: #000000 !important;
}

/* Typography - XP simple style (max 16px for titles) */
h1 {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0;
    color: var(--text-primary);
    margin: var(--space-md) 0;
}

h2 {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0;
    color: var(--text-primary);
    margin: var(--space-lg) 0 var(--space-sm) 0;
}

h3 {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0;
    color: var(--text-muted);
    margin: var(--space-md) 0 var(--space-xs) 0;
}

/* Ensure content is above noise overlay and video stream */
#root {
    position: relative;
    z-index: 10;
}

#modal-overlay {
    z-index: 100;
}

#context-menu {
    z-index: 10000;
}

#error-list {
    z-index: 200;
}

#sidebar-root {
    z-index: 150;
}

/* Ensure body noise overlay stays between stream and UI */
body::before {
    z-index: 1;
}

/** Input Div */
.input-div {
    display: flex;
    flex-direction: row;
    align-items: center;
}

/** Hide the file input */
input[type="file"] {
    display: none;
}

/** Label */
.file-label,
label {
    cursor: default;
    margin-right: 5px;
    color: #000000;
}

/** Button - Enhanced with tactile affordances and microinteractions */
@layer components {
    .file-button,
    button {
        position: relative;
        /* Simple XP button - flat beige */
        background: var(--xp-beige);
        color: var(--text-primary);
        padding: 3px 12px;
        border-radius: 0;
        /* XP raised border */
        border-top: 2px solid var(--xp-white);
        border-left: 2px solid var(--xp-white);
        border-right: 2px solid var(--xp-deep-shadow);
        border-bottom: 2px solid var(--xp-deep-shadow);
        box-shadow: none;
        margin: var(--space-sm);
        font-size: 11px;
        font-weight: normal;
        cursor: pointer;
        transition: none;
        overflow: visible;
    }
}

/* XP buttons have NO hover effect - only active/click state */

.file-button:active,
button:active {
    /* XP sunken button on click */
    border-top: 2px solid var(--xp-deep-shadow);
    border-left: 2px solid var(--xp-deep-shadow);
    border-right: 2px solid var(--xp-white);
    border-bottom: 2px solid var(--xp-white);
    box-shadow: none;
    padding: 3px 12px;
}

.file-button:focus-visible,
button:focus-visible {
    /* XP dotted focus outline */
    outline: 1px dotted var(--xp-black);
    outline-offset: -4px;
}

/** Checkbox - XP style */
input[type="checkbox"] {
    appearance: none !important;
    vertical-align: middle;
    width: 13px;
    height: 13px;
    background: var(--xp-white);
    /* XP sunken border */
    border-top: 1px solid var(--border-sunken-dark);
    border-left: 1px solid var(--border-sunken-dark);
    border-right: 1px solid var(--border-sunken-light);
    border-bottom: 1px solid var(--border-sunken-light);
    box-shadow: none;
    border-radius: 0;
    cursor: pointer;
    position: relative;
    display: inline-block !important;
    transition: none;
    opacity: 1 !important;
}

input[type="checkbox"]::after {
    content: "✓";
    color: var(--xp-black);
    font-size: 11px;
    font-weight: 700;
    position: absolute;
    top: -2px;
    left: 0px;
    transform: none;
    opacity: 0;
    transition: none;
}

/* NO HOVER EFFECT */

input[type="checkbox"]:checked {
    background: var(--xp-white);
    border-color: inherit;
    box-shadow: none;
}

input[type="checkbox"]:focus-visible {
    outline: 1px dotted var(--xp-black);
    outline-offset: 2px;
    box-shadow: none;
}

input[type="checkbox"]:checked::after {
    transform: none;
    opacity: 1;
}

/** Text Fields - XP style */
.textlike,
textarea,
select,
input[type=text],
input[type=password],
input[type=number] {
    color: var(--text-primary);
    font-size: var(--text-base);
    font-family: inherit;
    margin: var(--space-sm);
    background: var(--xp-white);
    border-radius: 0;
    /* XP sunken border */
    border-top: 1px solid var(--border-sunken-dark);
    border-left: 1px solid var(--border-sunken-dark);
    border-right: 1px solid var(--border-sunken-light);
    border-bottom: 1px solid var(--border-sunken-light);
    padding: var(--space-xs) var(--space-sm);
    box-shadow: none;
    overflow-x: auto;
    overflow-y: auto;
    white-space: pre-wrap;
    transition: none;
    max-height: max-content;
}

/* NO HOVER EFFECT */

.textlike:focus-visible,
textarea:focus-visible,
select:focus-visible,
input[type=text]:focus-visible,
input[type=password]:focus-visible,
input[type=number]:focus-visible {
    outline: 1px dotted var(--xp-black);
    outline-offset: 2px;
    background: var(--xp-white);
    border-top: 2px solid var(--xp-deep-shadow);
    border-left: 2px solid var(--xp-deep-shadow);
    border-right: 2px solid var(--xp-white);
    border-bottom: 2px solid var(--xp-white);
    box-shadow: none;
}

textarea:disabled,
select:disabled,
input[type=text]:disabled,
input[type=password]:disabled,
input[type=number]:disabled {
    color: var(--text-dim);
    opacity: 0.5;
    cursor: not-allowed;
}

select option {
    background-color: var(--bg-elevated);
    color: var(--text-primary);
    padding: var(--space-sm);
}

/** Hide the number up down thingy on number inputs */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
    /* display: none; <- Crashes Chrome on hover */
    -webkit-appearance: none;
    /* <-- Apparently some margin are still there even though it's hidden */
    margin: 0;
}

input[type=number] {
    appearance: textfield;
    /* Firefox */
    -moz-appearance: textfield;
}

/** Modal - XP window style (no backdrop dimmer) */
.modal-background {
    display: block;
    position: fixed;
    z-index: 100;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    visibility: visible;
    opacity: 1;
    transition: none;
    pointer-events: none;
}

.modal-content {
    position: relative;
    background: var(--xp-gray-light);
    color: var(--text-primary);
    margin: 10vh auto;
    padding: var(--space-lg);
    /* XP raised window border */
    border-top: 2px solid var(--border-raised-light);
    border-left: 2px solid var(--border-raised-light);
    border-right: 2px solid var(--border-raised-dark);
    border-bottom: 2px solid var(--border-raised-dark);
    border-radius: 0;
    box-shadow: 3px 3px 0 #404040;
    width: 85%;
    max-width: 800px;
    transform: none;
    transition: none;
    pointer-events: all;
}

.modal-disabled {
    visibility: hidden;
    background-color: rgba(0, 0, 0, 0);
    opacity: 0;
    transition: none;
}

.modal-disabled .modal-content {
    transform: none;
}

/** Context Menu - XP style */
.context-menu-background {
    display: block;
    position: fixed;
    z-index: 10000;
    border-radius: 0;
    background: var(--xp-gray-light);
    /* XP raised border */
    border-top: 2px solid var(--border-raised-light);
    border-left: 2px solid var(--border-raised-light);
    border-right: 2px solid var(--border-raised-dark);
    border-bottom: 2px solid var(--border-raised-dark);
    box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.5);
    scale: 1;
    opacity: 1;
    translate: 0 0;
    transition: none;
}

.context-menu-list {
    list-style-type: none;
    padding: var(--space-xs);
    margin: 0;
}

/* Removed background - let parent element control background */

.context-menu-element {
    margin: 0;
    padding: var(--space-sm) var(--space-md);
    min-width: 140px;
    cursor: pointer;
    border-radius: 0;
    font-size: 11px;
    color: var(--text-primary);
    transition: none;
    background-color: var(--xp-gray-light);
}

/* NO HOVER EFFECT */

.context-menu-disabled {
    visibility: hidden;
    opacity: 0;
    scale: 1;
    translate: 0 0;
    transition: none;
}

/** Sidebar */
.sidebar-overlay {
    position: fixed;
    z-index: 150;
    pointer-events: none;
}

.sidebar-background {
    display: flex;
    align-items: center;
    gap: 5px;
    /** no animation - XP instant */
    transition: none;
}

.sidebar-background * {
    pointer-events: all;
}

.sidebar-overlay.sidebar-edge-left {
    top: 50%;
    left: 0;
}

.sidebar-edge-left .sidebar-background {
    flex-direction: row-reverse;
    transform: translate(calc(-100% + 40px), -50%);
}

.sidebar-overlay.sidebar-edge-right {
    top: 50%;
    right: 0;
}

.sidebar-edge-right .sidebar-background {
    flex-direction: row;
    transform: translate(calc(100% - 40px), -50%);
}

.sidebar-edge-left.sidebar-show .sidebar-background,
.sidebar-edge-right.sidebar-show .sidebar-background {
    transform: translate(0, -50%);
}

.sidebar-overlay.sidebar-edge-up {
    top: 0;
    left: 50%;
}

.sidebar-edge-up .sidebar-background {
    flex-direction: column-reverse;
    transform: translate(-50%, calc(-100% + 40px));
}

.sidebar-overlay.sidebar-edge-down {
    bottom: 0;
    left: 50%;
}

.sidebar-edge-down .sidebar-background {
    flex-direction: column;
    transform: translate(-50%, calc(100% - 40px));
}

.sidebar-edge-down.sidebar-show .sidebar-background,
.sidebar-edge-up.sidebar-show .sidebar-background {
    transform: translate(-50%, 0);
}

.sidebar-button {
    /** Note: Button full size: 30px(width / height) + 5px(padding as in button selector) + 5px(.sidebar-background gap) = 40px */
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-button-image {
    transition: none;
}

.sidebar-edge-left .sidebar-button-image {
    rotate: 180deg;
}

.sidebar-edge-right .sidebar-button-image {
    rotate: 0deg;
}

.sidebar-edge-up .sidebar-button-image {
    rotate: 270deg;
}

.sidebar-edge-down .sidebar-button-image {
    rotate: 90deg;
}

.sidebar-show .sidebar-button-image {
    transform: rotate(180deg);
}


.sidebar-content {
    background: var(--xp-beige);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-radius: 0;
    /* XP raised border */
    border-top: 2px solid var(--xp-white);
    border-left: 2px solid var(--xp-white);
    border-right: 2px solid var(--xp-deep-shadow);
    border-bottom: 2px solid var(--xp-deep-shadow);
    padding: var(--space-lg);
    box-shadow: none;
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

/** TODO: reorder stream sidebar */

/** Errors - Enhanced toast notifications with animations */
.error-list {
    visibility: hidden;
    position: fixed;
    z-index: 200;
    right: var(--space-xl);
    bottom: var(--space-xl);
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    max-width: 400px;
}

/* Removed slideInRight and pulse animations - XP instant appearance */

@layer components {
    .error-element {
        visibility: visible;
        display: flex;
        flex-direction: row;
        align-items: center;
        padding: var(--space-md) var(--space-lg);
        /* XP-style error message box */
        background: var(--xp-gray-light);
        /* XP raised border */
        border-top: 2px solid var(--border-raised-light);
        border-left: 2px solid var(--border-raised-light);
        border-right: 2px solid var(--border-raised-dark);
        border-bottom: 2px solid var(--border-raised-dark);
        border-radius: 0;
        box-shadow: none;
        animation: none;
        transition: none;
    }
}

/* NO HOVER EFFECT - XP AUTHENTIC */

.error-image {
    margin-right: var(--space-lg);
    filter: none;
    flex-shrink: 0;
}

.error-element p {
    margin: 0;
    color: var(--text-primary);
    font-size: 11px;
    line-height: 1.4;
    font-weight: normal;
}

/** Animated Lists - XP instant display */
.animated-list-element {
    opacity: 1;
    transform: none;
    transition: none;
}

.animated-list-element.list-show {
    opacity: 1;
    transform: none;
}

/** Connection Status - XP square framed rectangle */
.connection-status {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 0;
    margin-right: var(--space-sm);
    /* XP sunken border frame */
    border-top: 1px solid var(--xp-deep-shadow);
    border-left: 1px solid var(--xp-deep-shadow);
    border-right: 1px solid var(--xp-white);
    border-bottom: 1px solid var(--xp-white);
}

.connection-status.connected {
    background: var(--success);
    box-shadow: none;
    animation: none;
}

.connection-status.connecting {
    background: var(--warning);
    box-shadow: none;
    animation: none;
}

.connection-status.disconnected {
    background: var(--danger);
    box-shadow: none;
}

/** Actions */
.actions-list {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

/** Settings */
.open-settings {
    background-image: url("resources/settings.svg");
    background-position: center;
    background-repeat: no-repeat;
    background-size: 40px;
    width: 56px;
    height: 56px;
    transition: none;
}

/* NO HOVER EFFECT - XP AUTHENTIC */

.settings {
    color: var(--text-primary);
}

/** Hosts - Bento-grid layout */
.host-add {
    background-image: url("resources/ic_add_to_queue_white_48px.svg");
    background-position: center;
    background-repeat: no-repeat;
    background-size: 40px;
    width: 56px;
    height: 56px;
    transition: none;
}

/* NO HOVER EFFECT - XP AUTHENTIC */

.host-list {
    list-style-type: none;
    display: grid;
    grid-template-columns: repeat(auto-fill, 80px);
    gap: 16px;
    padding: 16px;
    margin: 0;
    align-content: start;
}

.host-list > li {
    display: block;
    margin: 0;
    padding: 0;
}

.host-inner {
    display: block;
    width: 100%;
    height: 100%;
    cursor: pointer;
    text-align: center;
}

@layer components {
    .host-element {
        position: relative;
        cursor: pointer;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        width: 80px;
        height: 90px;
        box-sizing: border-box;
        /* Desktop icon - no background or border */
        background: transparent;
        border: none;
        border-radius: 0;
        padding: 4px;
        box-shadow: none;
        transition: none;
        overflow: visible;
    }
}

/* Removed animated gradient border to match app cards */

/* XP panels have NO hover effect */

.host-image {
    width: 48px;
    height: 48px;
    object-fit: contain;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    transition: none;
    display: block;
    image-rendering: auto;
    margin: 0 auto 4px auto;
    padding: 0;
    filter: drop-shadow(0 1px 0 rgba(255,255,255,0.85));
}

.host-name {
    margin: 0;
    color: #FFFFFF;
    font-size: 11px;
    font-weight: normal;
    text-align: center;
    letter-spacing: 0;
    max-width: 100%;
    word-wrap: break-word;
    line-height: 1.2;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.9);
}

/** Apps - XP desktop icons */
.app-list {
    list-style-type: none;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 8px;
    padding: 0;
    margin: 8px 0;
}

@layer components {
    .app-element>div {
        position: relative;
        cursor: pointer;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        width: 160px;
        height: 160px;
        gap: 0;
        background: var(--xp-beige);
        /* XP raised border - SAME STYLE AS HOST CARD */
        border-top: 2px solid var(--xp-white);
        border-left: 2px solid var(--xp-white);
        border-right: 2px solid var(--xp-shadow);
        border-bottom: 2px solid var(--xp-shadow);
        border-radius: 0;
        padding: 4px;
        box-shadow: none;
        transition: none;
        overflow: hidden;
    }

    .app-element>div::before {
        content: '';
        display: block;
        width: 128px;
        height: 128px;
        margin: 0 auto;
        background: transparent;
        border-radius: 0;
        background-image: url('resources/arch_logo.webp');
        background-size: 128px 128px;
        background-repeat: no-repeat;
        background-position: center center;
        box-shadow: none;
    }

/* NO HOVER EFFECT - XP AUTHENTIC */

.app-image {
    width: 160px;
    height: 120px;
    border-radius: 0;
    /* XP sunken border for images */
    border-top: 2px solid var(--xp-deep-shadow);
    border-left: 2px solid var(--xp-deep-shadow);
    border-right: 2px solid var(--xp-white);
    border-bottom: 2px solid var(--xp-white);
    box-shadow: none;
    transition: none;
    opacity: 0;
    transform: none;
    object-fit: contain;
    padding: 4px;
    background: var(--xp-white);
    display: none;
}

.app-image-loaded {
    opacity: 1;
    transform: none;
    transition: none;
}

.app {
    transition: none;
}

/* App text label below logo - XP 11px Tahoma */
.app-element p {
    font-size: 11px;
    font-weight: bold;
    color: var(--text-primary);
    text-align: center;
    margin: 2px 0 0 0;
    word-wrap: break-word;
    max-width: 100%;
    padding: 0;
    line-height: 1.2;
}

.app-active .app-image {
    /* XP selection - blue border */
    border: 2px solid var(--xp-selection);
    box-shadow: none;
    transform: none;
}

.app-inactive {
    filter: brightness(0.5) saturate(0.6);
    opacity: 0.7;
    transition: none;
}

/* NO HOVER EFFECT - XP AUTHENTIC */

/** Stream Connect Modal */
.modal-video-connect {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;

    max-width: 100%;
    max-height: 100%;
}

.modal-video-connect .modal-video-connect-debug {
    max-width: 75vw;
    max-height: 40vh;
}

/** Stream */
.video-stream {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 100vw;
    max-height: 100vh;
    min-width: 100vmin;
    min-height: 100vmin;
    width: auto;
    height: auto;
    outline: none;
    z-index: 0;
}

.sidebar-stream {
    display: flex;
    flex-direction: column;
}

.sidebar-stream-buttons {
    display: grid;
    grid-template-columns: 50% 50%;
}

.hiddeninput {
    position: absolute;
    z-index: -1;
    resize: none;
    translate: 200vw 200vh;
}

/* Ensure input capture div is above stream but below UI */
#input {
    position: relative;
    z-index: 5;
}

/* Prevent starting animation for elements */
.prevent-start-transition {
    transition: none;
}

/** Loading States - Skeleton and spinner animations */
/* Loading animations removed - XP static loading indicators */

.loading-skeleton {
    background: var(--xp-gray);
    background-size: 100% 100%;
    animation: none;
    border-radius: 0;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--xp-gray-dark);
    border-top-color: var(--xp-blue);
    border-radius: 50%;
    animation: none;
}

.loading-spinner-sm {
    width: 24px;
    height: 24px;
    border-width: 3px;
}

/** Success Checkmark - XP static */
.success-checkmark {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--success);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: none;
    animation: none;
}

.success-checkmark::after {
    content: '✓';
    color: var(--xp-black);
    font-size: 32px;
    font-weight: 700;
}

/** Empty State Illustrations */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-2xl);
    text-align: center;
    opacity: 0.8;
}

.empty-state-icon {
    width: 128px;
    height: 128px;
    margin-bottom: var(--space-xl);
    opacity: 0.5;
    filter: drop-shadow(0 8px 24px rgba(79, 140, 255, 0.2));
}

.empty-state-title {
    font-size: var(--text-2xl);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
}

.empty-state-description {
    font-size: var(--text-base);
    color: var(--text-muted);
    max-width: 400px;
    line-height: 1.6;
}

/** Progress Bar - XP static */
.progress-bar {
    width: 100%;
    height: 20px;
    background: var(--xp-white);
    border-radius: 0;
    overflow: hidden;
    /* XP sunken border */
    border-top: 1px solid var(--border-sunken-dark);
    border-left: 1px solid var(--border-sunken-dark);
    border-right: 1px solid var(--border-sunken-light);
    border-bottom: 1px solid var(--border-sunken-light);
    box-shadow: none;
}

.progress-bar-fill {
    height: 100%;
    background: var(--xp-blue);
    background-size: 100% 100%;
    border-radius: 0;
    box-shadow: none;
    transition: none;
    animation: none;
}

/** Tooltip - XP instant */
.tooltip {
    position: absolute;
    background: var(--xp-yellow);
    color: var(--xp-black);
    padding: var(--space-xs) var(--space-sm);
    border-radius: 0;
    font-size: var(--text-xs);
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transform: none;
    transition: none;
    z-index: 1000;
    border: 1px solid var(--xp-black);
    box-shadow: none;
}

.tooltip.show {
    opacity: 1;
    transform: none;
}

/** XP flat beveled scrollbars */
::-webkit-scrollbar {
    width: 16px;
    height: 16px;
}

::-webkit-scrollbar-track {
    background: var(--xp-gray);
    border-radius: 0;
}

::-webkit-scrollbar-thumb {
    background: var(--xp-gray);
    border-radius: 0;
    /* XP raised border on scrollbar thumb */
    border-top: 2px solid var(--xp-white);
    border-left: 2px solid var(--xp-white);
    border-right: 2px solid var(--xp-deep-shadow);
    border-bottom: 2px solid var(--xp-deep-shadow);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--xp-gray);
}

/** XP Taskbar - Clean and Simple */
#xp-taskbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 32px;
    background-color: #245EDC;
    background: linear-gradient(to bottom, #245EDC 0%, #3f8cf3 9%, #245EDC 18%, #245EDC 92%, #1941A5 100%) center/cover no-repeat;
    display: flex;
    align-items: center;
    z-index: 10000;
}

#start-button {
    height: 100%;
    /* Authentic Windows XP Start button green gradient - no glow */
    background: linear-gradient(to bottom, #5ecc5a 0%, #4db34a 50%, #3c873c 100%) !important;
    border: 1px outset rgba(255, 255, 255, 0.4) !important;
    border-left: none !important;
    border-radius: 0 10px 10px 0 !important;
    color: white !important;
    font-family: "Tahoma", "Franklin Gothic Medium", sans-serif !important;
    font-size: 12px !important;
    line-height: 12px !important;
    font-weight: bold !important;
    font-style: italic !important;
    padding: 4px 18px 4px 6px !important;
    cursor: pointer;
    margin: 0 10px 0 0 !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.3), inset 0 -1px 0 rgba(0,0,0,0.2) !important;
    position: relative;
    display: flex;
    align-items: center;
    gap: 3px;
    text-shadow: 1px 1px 1px rgba(0,0,0,0.5) !important;
}

.start-logo {
    height: 16px;
    width: auto;
    display: block;
    filter: none;
}

#start-button:hover {
    background: linear-gradient(to bottom, #6fd86b 0%, #5ecc5a 50%, #4db34a 100%) !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.4), inset 0 -1px 0 rgba(0,0,0,0.2) !important;
}

#start-button:active {
    background: linear-gradient(to bottom, #3c873c 0%, #2d6e2d 50%, #1e5a1e 100%) !important;
    box-shadow: inset 1px 1px 3px rgba(0,0,0,0.5) !important;
    border-style: inset !important;
}

.taskband {
    flex: 1;
    display: flex;
    align-items: center;
    padding: 0 4px;
    gap: 2px;
}

.task-button {
    min-width: 100px;
    max-width: 160px;
    height: 24px;
    background: linear-gradient(to bottom, #1f51db 0%, #3f8cf3 9%, #1f51db 18%, #1f51db 92%, #103aad 100%);
    border: 1px outset rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.2);
    color: white;
    font-size: 11px;
    font-weight: 600;
    padding: 0 8px;
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: pointer;
    text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.5);
}

.task-button:hover {
    background: linear-gradient(to bottom, #3f6ef5 0%, #5fa5ff 9%, #3f6ef5 18%, #3f6ef5 92%, #2050cf 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 1px 3px rgba(0, 0, 0, 0.3);
}

.task-button:active,
.task-button.minimized {
    background: linear-gradient(to bottom, #103aad 0%, #1f51db 9%, #103aad 18%, #103aad 92%, #082170 100%);
    border: 1px inset rgba(0, 0, 0, 0.3);
    box-shadow: inset 1px 1px 3px rgba(0, 0, 0, 0.4), 0 1px 0 rgba(255, 255, 255, 0.1);
}

#system-tray {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 15px 0 25px;
    height: 100%;
    font-family: calibri, monospace;
    font-size: 11px;
    line-height: 32px;
    background: linear-gradient(to bottom, #1290E9 0%, #19B9F3 9%, #1290E9 18%, #1290E9 92%, #1941A5 100%) center/cover no-repeat;
    border-left: 1px solid #092E51;
    border-right: none;
    min-width: 80px;
    box-shadow: 0px 5px 10px #14A5F0 inset, 0px 5px 10px #333333;
    text-shadow: 1px 1px 2px #222;
    text-transform: uppercase;
}

.tray-icons {
    display: flex;
    align-items: center;
    gap: 4px;
}

.tray-icons img {
    width: 16px;
    height: 16px;
}

#clock {
    font-family: "Tahoma", sans-serif;
    font-size: 11px;
    letter-spacing: 0.4px;
    color: #ffffff;
    text-shadow: 0 1px 1px rgba(0,0,0,0.7);
    padding: 0 12px;
}

/** Responsive adjustments */
@media (max-width: 768px) {
    body {
        padding: 0;
        font-size: 11px;
    }

    h1 {
        font-size: 16px;
    }

    h2 {
        font-size: 14px;
    }

    .host-list,
    .app-list {
        grid-template-columns: repeat(auto-fill, 80px);
        gap: 16px;
    }

    .modal-content {
        width: 95%;
        padding: var(--space-lg);
    }

    .error-list {
        right: 8px;
        bottom: 40px;
        max-width: calc(100vw - 16px);
    }
}

/* Focus-visible for keyboard navigation - XP style */
*:focus-visible {
    outline: 1px dotted var(--xp-black);
    outline-offset: -4px;
    border-radius: 0;
}

/** XP Start Menu */
#start-menu {
    position: fixed;
    bottom: 30px;
    left: 0;
    width: 400px;
    border: 3px solid;
    border-color: #2457EE #0035D6 #0035D6 #2457EE;
    border-radius: 12px 12px 0 0;
    box-shadow: 3px 3px 8px rgba(0,0,0,0.3);
    z-index: 9999;
    display: flex;
    flex-direction: row;
    overflow: hidden;
    background: #4D7EF7;
    transform-origin: bottom left;
    opacity: 0;
    pointer-events: none;
    transform: translateY(20px);
    visibility: hidden;
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s linear 0.2s;
}

#start-menu.start-menu-hidden {
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
    visibility: hidden;
}

#start-menu.start-menu-visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
    visibility: visible;
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s linear 0s;
}

.start-menu-left {
    flex: 0 0 45%;
    min-width: 160px;
    background: linear-gradient(180deg, #5B88F9 0%, #3F6FEF 100%);
    padding: 12px 6px;
    display: flex;
    flex-direction: column;
    border-right: 1px solid rgba(0, 0, 0, 0.2);
    box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.25);
}

.start-user {
    background: linear-gradient(to bottom, #5B88F9 0%, #4D7EF7 100%);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 3px;
    padding: 8px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-icon {
    font-size: 24px;
}

.user-name {
    color: white;
    font-size: 11px;
    font-weight: bold;
    text-shadow: 1px 1px 1px rgba(0,0,0,0.5);
}

.start-programs h3 {
    color: white;
    font-size: 10px;
    font-weight: normal;
    margin: 8px 4px 4px 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.start-menu-item {
    background: transparent;
    border: none;
    color: white;
    padding: 6px 8px;
    text-align: left;
    cursor: pointer;
    border-radius: 2px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 11px;
    margin: 1px 0;
}

.start-menu-item:hover {
    background: rgba(255,255,255,0.2);
}

.start-menu-item .item-icon {
    margin-right: 8px;
}

.start-menu-right {
    flex: 1;
    background: linear-gradient(180deg, #FFFFFF 0%, #F0F6FF 100%);
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.start-task-item {
    background: white;
    border: 1px solid transparent;
    padding: 8px 12px;
    text-align: left;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 11px;
    color: #000;
    margin: 2px 0;
    border-radius: 2px;
}

.start-task-item:hover {
    background: #F0F8FF;
    border: 1px solid #C9E3FF;
}

.task-icon {
    font-size: 24px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.task-text {
    flex: 1;
    font-weight: normal;
}

.start-separator {
    height: 1px;
    background: rgba(0,0,0,0.1);
    margin: 4px 0;
}

#start-button.start-button-active {
    background: linear-gradient(to bottom, #3c873c 0%, #2d6e2d 50%, #1e5a1e 100%) !important;
    box-shadow: inset 1px 1px 3px rgba(0,0,0,0.5) !important;
    border-style: inset !important;
}

/** Quick Launch */
.quick-launch {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 0 4px;
    border-right: 1px solid rgba(255,255,255,0.2);
    margin-right: 4px;
}

/** XP Window Overrides for XP.css */
.window.xp-desktop-window {
    box-shadow: 0 4px 12px rgba(0,0,20,0.4), 0 2px 4px rgba(0,0,0,0.2);
}

.xp-desktop-window .title-bar {
    background: linear-gradient(180deg, #3A84F7 0%, #1955E7 50%, #0039D6 100%);
    border-bottom: 1px solid #0025A0;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.4);
}

.xp-desktop-window .title-bar-text {
    color: white;
    font-weight: bold;
    text-shadow: 1px 1px 1px rgba(0,0,0,0.5);
}

.xp-desktop-window .window-body {
    background: #ECE9D8;
    color: #000;
}

/** Start Button Icon */
.start-icon {
    font-size: 14px;
    margin-right: 4px;
}

.start-text {
    font-style: italic;
}

/** Desktop Icon Label Improvements */
.host-name {
    color: white;
    font-size: 11px;
    text-align: center;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8), -1px -1px 2px rgba(0,0,0,0.8), 1px -1px 2px rgba(0,0,0,0.8), -1px 1px 2px rgba(0,0,0,0.8);
    line-height: 1.2;
    word-wrap: break-word;
    max-width: 80px;
}

/** System Tray Icon Styling */
.tray-icons span {
    font-size: 14px;
    cursor: pointer;
    opacity: 0.9;
}

.tray-icons span:hover {
    opacity: 1;
}

/** Hide non-XP UI elements */
#root > h1,
#root h1,
#root .host-add,
#root .open-settings,
#root .actions-list,
.settings-button,
button[aria-label="Settings"],
button.host-add,
button.open-settings {
    display: none !important;
}

/* Force checkboxes visible - override xp.css */
html body input[type="checkbox"],
html body input[type="checkbox"]:not(:checked),
html body input[type="checkbox"]:checked {
    opacity: 1 !important;
    position: relative !important;
}
