* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Window colors */
    --window-bg: #f5f5f5;
    --window-content-bg: #ffffff;
    --window-titlebar-start: #e8e8e8;
    --window-titlebar-end: #d0d0d0;
    --window-titlebar-active-end: #d4d4d4;
    --window-titlebar-border: #b8b8b8;
    --window-title-color: #4a4a4a;
    --window-title-active: #1a1a1a;
    --window-shadow: 0 22px 70px 4px rgba(0, 0, 0, 0.56), 0 0 0 1px rgba(0, 0, 0, 0.1);
    --window-shadow-active: 0 22px 70px 4px rgba(0, 0, 0, 0.56), 0 0 0 1px rgba(0, 0, 0, 0.2);
    --traffic-light-inactive: #c8c8c8;

    /* Dock colors */
    --dock-bg: rgba(255, 255, 255, 0.2);
    --dock-border: rgba(255, 255, 255, 0.3);
    --dock-tooltip-bg: rgba(30, 30, 30, 0.95);
    --dock-indicator-color: rgba(190, 235, 255, 0.95);
    --dock-indicator-glow: rgba(120, 200, 255, 0.8);

    /* Finder colors */
    --finder-bg: #ffffff;
    --finder-toolbar-start: #f6f6f6;
    --finder-toolbar-end: #e8e8e8;
    --finder-toolbar-border: #c8c8c8;
    --finder-sidebar-bg: #f3f3f3;
    --finder-sidebar-border: #d8d8d8;
    --finder-text: #333;
    --finder-text-secondary: #666;
    --finder-text-muted: #888;
    --finder-hover: rgba(0, 0, 0, 0.05);
    --finder-selected: rgba(0, 122, 255, 0.15);
    --finder-accent: #007aff;
    --finder-search-bg: #ffffff;
    --finder-search-border: #c8c8c8;
    --finder-view-btns-bg: #e0e0e0;
    --finder-view-btn-active: #ffffff;
    --finder-nav-btn-hover: rgba(0, 0, 0, 0.08);
    --finder-nav-btn-active: rgba(0, 0, 0, 0.12);
    --finder-statusbar-bg: #f6f6f6;
    --finder-statusbar-border: #d8d8d8;
}

/* Dark mode styles */
[data-theme="dark"] {
    /* Window colors */
    --window-bg: #3a3a3a;
    --window-content-bg: #2d2d2d;
    --window-titlebar-start: #3d3d3d;
    --window-titlebar-end: #2d2d2d;
    --window-titlebar-active-end: #333333;
    --window-titlebar-border: #1a1a1a;
    --window-title-color: #b0b0b0;
    --window-title-active: #e5e5e5;
    --window-shadow: 0 22px 70px 4px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.05);
    --window-shadow-active: 0 22px 70px 4px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.1);
    --traffic-light-inactive: #555555;

    /* Dock colors */
    --dock-bg: rgba(50, 50, 50, 0.4);
    --dock-border: rgba(255, 255, 255, 0.1);
    --dock-tooltip-bg: rgba(50, 50, 50, 0.95);
    --dock-indicator-color: rgba(190, 235, 255, 0.98);
    --dock-indicator-glow: rgba(140, 210, 255, 0.9);

    /* Finder colors */
    --finder-bg: #2d2d2d;
    --finder-toolbar-start: #3a3a3a;
    --finder-toolbar-end: #2d2d2d;
    --finder-toolbar-border: #1a1a1a;
    --finder-sidebar-bg: #252525;
    --finder-sidebar-border: #1a1a1a;
    --finder-text: #e5e5e5;
    --finder-text-secondary: #a0a0a0;
    --finder-text-muted: #777;
    --finder-hover: rgba(255, 255, 255, 0.05);
    --finder-selected: rgba(0, 122, 255, 0.25);
    --finder-accent: #0a84ff;
    --finder-search-bg: #1a1a1a;
    --finder-search-border: #3a3a3a;
    --finder-view-btns-bg: #3a3a3a;
    --finder-view-btn-active: #555555;
    --finder-nav-btn-hover: rgba(255, 255, 255, 0.08);
    --finder-nav-btn-active: rgba(255, 255, 255, 0.12);
    --finder-statusbar-bg: #252525;
    --finder-statusbar-border: #1a1a1a;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.desktop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    /* macOS Sonoma-style gradient wallpaper */
    background: linear-gradient(
        135deg,
        #1a1a2e 0%,
        #16213e 15%,
        #0f3460 30%,
        #1a1a4e 45%,
        #2d1b4e 55%,
        #4a1942 70%,
        #6b2d5c 85%,
        #8b4367 100%
    );
    background-size: 400% 400%;
    cursor: default;
    user-select: none;
    -webkit-user-select: none;
}

.selection-rect {
    position: fixed;
    background-color: rgba(0, 122, 255, 0.2);
    border: 1px solid rgba(0, 122, 255, 0.6);
    border-radius: 2px;
    pointer-events: none;
}
/* Window styles */
.window {
    position: absolute;
    background: var(--window-bg);
    border-radius: 10px;
    box-shadow: var(--window-shadow);
    display: flex;
    flex-direction: column;
    min-width: 200px;
    min-height: 100px;
    overflow: hidden;
}

.window.active {
    box-shadow: var(--window-shadow-active);
}

.window.maximized {
    border-radius: 0;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
}

.window.minimized {
    display: none;
}

/* Genie minimize animation */
.window.minimizing {
    animation: genie-minimize 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    transform-origin: bottom center;
    pointer-events: none;
}

/* Genie restore animation */
.window.restoring {
    animation: genie-restore 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    transform-origin: bottom center;
    pointer-events: none;
}

/* Title bar */
.window-titlebar {
    height: 28px;
    background: linear-gradient(180deg, var(--window-titlebar-start) 0%, var(--window-titlebar-end) 100%);
    border-bottom: 1px solid var(--window-titlebar-border);
    display: flex;
    align-items: center;
    padding: 0 8px;
    user-select: none;
    cursor: grab;
    border-radius: 10px 10px 0 0;
    position: relative;
}

.window-titlebar:active {
    cursor: grabbing;
}

.window.active .window-titlebar {
    background: linear-gradient(180deg, var(--window-titlebar-start) 0%, var(--window-titlebar-active-end) 100%);
}

/* Traffic light buttons */
.traffic-lights {
    display: flex;
    gap: 8px;
    align-items: center;
}

.traffic-light {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    position: relative;
}

.traffic-light::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 0.1s;
}

.traffic-lights:hover .traffic-light::before {
    opacity: 1;
}

.traffic-light.close {
    background: linear-gradient(180deg, #ff5f57 0%, #e5453c 100%);
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.1);
}

.traffic-light.close::before {
    content: '\00d7';
    font-size: 10px;
    font-weight: bold;
    color: #4d0000;
}

.traffic-light.minimize {
    background: linear-gradient(180deg, #febc2e 0%, #e5a000 100%);
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.1);
}

.traffic-light.minimize::before {
    content: '\2013';
    font-size: 10px;
    font-weight: bold;
    color: #995700;
}

.traffic-light.maximize {
    background: linear-gradient(180deg, #28c840 0%, #1aab29 100%);
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.1);
}

.traffic-light.maximize::before {
    content: '+';
    font-size: 12px;
    font-weight: bold;
    color: #006500;
}

/* Inactive window traffic lights */
.window:not(.active) .traffic-light {
    background: var(--traffic-light-inactive);
}

.window:not(.active) .traffic-light::before {
    display: none;
}

/* Window title */
.window-title {
    position: absolute;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 13px;
    font-weight: 500;
    color: var(--window-title-color);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    pointer-events: none;
}

.window.active .window-title {
    color: var(--window-title-active);
}

/* Window content */
.window-content {
    flex: 1;
    background: var(--window-content-bg);
    overflow: auto;
    padding: 16px;
    position: relative;
    z-index: 1;
}

/* Terminal window - transparent background for translucency effect */
.window.terminal-window {
    background: transparent;
}

/* Terminal window content - no padding/background to show through */
.window-content.terminal-content {
    padding: 0;
    background: transparent;
    overflow: hidden;
}

/* Finder window content - no padding/background to prevent white bleed */
.window-content.finder-content {
    padding: 0;
    background: transparent;
    overflow: hidden;
}

/* Resize handles */
.resize-handle {
    position: absolute;
    background: transparent;
    z-index: 0;
}

.resize-handle.n {
    top: 0;
    left: 10px;
    right: 10px;
    height: 4px;
    cursor: n-resize;
}

.resize-handle.s {
    bottom: 0;
    left: 10px;
    right: 10px;
    height: 4px;
    cursor: s-resize;
}

.resize-handle.e {
    right: 0;
    top: 10px;
    bottom: 10px;
    width: 4px;
    cursor: e-resize;
}

.resize-handle.w {
    left: 0;
    top: 10px;
    bottom: 10px;
    width: 4px;
    cursor: w-resize;
}

.resize-handle.ne {
    top: 0;
    right: 0;
    width: 10px;
    height: 10px;
    cursor: ne-resize;
}

.resize-handle.nw {
    top: 0;
    left: 0;
    width: 10px;
    height: 10px;
    cursor: nw-resize;
}

.resize-handle.se {
    bottom: 0;
    right: 0;
    width: 10px;
    height: 10px;
    cursor: se-resize;
}

.resize-handle.sw {
    bottom: 0;
    left: 0;
    width: 10px;
    height: 10px;
    cursor: sw-resize;
}

/* Dock wrapper - centers the combined dock (main + minimized) */
.dock-wrapper {
    position: fixed;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: flex-end;
    gap: 0;
    z-index: 1000;
    padding: 4px 4px 0 4px;
    /* Smooth transition when dock width changes */
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Separator between main dock and minimized dock */
.minimized-dock-separator {
    width: 1px;
    height: 48px;
    background: linear-gradient(
        to bottom,
        transparent 0%,
        rgba(255, 255, 255, 0.4) 20%,
        rgba(255, 255, 255, 0.4) 80%,
        transparent 100%
    );
    margin: 0 8px;
    align-self: center;
}

/* Minimized windows dock - glass effect matching main dock */
.minimized-dock {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 4px 12px;
    gap: 6px;
    background: var(--dock-bg, rgba(255, 255, 255, 0.2));
    backdrop-filter: blur(30px) saturate(180%);
    -webkit-backdrop-filter: blur(30px) saturate(180%);
    border-radius: 18px;
    border: 1px solid var(--dock-border);
    box-shadow:
        0 0 0 0.5px rgba(0, 0, 0, 0.1),
        0 8px 32px rgba(0, 0, 0, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.4),
        inset 0 -1px 0 rgba(0, 0, 0, 0.05);
}

/* Minimized dock items - use same structure as main dock */
.minimized-dock .dock-item.minimized-item {
    animation: minimized-dock-item-enter 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Entrance animation for minimized dock items */
@keyframes minimized-dock-item-enter {
    0% {
        opacity: 0;
        transform: scale(0.3) translateY(20px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}
/* VirtualMac Dock Styles - macOS-style dock */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
}

/* Windows container - transparent overlay for window management */
.windows-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
}

.windows-container .window {
    pointer-events: auto;
}

/* Dock container - contains the main dock */
.dock-container {
    position: relative;
}

/* Dock background with glass effect */
.dock {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 4px 12px;
    gap: 6px;
    background: var(--dock-bg, rgba(255, 255, 255, 0.2));
    backdrop-filter: blur(30px) saturate(180%);
    -webkit-backdrop-filter: blur(30px) saturate(180%);
    border-radius: 18px;
    border: 1px solid var(--dock-border);
    box-shadow:
        0 0 0 0.5px rgba(0, 0, 0, 0.1),
        0 8px 32px rgba(0, 0, 0, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.4),
        inset 0 -1px 0 rgba(0, 0, 0, 0.05);
}

/* Dock separator */
.dock-separator {
    width: 1px;
    height: 48px;
    background: linear-gradient(
        to bottom,
        transparent 0%,
        rgba(255, 255, 255, 0.4) 20%,
        rgba(255, 255, 255, 0.4) 80%,
        transparent 100%
    );
    margin: 0 8px;
    align-self: center;
}

/* Individual dock item container */
.dock-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    position: relative;
    padding: 4px 4px 8px 4px;
    transition: transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1);
    transform-origin: bottom center;
}

/* Icon wrapper for reflection effect */
.dock-icon-wrapper {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Dock icon base styles - fixed size rounded square background */
.dock-icon {
    /* Fixed size - never shrinks */
    width: 48px;
    height: 48px;
    min-width: 48px;
    min-height: 48px;
    max-width: 48px;
    max-height: 48px;

    /* Rounded square background with forced clipping */
    border-radius: 11px;
    -webkit-border-radius: 11px;
    -webkit-mask-image: -webkit-radial-gradient(white, black);

    /* Content floats in center */
    display: flex;
    align-items: center;
    justify-content: center;

    /* Default text styling for emoji/characters */
    font-size: 28px;
    line-height: 1;
    text-align: center;
    font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
    color: white;

    /* Positioning and effects */
    position: relative;
    overflow: hidden;
    transition: all 0.15s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);

    /* Default gray background - overridden per icon */
    background: linear-gradient(180deg, #8e8e93 0%, #636366 100%);
}

/* Icon reflection */
.dock-icon::after {
    content: '';
    position: absolute;
    bottom: -12px;
    left: 0;
    right: 0;
    height: 12px;
    background: inherit;
    border-radius: 11px;
    transform: scaleY(-0.35) perspective(100px) rotateX(20deg);
    filter: blur(2px);
    opacity: 0.3;
    mask-image: linear-gradient(to bottom, rgba(0,0,0,0.4) 0%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,0.4) 0%, transparent 100%);
    pointer-events: none;
}

/* Running app indicator */
.dock-indicator {
    width: 5px;
    height: 5px;
    background: var(--dock-indicator-color);
    border-radius: 50%;
    margin-top: 7px;
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
    box-shadow: 0 0 4px var(--dock-indicator-glow);
}

.dock-indicator.running {
    opacity: 0.85;
}

.dock-indicator.active {
    opacity: 1;
    transform: scale(1.4);
    box-shadow: 0 0 6px var(--dock-indicator-glow);
}

/* Tooltip on hover */
.dock-item::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    background: var(--dock-tooltip-bg);
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease, transform 0.15s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    z-index: 1001;
}

.dock-item:hover::before {
    opacity: 1;
    transform: translateX(-50%) translateY(-12px);
}

/* App icon backgrounds - macOS style gradients */
.dock-icon.finder {
    background: linear-gradient(180deg, #4da6ff 0%, #1a8cff 50%, #0066cc 100%);
    border-radius: 11px;
}

.dock-icon.safari {
    background: linear-gradient(135deg, #00c6fb 0%, #005bea 100%);
}

.dock-icon.messages {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

.dock-icon.mail {
    background: linear-gradient(135deg, #4facfe 0%, #00c6fb 100%);
}

.dock-icon.photos {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

.dock-icon.music {
    background: linear-gradient(135deg, #fa709a 0%, #ff6b6b 100%);
}

.dock-icon.notes {
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
    color: #333;
}

.dock-icon.calendar {
    background: linear-gradient(135deg, #ffffff 0%, #f0f0f0 100%);
    color: #333;
}

.dock-icon.settings {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.dock-icon.terminal {
    background: linear-gradient(180deg, #1a1a1a 0%, #333333 100%);
    font-family: "SF Mono", Menlo, Monaco, monospace;
    font-weight: bold;
    font-size: 18px;
}

.dock-icon.trash {
    background: linear-gradient(135deg, #e0e0e0 0%, #9e9e9e 100%);
    color: #555;
}

/* Downloads folder icon */
.dock-icon.downloads {
    background: linear-gradient(135deg, #667eea 0%, #00c6fb 100%);
}

/* Magnification effect - applied via inline styles from Rust */
.dock-item.magnified {
    transform: scale(var(--scale, 1)) translateY(calc((var(--scale, 1) - 1) * -24px));
}

/* Bounce animation for opening apps */
@keyframes dock-bounce {
    0%, 100% { transform: translateY(0); }
    25% { transform: translateY(-20px); }
    50% { transform: translateY(-10px); }
    75% { transform: translateY(-15px); }
}

.dock-item.bouncing .dock-icon {
    animation: dock-bounce 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Genie effect - minimize animation
   Simulates the classic macOS genie effect where windows
   appear to pour into the dock. Uses --dock-target-x for horizontal movement. */
@keyframes genie-minimize {
    0% {
        transform: scale(1) translate(0, 0) perspective(1000px) rotateX(0deg);
        opacity: 1;
        clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%);
    }
    30% {
        transform: scale(0.8) translate(calc(var(--dock-target-x, 0px) * 0.3), 30vh) perspective(1000px) rotateX(5deg);
        opacity: 1;
        clip-path: polygon(10% 0%, 90% 0%, 95% 100%, 5% 100%);
    }
    60% {
        transform: scale(0.4) translate(calc(var(--dock-target-x, 0px) * 0.7), 60vh) perspective(1000px) rotateX(10deg);
        opacity: 0.9;
        clip-path: polygon(25% 0%, 75% 0%, 85% 100%, 15% 100%);
    }
    100% {
        transform: scale(0.05) translate(var(--dock-target-x, 0px), calc(100vh - 80px)) perspective(1000px) rotateX(15deg);
        opacity: 0;
        clip-path: polygon(40% 0%, 60% 0%, 70% 100%, 30% 100%);
    }
}

/* Genie effect - restore animation
   Reverse of minimize, window emerges from dock. Uses --dock-target-x for horizontal movement. */
@keyframes genie-restore {
    0% {
        transform: scale(0.05) translate(var(--dock-target-x, 0px), calc(100vh - 80px)) perspective(1000px) rotateX(15deg);
        opacity: 0;
        clip-path: polygon(40% 0%, 60% 0%, 70% 100%, 30% 100%);
    }
    40% {
        transform: scale(0.4) translate(calc(var(--dock-target-x, 0px) * 0.7), 60vh) perspective(1000px) rotateX(10deg);
        opacity: 0.9;
        clip-path: polygon(25% 0%, 75% 0%, 85% 100%, 15% 100%);
    }
    70% {
        transform: scale(0.8) translate(calc(var(--dock-target-x, 0px) * 0.3), 30vh) perspective(1000px) rotateX(5deg);
        opacity: 1;
        clip-path: polygon(10% 0%, 90% 0%, 95% 100%, 5% 100%);
    }
    100% {
        transform: scale(1) translate(0, 0) perspective(1000px) rotateX(0deg);
        opacity: 1;
        clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%);
    }
}

/* ============================================
   Finder App Styles - macOS-style file browser
   ============================================ */

.finder {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: var(--finder-bg);
    border-radius: 0;
    overflow: hidden;
}

/* Finder Toolbar */
.finder-toolbar {
    height: 52px;
    background: linear-gradient(180deg, var(--finder-toolbar-start) 0%, var(--finder-toolbar-end) 100%);
    border-bottom: 1px solid var(--finder-toolbar-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
    gap: 12px;
}

.finder-toolbar-left {
    display: flex;
    align-items: center;
    gap: 4px;
}

.finder-nav-btn {
    width: 28px;
    height: 24px;
    border: none;
    background: transparent;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--finder-text-secondary);
    font-size: 10px;
}

.finder-nav-btn:hover {
    background: var(--finder-nav-btn-hover);
}

.finder-nav-btn:active {
    background: var(--finder-nav-btn-active);
}

.finder-toolbar-title {
    flex: 1;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    color: var(--finder-text);
}

.finder-toolbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.finder-view-btns {
    display: flex;
    background: var(--finder-view-btns-bg);
    border-radius: 6px;
    padding: 2px;
}

.finder-view-btn {
    width: 26px;
    height: 22px;
    border: none;
    background: transparent;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--finder-text-secondary);
    font-size: 11px;
}

.finder-view-btn.active {
    background: var(--finder-view-btn-active);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    color: var(--finder-text);
}

.finder-view-btn:hover:not(.active) {
    color: var(--finder-text);
}

.finder-search {
    display: flex;
    align-items: center;
    background: var(--finder-search-bg);
    border: 1px solid var(--finder-search-border);
    border-radius: 6px;
    padding: 4px 8px;
    gap: 6px;
    min-width: 180px;
}

.search-icon {
    font-size: 12px;
    opacity: 0.5;
}

.finder-search-input {
    border: none;
    outline: none;
    background: transparent;
    font-size: 12px;
    width: 100%;
    font-family: inherit;
    color: var(--finder-text);
}

.finder-search-input::placeholder {
    color: var(--finder-text-muted);
}

/* Finder Body - Sidebar + Content */
.finder-body {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Finder Sidebar */
.finder-sidebar {
    width: 180px;
    background: var(--finder-sidebar-bg);
    border-right: 1px solid var(--finder-sidebar-border);
    overflow-y: auto;
    padding: 8px 0;
}

.sidebar-section {
    margin-bottom: 16px;
}

.sidebar-header {
    font-size: 11px;
    font-weight: 600;
    color: var(--finder-text-muted);
    text-transform: uppercase;
    padding: 4px 12px 6px;
    letter-spacing: 0.5px;
}

.sidebar-item {
    display: flex;
    align-items: center;
    padding: 5px 12px;
    cursor: pointer;
    border-radius: 6px;
    margin: 0 8px;
    gap: 8px;
    transition: background-color 0.1s;
}

.sidebar-item:hover {
    background: var(--finder-hover);
}

.sidebar-item.selected {
    background: var(--finder-selected);
}

.sidebar-icon {
    font-size: 14px;
    width: 20px;
    text-align: center;
}

.sidebar-name {
    font-size: 13px;
    color: var(--finder-text);
}

.sidebar-item.selected .sidebar-name {
    color: var(--finder-accent);
    font-weight: 500;
}

/* Sidebar tag dots */
.sidebar-tag-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.tag-item {
    cursor: default;
    opacity: 0.6;
}

.tag-item:hover {
    background: transparent;
}

/* Finder Content Area */
.finder-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--finder-bg);
    overflow: hidden;
}

.finder-grid {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 8px;
    padding: 16px;
    overflow-y: auto;
    align-content: start;
}

.finder-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.1s;
}

.finder-item:hover {
    background: var(--finder-hover);
}

.finder-item.selected {
    background: var(--finder-selected);
}

.finder-item-icon {
    font-size: 48px;
    margin-bottom: 6px;
    line-height: 1;
}

.finder-item-name {
    font-size: 11px;
    text-align: center;
    color: var(--finder-text);
    word-break: break-word;
    max-width: 80px;
    line-height: 1.3;
}

.finder-item.selected .finder-item-name {
    background: var(--finder-accent);
    color: white;
    padding: 1px 6px;
    border-radius: 3px;
}

/* Finder Status Bar */
.finder-statusbar {
    height: 24px;
    background: var(--finder-statusbar-bg);
    border-top: 1px solid var(--finder-statusbar-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
    font-size: 11px;
    color: var(--finder-text-secondary);
}

.statusbar-left,
.statusbar-right {
    font-size: 11px;
    color: var(--finder-text-secondary);
}

/* Finder Path Bar */
.finder-pathbar {
    height: 24px;
    background: var(--finder-toolbar-end);
    border-top: 1px solid var(--finder-toolbar-border);
    border-bottom: 1px solid var(--finder-toolbar-border);
    display: flex;
    align-items: center;
    padding: 0 12px;
    gap: 4px;
    overflow: hidden;
}

.pathbar-segment {
    display: flex;
    align-items: center;
    gap: 4px;
    background: transparent;
    border: none;
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 11px;
    color: var(--finder-text);
    cursor: pointer;
    white-space: nowrap;
    font-family: inherit;
}

.pathbar-segment:hover {
    background: var(--finder-hover);
}

.pathbar-segment:active {
    background: var(--finder-selected);
}

.pathbar-icon {
    font-size: 12px;
}

.pathbar-separator {
    color: var(--finder-text-muted);
    font-size: 10px;
    flex-shrink: 0;
}

/* Finder List View */
.finder-list {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

.finder-list-header {
    display: flex;
    padding: 8px 16px;
    background: var(--finder-toolbar-end);
    border-bottom: 1px solid var(--finder-toolbar-border);
    font-size: 11px;
    font-weight: 600;
    color: var(--finder-text-secondary);
    user-select: none;
}

.finder-list-body {
    flex: 1;
    overflow-y: auto;
}

.finder-list-row {
    display: flex;
    padding: 6px 16px;
    align-items: center;
    border-bottom: 1px solid var(--finder-hover);
    cursor: pointer;
    transition: background-color 0.1s;
}

.finder-list-row:hover {
    background: var(--finder-hover);
}

.finder-list-row.selected {
    background: var(--finder-selected);
}

.list-col {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12px;
    color: var(--finder-text);
}

.list-col.name {
    flex: 2;
    display: flex;
    align-items: center;
    gap: 8px;
}

.list-col.date {
    flex: 1;
    min-width: 120px;
    color: var(--finder-text-secondary);
}

.list-col.size {
    flex: 0 0 80px;
    text-align: right;
    color: var(--finder-text-secondary);
}

.list-col.kind {
    flex: 0 0 100px;
    color: var(--finder-text-secondary);
}

.list-item-icon {
    font-size: 16px;
    width: 20px;
    text-align: center;
}

.list-item-name {
    overflow: hidden;
    text-overflow: ellipsis;
}

.finder-list-row.selected .list-item-name {
    color: var(--finder-accent);
    font-weight: 500;
}

/* Finder Column View (Miller Columns) */
.finder-columns {
    display: flex;
    flex: 1;
    overflow-x: auto;
    overflow-y: hidden;
}

.finder-column {
    min-width: 200px;
    max-width: 250px;
    border-right: 1px solid var(--finder-sidebar-border);
    overflow-y: auto;
    flex-shrink: 0;
    background: var(--finder-bg);
}

.finder-column:last-child {
    border-right: none;
    flex: 1;
    max-width: none;
}

.finder-column-item {
    display: flex;
    align-items: center;
    padding: 6px 12px;
    cursor: pointer;
    gap: 8px;
    border-bottom: 1px solid transparent;
    transition: background-color 0.1s;
}

.finder-column-item:hover {
    background: var(--finder-hover);
}

.finder-column-item.selected {
    background: var(--finder-selected);
}

.finder-column-item.has-children::after {
    content: "›";
    margin-left: auto;
    color: var(--finder-text-muted);
    font-size: 14px;
    font-weight: bold;
}

.column-item-icon {
    font-size: 16px;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.column-item-name {
    font-size: 12px;
    color: var(--finder-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

.finder-column-item.selected .column-item-name {
    color: var(--finder-accent);
    font-weight: 500;
}

/* Finder Rename Input */
.finder-rename-input {
    font-size: 11px;
    text-align: center;
    border: 2px solid var(--finder-accent);
    border-radius: 3px;
    padding: 2px 6px;
    background: white;
    outline: none;
    max-width: 80px;
    font-family: inherit;
    color: var(--finder-text);
}

.finder-rename-input:focus {
    box-shadow: 0 0 0 2px rgba(0, 122, 255, 0.3);
}

/* List view rename input */
.finder-list-row .finder-rename-input {
    text-align: left;
    max-width: 200px;
}

/* ======================================
   Drag and Drop Styles
   ====================================== */

/* Drop target highlighting */
.drop-target {
    outline: 2px dashed var(--finder-accent, #007aff);
    outline-offset: -2px;
    background-color: rgba(0, 122, 255, 0.1) !important;
}

/* Folder drop target in grid view */
.finder-item.drop-target {
    background-color: rgba(0, 122, 255, 0.2) !important;
    border-radius: 8px;
}

/* Folder drop target in list view */
.finder-list-row.drop-target {
    background-color: rgba(0, 122, 255, 0.15) !important;
}

/* Desktop drop target */
.desktop.drop-target {
    outline: 3px dashed rgba(255, 255, 255, 0.5);
    outline-offset: -10px;
}

/* Dragging state for items */
.finder-item[draggable="true"],
.finder-list-row[draggable="true"],
.finder-column-item[draggable="true"] {
    cursor: grab;
}

.finder-item[draggable="true"]:active,
.finder-list-row[draggable="true"]:active,
.finder-column-item[draggable="true"]:active {
    cursor: grabbing;
}

/* Reduce opacity when being dragged */
.finder-item:has(:active[draggable="true"]),
.finder-list-row:has(:active[draggable="true"]) {
    opacity: 0.6;
}

/* Calculator App Styles - macOS Calculator clone */
.calculator {
    width: 100%;
    height: 100%;
    background: #1c1c1c;
    display: flex;
    flex-direction: column;
    padding: 0;
    user-select: none;
}

.calc-display {
    background: #1c1c1c;
    padding: 12px 20px;
    text-align: right;
    min-height: 100px;
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
}

.calc-display-text {
    color: white;
    font-size: 64px;
    font-weight: 300;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Helvetica Neue', sans-serif;
    line-height: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

.calc-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    background: #1c1c1c;
    padding: 12px;
    flex: 1;
}

.calc-btn {
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    width: 56px;
    height: 56px;
    min-width: 56px;
    min-height: 56px;
    font-size: 22px;
    font-weight: 400;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Helvetica Neue', sans-serif;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    line-height: 1;
    padding: 0;
    box-sizing: border-box;
    transition: filter 0.1s;
}

.calc-btn:active {
    filter: brightness(1.3);
}

.calc-btn.digit {
    background: #505050;
    color: white;
}

.calc-btn.digit:hover {
    background: #6a6a6a;
}

.calc-btn.function {
    background: #a5a5a5;
    color: #1c1c1c;
}

.calc-btn.function:hover {
    background: #c5c5c5;
}

.calc-btn.operator {
    background: #FF9500;
    color: white;
}

.calc-btn.operator:hover {
    background: #FFB340;
}

.calc-btn.operator.active {
    background: #FFFFFF;
    color: #FF9500;
}

.calc-btn.memory {
    background: #505050;
    color: #fff;
    font-size: 18px;
}

.calc-btn.memory:hover {
    background: #606060;
}

.calc-btn.memory.has-value {
    color: #ffa500;
}

.calc-btn.zero {
    grid-column: span 2;
    border-radius: 28px;
    width: auto;
    min-width: 124px;
    height: 56px;
    min-height: 56px;
    justify-content: flex-start;
    padding-left: 22px;
}

/* Calculator window specific overrides */
.window-content.calculator-content {
    padding: 0;
    background: #1c1c1c;
    overflow: hidden;
}

/* Dock calculator icon */
.dock-icon.calculator {
    background: linear-gradient(180deg, #ff9500 0%, #ff6b00 100%);
    color: white;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", sans-serif;
    font-weight: 300;
    font-size: 28px;
}

/* ============================================
   Spotlight Search - macOS-style search overlay
   ============================================ */

.spotlight-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    justify-content: center;
    padding-top: 15vh;
    z-index: 10000;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

.spotlight-container {
    width: 680px;
    max-width: 90vw;
    background: rgba(30, 30, 30, 0.95);
    border-radius: 12px;
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.1),
        0 20px 60px rgba(0, 0, 0, 0.5),
        0 0 80px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    overflow: hidden;
    animation: spotlight-appear 0.15s ease-out;
}

@keyframes spotlight-appear {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.spotlight-search-bar {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    gap: 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.spotlight-icon {
    font-size: 22px;
    opacity: 0.7;
    filter: grayscale(100%);
}

.spotlight-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    font-size: 22px;
    font-weight: 300;
    color: #ffffff;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Helvetica Neue', sans-serif;
}

.spotlight-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.spotlight-results {
    max-height: 400px;
    overflow-y: auto;
    padding: 8px 0;
}

.spotlight-result-item {
    display: flex;
    align-items: center;
    padding: 10px 20px;
    gap: 14px;
    cursor: pointer;
    transition: background-color 0.1s;
}

.spotlight-result-item:hover,
.spotlight-result-item.selected {
    background: rgba(0, 122, 255, 0.4);
}

.spotlight-result-icon {
    font-size: 32px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
}

.spotlight-result-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.spotlight-result-name {
    font-size: 14px;
    font-weight: 500;
    color: #ffffff;
}

.spotlight-result-kind {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
}

/* Scrollbar styling for Spotlight results */
.spotlight-results::-webkit-scrollbar {
    width: 8px;
}

.spotlight-results::-webkit-scrollbar-track {
    background: transparent;
}

.spotlight-results::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.spotlight-results::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* ============================================
   Context Menu - macOS-style right-click menu
   ============================================ */

.context-menu-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9998;
}

.context-menu {
    position: fixed;
    min-width: 200px;
    max-width: 280px;
    background: rgba(40, 40, 40, 0.95);
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    border-radius: 8px;
    padding: 5px 0;
    box-shadow:
        0 0 0 0.5px rgba(255, 255, 255, 0.15),
        0 10px 30px rgba(0, 0, 0, 0.4),
        0 0 1px rgba(0, 0, 0, 0.2);
    z-index: 9999;
    animation: context-menu-appear 0.1s ease-out;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', Roboto, sans-serif;
}

@keyframes context-menu-appear {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.context-menu-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 12px;
    margin: 0 5px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.1s;
}

.context-menu-item:hover {
    background: rgba(0, 122, 255, 0.8);
}

.context-menu-item.disabled {
    opacity: 0.4;
    cursor: default;
    pointer-events: none;
}

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

.context-menu-label {
    font-size: 13px;
    font-weight: 400;
    color: #ffffff;
    white-space: nowrap;
}

.context-menu-shortcut {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    margin-left: 24px;
}

.context-menu-separator {
    height: 1px;
    background: rgba(255, 255, 255, 0.12);
    margin: 5px 12px;
}

/* Feature Tour - Desktop welcome text */
.feature-tour {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: rgba(255, 255, 255, 0.9);
    pointer-events: none;
    user-select: none;
    z-index: 1;
}

.feature-tour-title {
    font-size: 48px;
    font-weight: 700;
    margin-bottom: 12px;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
    letter-spacing: -0.5px;
}

.feature-tour-subtitle {
    font-size: 18px;
    font-weight: 400;
    margin-bottom: 40px;
    opacity: 0.85;
    text-shadow: 0 1px 10px rgba(0, 0, 0, 0.2);
}

.feature-tour-items {
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: center;
}

.feature-tour-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 12px 24px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.feature-tour-icon {
    font-size: 24px;
}

.feature-tour-text {
    font-size: 15px;
    font-weight: 500;
}

/* App Switcher (Cmd+Tab) */
.app-switcher-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10001;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.app-switcher-container {
    background: rgba(30, 30, 30, 0.95);
    border-radius: 18px;
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.1),
        0 25px 80px rgba(0, 0, 0, 0.6),
        0 0 100px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    padding: 20px 24px;
    animation: app-switcher-appear 0.12s ease-out;
}

@keyframes app-switcher-appear {
    from {
        opacity: 0;
        transform: scale(0.92);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.app-switcher-apps {
    display: flex;
    gap: 8px;
}

.app-switcher-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 16px;
    border-radius: 12px;
    cursor: pointer;
    transition: background-color 0.1s, transform 0.1s;
    min-width: 80px;
}

.app-switcher-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

.app-switcher-item.selected {
    background: rgba(0, 122, 255, 0.5);
    transform: scale(1.05);
}

.app-switcher-icon {
    font-size: 48px;
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    margin-bottom: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.app-switcher-item.selected .app-switcher-icon {
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.4), 0 4px 12px rgba(0, 0, 0, 0.3);
}

.app-switcher-name {
    font-size: 12px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 70px;
}

/* ============================================
   TextEdit App Styles - macOS-style text editor
   ============================================ */

.textedit {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #ffffff;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Helvetica Neue', sans-serif;
}

.textedit-toolbar {
    display: flex;
    align-items: center;
    padding: 6px 12px;
    background: linear-gradient(180deg, #fafafa 0%, #e8e8e8 100%);
    border-bottom: 1px solid #b8b8b8;
    gap: 6px;
    min-height: 36px;
    flex-wrap: wrap;
}

.textedit-toolbar-group {
    display: flex;
    align-items: center;
    gap: 4px;
}

.textedit-toolbar-separator {
    width: 1px;
    height: 18px;
    background: linear-gradient(180deg, transparent 0%, #c0c0c0 20%, #c0c0c0 80%, transparent 100%);
    margin: 0 2px;
}

.textedit-btn {
    min-width: 26px;
    height: 22px;
    padding: 0 6px;
    border: 1px solid #c0c0c0;
    background: linear-gradient(180deg, #fefefe 0%, #f0f0f0 100%);
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.1s;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
}

.textedit-btn:hover {
    background: linear-gradient(180deg, #ffffff 0%, #f5f5f5 100%);
    border-color: #a0a0a0;
}

.textedit-btn:active {
    background: linear-gradient(180deg, #e8e8e8 0%, #d8d8d8 100%);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

.textedit-btn.active {
    background: linear-gradient(180deg, #d8d8d8 0%, #c8c8c8 100%);
    border-color: #a0a0a0;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.15);
}

.textedit-font-size {
    font-size: 12px;
    color: #666;
    min-width: 40px;
    text-align: center;
}

.textedit-select {
    height: 22px;
    padding: 0 6px;
    border: 1px solid #c0c0c0;
    background: linear-gradient(180deg, #fefefe 0%, #f0f0f0 100%);
    border-radius: 3px;
    font-size: 11px;
    color: #333;
    cursor: pointer;
    outline: none;
    font-family: -apple-system, BlinkMacSystemFont, sans-serif;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
    -webkit-appearance: none;
    appearance: none;
    padding-right: 18px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='4' viewBox='0 0 8 4'%3E%3Cpath fill='%23666' d='M0 0l4 4 4-4z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 6px center;
}

.textedit-select:hover {
    border-color: #a0a0a0;
}

.textedit-select:focus {
    border-color: #007aff;
    box-shadow: 0 0 0 2px rgba(0, 122, 255, 0.2);
}

.textedit-select-size {
    width: 60px;
}

/* Alignment icon representations using CSS lines */
.textedit-align-icon {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 14px;
    height: 12px;
    gap: 2px;
}

.textedit-align-icon::before,
.textedit-align-icon::after {
    content: "";
    display: block;
    height: 2px;
    background: currentColor;
    border-radius: 1px;
}

/* Left align: lines aligned left, different widths */
.textedit-align-left::before {
    width: 14px;
    align-self: flex-start;
}
.textedit-align-left::after {
    width: 10px;
    align-self: flex-start;
}

/* Center align: lines centered */
.textedit-align-center::before {
    width: 14px;
}
.textedit-align-center::after {
    width: 10px;
}

/* Right align: lines aligned right */
.textedit-align-right::before {
    width: 14px;
    align-self: flex-end;
}
.textedit-align-right::after {
    width: 10px;
    align-self: flex-end;
}

/* Justify: all lines full width */
.textedit-align-justify::before {
    width: 14px;
}
.textedit-align-justify::after {
    width: 14px;
}

/* Document wrapper - gray background, scrollable */
.textedit-document-wrapper {
    flex: 1;
    overflow-y: auto;
    background: #e0e0e0;
    padding: 24px;
}

/* Document page - white page with shadow */
.textedit-document {
    max-width: 8.5in;
    min-height: 11in;
    margin: 0 auto;
    background: white;
    box-shadow:
        0 1px 3px rgba(0, 0, 0, 0.12),
        0 1px 2px rgba(0, 0, 0, 0.24);
    padding: 1in;
    outline: none;
    line-height: 1.6;
    color: #1a1a1a;
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

.textedit-document:focus {
    outline: none;
}

[data-theme="dark"] .textedit-document-wrapper {
    background: #3a3a3a;
}

[data-theme="dark"] .textedit-document {
    background: #2d2d2d;
    color: #e5e5e5;
    box-shadow:
        0 1px 3px rgba(0, 0, 0, 0.3),
        0 1px 2px rgba(0, 0, 0, 0.4);
}

/* Color picker styling */
.textedit-color-picker {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 24px;
    border: 1px solid #c8c8c8;
    background: linear-gradient(180deg, #ffffff 0%, #f0f0f0 100%);
    border-radius: 4px;
    cursor: pointer;
    overflow: hidden;
}

.textedit-color-picker:hover {
    border-color: #b0b0b0;
}

.textedit-color-label {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    pointer-events: none;
    z-index: 1;
}

.textedit-highlight-icon {
    background: #ffff00;
    padding: 0 3px;
    border-radius: 2px;
}

.textedit-color-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    border: none;
    padding: 0;
}

/* Color swatch below the A */
.textedit-color-swatch {
    position: absolute;
    bottom: 2px;
    left: 4px;
    right: 4px;
    height: 3px;
    background: #000000;
    border-radius: 1px;
    pointer-events: none;
}

/* Cursor and selection styling */
.textedit-document {
    cursor: text;
    caret-color: #000000;
}

[data-theme="dark"] .textedit-document {
    caret-color: #ffffff;
}

/* Selection styling to match macOS */
.textedit-document::selection {
    background: #b4d5fe;
}

.textedit-document *::selection {
    background: #b4d5fe;
}

[data-theme="dark"] .textedit-document::selection {
    background: #3f638b;
}

[data-theme="dark"] .textedit-document *::selection {
    background: #3f638b;
}

/* Scrollbar styling for document wrapper */
.textedit-document-wrapper::-webkit-scrollbar {
    width: 10px;
}

.textedit-document-wrapper::-webkit-scrollbar-track {
    background: #f0f0f0;
}

.textedit-document-wrapper::-webkit-scrollbar-thumb {
    background: #c0c0c0;
    border-radius: 5px;
    border: 2px solid #f0f0f0;
}

.textedit-document-wrapper::-webkit-scrollbar-thumb:hover {
    background: #a0a0a0;
}

[data-theme="dark"] .textedit-document-wrapper::-webkit-scrollbar-track {
    background: #2d2d2d;
}

[data-theme="dark"] .textedit-document-wrapper::-webkit-scrollbar-thumb {
    background: #5a5a5a;
    border-color: #2d2d2d;
}

/* Placeholder text styling */
.textedit-document:empty::before {
    content: "Start typing...";
    color: #999;
    pointer-events: none;
}

[data-theme="dark"] .textedit-document:empty::before {
    color: #666;
}

.textedit-statusbar {
    height: 20px;
    background: linear-gradient(180deg, #f6f6f6 0%, #ececec 100%);
    border-top: 1px solid #c8c8c8;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0 12px;
    font-size: 11px;
    color: #666;
    gap: 8px;
}

.textedit-statusbar-item {
    white-space: nowrap;
}

.textedit-statusbar-separator {
    width: 1px;
    height: 10px;
    background: #c8c8c8;
}

/* TextEdit dark mode toolbar and statusbar */
[data-theme="dark"] .textedit-toolbar {
    background: linear-gradient(180deg, #4a4a4a 0%, #3a3a3a 100%);
    border-bottom-color: #2a2a2a;
}

[data-theme="dark"] .textedit-btn {
    background: linear-gradient(180deg, #5a5a5a 0%, #4a4a4a 100%);
    border-color: #3a3a3a;
    color: #e0e0e0;
}

[data-theme="dark"] .textedit-btn:hover {
    background: linear-gradient(180deg, #6a6a6a 0%, #5a5a5a 100%);
}

[data-theme="dark"] .textedit-btn.active {
    background: linear-gradient(180deg, #3a3a3a 0%, #2a2a2a 100%);
}

[data-theme="dark"] .textedit-select {
    background: linear-gradient(180deg, #5a5a5a 0%, #4a4a4a 100%);
    border-color: #3a3a3a;
    color: #e0e0e0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='4' viewBox='0 0 8 4'%3E%3Cpath fill='%23999' d='M0 0l4 4 4-4z'/%3E%3C/svg%3E");
}

[data-theme="dark"] .textedit-statusbar {
    background: linear-gradient(180deg, #3a3a3a 0%, #2d2d2d 100%);
    border-top-color: #1a1a1a;
    color: #999;
}

[data-theme="dark"] .textedit-statusbar-separator {
    background: #555;
}

[data-theme="dark"] .textedit-toolbar-separator {
    background: linear-gradient(180deg, transparent 0%, #555 20%, #555 80%, transparent 100%);
}

/* TextEdit window content override */
.window-content.textedit-content {
    padding: 0;
    overflow: hidden;
}

/* Dock TextEdit icon */
.dock-icon.textedit {
    background: linear-gradient(180deg, #fff 0%, #e8e8e8 100%);
    color: #333;
    font-family: "Times New Roman", Georgia, serif;
    font-weight: bold;
    font-style: italic;
    font-size: 26px;
}

/* Wallpaper Picker Styles */
.settings-pane-description {
    font-size: 13px;
    color: #888;
    margin-bottom: 20px;
}

.wallpaper-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 16px;
}

.wallpaper-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: background-color 0.15s;
}

.wallpaper-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.wallpaper-item.selected {
    background: rgba(0, 122, 255, 0.2);
}

.wallpaper-item.selected .wallpaper-thumbnail {
    box-shadow: 0 0 0 3px #007aff;
}

.wallpaper-thumbnail {
    width: 120px;
    height: 75px;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: box-shadow 0.15s;
}

.wallpaper-name {
    font-size: 12px;
    color: #fff;
    margin-top: 8px;
    text-align: center;
}

[data-theme="light"] .wallpaper-item:hover {
    background: rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .wallpaper-item.selected {
    background: rgba(0, 122, 255, 0.15);
}

[data-theme="light"] .wallpaper-name {
    color: #333;
}

/* Build Info - Version and build time display at bottom left of desktop */
.build-info {
    position: fixed;
    bottom: 12px;
    left: 16px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Menlo', monospace;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.7);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    pointer-events: none;
    user-select: none;
    z-index: 1002;
}

.build-version {
    font-weight: 500;
}

.build-time {
    font-size: 10px;
    opacity: 0.8;
}

/* ===============================
   TERMINAL STYLES
   =============================== */

/* Terminal CSS custom properties (Pro profile) */
:root {
    --terminal-bg: #000000;
    --terminal-bg-opacity: 0.85;
    --terminal-text: #FFFFFF;
    --terminal-cursor: #FFFFFF;
    --terminal-selection: #4A90D9;
    --terminal-scrollbar-thumb: rgba(255, 255, 255, 0.3);
    --terminal-scrollbar-track: transparent;
}

.terminal {
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.90);
    color: var(--terminal-text);
    font-family: "SF Mono", "Menlo", "Monaco", "Consolas", monospace;
    font-size: 11px;
    line-height: 1.4;
    display: flex;
    flex-direction: column;
    padding: 4px 6px;
    box-sizing: border-box;
    overflow: hidden;
}

.terminal-output {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding-bottom: 4px;
}

.terminal-line {
    white-space: pre-wrap;
    word-break: break-all;
    min-height: 1.4em;
}

.terminal-input-line {
    display: flex;
    align-items: center;
    white-space: nowrap;
    flex-shrink: 0;
}

.terminal-prompt {
    color: var(--terminal-text);
    flex-shrink: 0;
    white-space: pre;
}

.terminal-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--terminal-text);
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
    caret-color: var(--terminal-cursor);
    padding: 0;
    margin: 0;
}

.terminal-input::selection {
    background: var(--terminal-selection);
}

/* Terminal scrollbar styling (macOS style) */
.terminal-output::-webkit-scrollbar {
    width: 8px;
}

.terminal-output::-webkit-scrollbar-track {
    background: var(--terminal-scrollbar-track);
}

.terminal-output::-webkit-scrollbar-thumb {
    background: var(--terminal-scrollbar-thumb);
    border-radius: 4px;
}

.terminal-output::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* Firefox scrollbar styling */
.terminal-output {
    scrollbar-width: thin;
    scrollbar-color: var(--terminal-scrollbar-thumb) var(--terminal-scrollbar-track);
}

/* ========================================
   NOTES APP STYLES
   ======================================== */

.notes-app {
    display: flex;
    height: 100%;
    font-family: var(--font-family);
    background: var(--window-bg);
    overflow: hidden;
}

/* Folder Sidebar */
.notes-folder-sidebar {
    width: 190px;
    min-width: 170px;
    max-width: 230px;
    background: rgba(244, 244, 246, 0.95);
    border-right: 1px solid rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

[data-theme="dark"] .notes-folder-sidebar {
    background: rgba(44, 44, 46, 0.95);
    border-right-color: rgba(255, 255, 255, 0.1);
}

.notes-sidebar-header {
    padding: 10px 16px 6px;
    font-size: 10px;
    font-weight: 600;
    color: #7a7a80;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

[data-theme="dark"] .notes-sidebar-header {
    color: #8e8e93;
}

.notes-folder-item {
    display: flex;
    align-items: center;
    padding: 7px 12px;
    cursor: pointer;
    border-radius: 6px;
    margin: 2px 8px;
    transition: background-color 0.15s ease;
}

.notes-folder-item:hover {
    background: rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .notes-folder-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .notes-folder-item.selected {
    background: rgba(255, 255, 255, 0.14);
    color: #f2f2f4;
}

[data-theme="dark"] .notes-folder-item.selected:hover {
    background: rgba(255, 255, 255, 0.2);
}

.notes-folder-item.selected {
    background: rgba(0, 0, 0, 0.08);
    color: #1f1f22;
}

.notes-folder-item.selected:hover {
    background: rgba(0, 0, 0, 0.12);
}

.notes-folder-icon {
    font-size: 16px;
    margin-right: 10px;
    width: 20px;
    text-align: center;
}

.notes-folder-name {
    flex: 1;
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.notes-folder-count {
    font-size: 12px;
    color: #9a9aa0;
    margin-left: 8px;
}

.notes-folder-item.selected .notes-folder-count {
    color: rgba(31, 31, 34, 0.7);
}

[data-theme="dark"] .notes-folder-item.selected .notes-folder-count {
    color: rgba(242, 242, 244, 0.7);
}

/* Notes List (middle column) */
.notes-list {
    width: 310px;
    min-width: 230px;
    max-width: 360px;
    background: #fbfbfc;
    border-right: 1px solid rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

[data-theme="dark"] .notes-list {
    background: #2c2c2e;
    border-right-color: rgba(255, 255, 255, 0.1);
}

.notes-search-bar {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    margin: 8px 12px 10px;
    border-radius: 6px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    background: rgba(255, 255, 255, 0.9);
}

[data-theme="dark"] .notes-search-bar {
    border-color: rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
}

.notes-search-icon {
    font-size: 12px;
    color: #8e8e93;
    margin-right: 8px;
}

.notes-search-input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 13px;
    color: inherit;
    outline: none;
    font-family: inherit;
}

.notes-search-input::placeholder {
    color: #999;
}

[data-theme="dark"] .notes-search-input::placeholder {
    color: #8e8e93;
}

.notes-list-items {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding-bottom: 12px;
}

.notes-list-item {
    padding: 10px 14px;
    cursor: pointer;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    transition: background-color 0.15s ease;
}

.notes-list-item:hover {
    background: rgba(0, 0, 0, 0.03);
}

[data-theme="dark"] .notes-list-item {
    border-bottom-color: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .notes-list-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.notes-list-item.selected {
    background: #ffe28a;
    color: #1f1f22;
}

.notes-list-item.selected:hover {
    background: #ffd96d;
}

[data-theme="dark"] .notes-list-item.selected {
    background: #8c6a16;
    color: #f8f8fa;
}

[data-theme="dark"] .notes-list-item.selected:hover {
    background: #9b741a;
}

.notes-list-item-title {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.notes-list-item-preview {
    display: flex;
    align-items: center;
    font-size: 12px;
    color: #6f6f75;
}

[data-theme="dark"] .notes-list-item-preview {
    color: #8e8e93;
}

.notes-list-item.selected .notes-list-item-preview {
    color: rgba(0, 0, 0, 0.7);
}

[data-theme="dark"] .notes-list-item.selected .notes-list-item-preview {
    color: rgba(248, 248, 250, 0.7);
}

.notes-list-item-date {
    flex-shrink: 0;
    margin-right: 8px;
}

.notes-list-item-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Note Editor (right column) */
.notes-editor {
    flex: 1;
    min-width: 300px;
    display: flex;
    flex-direction: column;
    background: #fff;
    overflow: hidden;
}

[data-theme="dark"] .notes-editor {
    background: #1c1c1e;
}

.notes-editor-toolbar {
    display: flex;
    align-items: center;
    padding: 6px 14px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.12);
    background: linear-gradient(180deg, #f9f9f9 0%, #ededed 100%);
    min-height: 36px;
    gap: 6px;
    flex-wrap: wrap;
    font-family: "SF Pro Text", -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
}

[data-theme="dark"] .notes-editor-toolbar {
    border-bottom-color: rgba(255, 255, 255, 0.08);
    background: linear-gradient(180deg, #2c2c2e 0%, #262628 100%);
}

.notes-toolbar-placeholder {
    font-size: 12px;
    color: #999;
}

.notes-toolbar-btn {
    width: 26px;
    height: 24px;
    border: 1px solid rgba(0, 0, 0, 0.18);
    background: linear-gradient(180deg, #ffffff 0%, #f1f1f1 100%);
    border-radius: 5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    color: #2f2f2f;
    transition: background-color 0.15s ease, box-shadow 0.15s ease;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
}

.notes-toolbar-btn:hover {
    background: linear-gradient(180deg, #ffffff 0%, #f6f6f6 100%);
}

.notes-toolbar-btn:active {
    background: linear-gradient(180deg, #e4e4e4 0%, #d9d9d9 100%);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.15);
}

.notes-toolbar-btn.active {
    background: linear-gradient(180deg, #e0e9ff 0%, #cfe0ff 100%);
    border-color: rgba(0, 122, 255, 0.4);
    color: #0066d6;
}

[data-theme="dark"] .notes-toolbar-btn {
    color: #e5e5e7;
    border-color: rgba(255, 255, 255, 0.12);
    background: linear-gradient(180deg, #3b3b3e 0%, #2f2f32 100%);
}

[data-theme="dark"] .notes-toolbar-btn:hover {
    background: linear-gradient(180deg, #434348 0%, #35353a 100%);
}

[data-theme="dark"] .notes-toolbar-btn.active {
    background: linear-gradient(180deg, #19345f 0%, #132b54 100%);
    border-color: rgba(10, 132, 255, 0.5);
    color: #6db2ff;
}

.notes-toolbar-separator {
    width: 1px;
    height: 18px;
    background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.2) 20%, rgba(0, 0, 0, 0.2) 80%, transparent 100%);
    margin: 0 8px;
}

[data-theme="dark"] .notes-toolbar-separator {
    background: linear-gradient(
        180deg,
        transparent 0%,
        rgba(255, 255, 255, 0.2) 20%,
        rgba(255, 255, 255, 0.2) 80%,
        transparent 100%
    );
}

.notes-toolbar-group {
    display: flex;
    align-items: center;
    gap: 2px;
}

.notes-editor-content {
    flex: 1;
    padding: 18px 24px;
    overflow-y: auto;
    font-size: 15px;
    line-height: 1.55;
    outline: none;
    color: #1c1c1e;
    font-family: "SF Pro Text", -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
    letter-spacing: -0.1px;
    caret-color: #1c1c1e;
    background: #ffffff;
}

[data-theme="dark"] .notes-editor-content {
    color: #f5f5f7;
    caret-color: #f5f5f7;
    background: #1c1c1e;
}

.notes-editor-content::first-line {
    font-size: 22px;
    font-weight: 600;
    line-height: 1.35;
    color: #1c1c1e;
}

[data-theme="dark"] .notes-editor-content::first-line {
    color: #f5f5f7;
}

.notes-editor-content > div:first-child,
.notes-editor-content > p:first-child {
    font-size: 22px;
    font-weight: 600;
    line-height: 1.35;
    margin-bottom: 6px;
    color: #1c1c1e;
}

[data-theme="dark"] .notes-editor-content > div:first-child,
[data-theme="dark"] .notes-editor-content > p:first-child {
    color: #f5f5f7;
}

.notes-editor-content:focus {
    outline: none;
}

/* Placeholder styling for contenteditable */
.notes-editor-content:empty:before {
    content: "Start typing...";
    color: #999;
    pointer-events: none;
}

[data-theme="dark"] .notes-editor-content:empty:before {
    color: #666;
}

/* Empty state */
.notes-editor-empty {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
}

[data-theme="dark"] .notes-editor-empty {
    color: #666;
}

.notes-editor-empty-text {
    font-size: 15px;
    text-align: center;
}

/* Checklist styling (for Plan 03) */
.note-checklist-item {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    padding: 2px 0;
    line-height: 1.5;
}

.note-checkbox {
    width: 16px;
    height: 16px;
    margin-top: 3px;
    cursor: pointer;
    accent-color: #f7d154;
    flex-shrink: 0;
}

.note-checklist-item span {
    flex: 1;
}

.note-checkbox:checked + span {
    text-decoration: line-through;
    color: #999;
}

/* List styling inside editor */
.notes-editor-content ul,
.notes-editor-content ol {
    padding-left: 20px;
    margin: 6px 0 8px;
}

.notes-editor-content li {
    padding: 3px 0;
}

/* Scrollbar styling for Notes */
.notes-folder-sidebar::-webkit-scrollbar,
.notes-list-items::-webkit-scrollbar,
.notes-editor-content::-webkit-scrollbar {
    width: 8px;
}

.notes-folder-sidebar::-webkit-scrollbar-track,
.notes-list-items::-webkit-scrollbar-track,
.notes-editor-content::-webkit-scrollbar-track {
    background: transparent;
}

.notes-folder-sidebar::-webkit-scrollbar-thumb,
.notes-list-items::-webkit-scrollbar-thumb,
.notes-editor-content::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

[data-theme="dark"] .notes-folder-sidebar::-webkit-scrollbar-thumb,
[data-theme="dark"] .notes-list-items::-webkit-scrollbar-thumb,
[data-theme="dark"] .notes-editor-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
}

/* Action buttons (for CRUD in Plan 04) */
.notes-action-btn {
    padding: 4px 8px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    background: #ffffff;
    color: #1f1f22;
    border-radius: 6px;
    font-size: 11px;
    cursor: pointer;
    transition: background-color 0.15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 22px;
    line-height: 1;
}

.notes-action-btn:hover {
    background: rgba(0, 0, 0, 0.06);
}

.notes-action-btn.icon {
    width: 24px;
    padding: 0;
    font-size: 14px;
}

.notes-action-btn.ghost {
    background: transparent;
    border-color: transparent;
    color: #5a5a60;
    height: 20px;
    padding: 2px 6px;
}

.notes-action-btn.ghost:hover {
    background: rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] .notes-action-btn {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.12);
    color: #f2f2f4;
}

[data-theme="dark"] .notes-action-btn:hover {
    background: rgba(255, 255, 255, 0.16);
}

[data-theme="dark"] .notes-action-btn.ghost {
    background: transparent;
    border-color: transparent;
    color: #c7c7cc;
}

[data-theme="dark"] .notes-action-btn.ghost:hover {
    background: rgba(255, 255, 255, 0.12);
}

.notes-action-btn.secondary {
    background: rgba(0, 0, 0, 0.08);
    color: #333;
}

.notes-action-btn.secondary:hover {
    background: rgba(0, 0, 0, 0.12);
}

[data-theme="dark"] .notes-action-btn.secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #ddd;
}

[data-theme="dark"] .notes-action-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.15);
}

.notes-action-btn.danger {
    background: #ff3b30;
    border-color: rgba(255, 59, 48, 0.8);
    color: #fff;
}

.notes-action-btn.danger:hover {
    background: #d63029;
}

/* List header with action buttons */
.notes-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px 6px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    background: rgba(0, 0, 0, 0.02);
}

[data-theme="dark"] .notes-list-header {
    border-bottom-color: rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.02);
}

.notes-list-header-actions {
    display: flex;
    gap: 6px;
    align-items: center;
}

.notes-sort-select {
    border: 1px solid rgba(0, 0, 0, 0.12);
    background: #ffffff;
    border-radius: 6px;
    height: 22px;
    font-size: 11px;
    color: #333;
    padding: 0 20px 0 8px;
    outline: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='4' viewBox='0 0 8 4'%3E%3Cpath fill='%23666' d='M0 0l4 4 4-4z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 6px center;
}

[data-theme="dark"] .notes-sort-select {
    border-color: rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.06);
    color: #f2f2f4;
}

/* Context menu styling for notes (inline editing) */
.notes-folder-item-input,
.notes-list-item-title-input {
    border: 1px solid #007aff;
    border-radius: 4px;
    padding: 2px 6px;
    font-size: inherit;
    font-family: inherit;
    background: white;
    color: #000;
    outline: none;
    width: 100%;
    box-sizing: border-box;
}

[data-theme="dark"] .notes-folder-item-input,
[data-theme="dark"] .notes-list-item-title-input {
    background: #3c3c3e;
    color: #fff;
    border-color: #0a84ff;
}

/* Notes list header with count and actions */
.notes-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px 6px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    background: rgba(0, 0, 0, 0.02);
}

[data-theme="dark"] .notes-list-header {
    border-bottom-color: rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.02);
}

.notes-list-count {
    font-size: 11px;
    color: #7b7b82;
    font-weight: 600;
}

[data-theme="dark"] .notes-list-count {
    color: #8e8e93;
}

/* Notes list item with actions */
.notes-list-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 10px 14px;
    cursor: pointer;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    transition: background-color 0.15s ease;
}

.notes-list-item-content {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.notes-list-item-actions {
    display: flex;
    gap: 6px;
    opacity: 0;
    transition: opacity 0.15s ease;
    margin-left: 10px;
    flex-shrink: 0;
    align-items: center;
}

.notes-list-item:hover .notes-list-item-actions {
    opacity: 1;
}

.notes-list-item.selected .notes-list-item-actions {
    opacity: 1;
}

.notes-list-section-label {
    padding: 10px 14px 6px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #8e8e93;
}

[data-theme="dark"] .notes-list-section-label {
    color: #a1a1a6;
}

/* Folder sidebar header row */
.notes-sidebar-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px 6px;
}

.notes-sidebar-header-row .notes-sidebar-header {
    padding: 0;
}

.notes-sidebar-header-row .notes-action-btn {
    width: 22px;
    height: 22px;
    font-size: 14px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Folder delete button */
.notes-folder-delete-btn {
    opacity: 0;
    border: none;
    background: transparent;
    color: #999;
    cursor: pointer;
    font-size: 11px;
    padding: 2px 4px;
    margin-left: 4px;
    transition: opacity 0.15s ease;
    flex-shrink: 0;
}

.notes-folder-item:hover .notes-folder-delete-btn {
    opacity: 1;
}

.notes-folder-delete-btn:hover {
    color: #ff3b30;
}

.notes-folder-item.selected .notes-folder-delete-btn {
    color: rgba(31, 31, 34, 0.6);
}

.notes-folder-item.selected .notes-folder-delete-btn:hover {
    color: #1f1f22;
}

[data-theme="dark"] .notes-folder-item.selected .notes-folder-delete-btn {
    color: rgba(242, 242, 244, 0.6);
}

[data-theme="dark"] .notes-folder-item.selected .notes-folder-delete-btn:hover {
    color: #f8f8fa;
}

/* Smaller action buttons for list items */
.notes-list-item-actions .notes-action-btn {
    font-size: 11px;
}

/* ============================================
   Notifications
   ============================================ */

.notification-container {
    position: fixed;
    top: 35px;
    right: 10px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.notification {
    background: rgba(45, 45, 50, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 16px;
    padding: 12px 14px;
    min-width: 320px;
    max-width: 360px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.12),
        0 2px 8px rgba(0, 0, 0, 0.08);
    animation: notification-enter 400ms ease-out forwards;
    pointer-events: auto;
    position: relative;
    transition: transform 300ms ease-out, margin 300ms ease-out, filter 0.15s ease;
}

.notification:hover {
    filter: brightness(1.05);
}

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

@keyframes notification-exit {
    0% {
        opacity: 1;
        transform: translateX(0);
        max-height: 100px;
        padding-top: 12px;
        padding-bottom: 12px;
        margin-bottom: 0;
    }
    50% {
        opacity: 0;
        transform: translateX(100%);
        max-height: 100px;
        padding-top: 12px;
        padding-bottom: 12px;
        margin-bottom: 0;
    }
    100% {
        opacity: 0;
        transform: translateX(100%);
        max-height: 0;
        padding-top: 0;
        padding-bottom: 0;
        margin-bottom: -8px; /* Collapse the gap */
    }
}

.notification.exiting {
    animation: notification-exit 400ms ease-in-out forwards;
    pointer-events: none; /* Prevent clicks during exit */
    overflow: hidden;
}

.notification-content {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    flex: 1;
}

.notification-icon {
    flex-shrink: 0;
}

.notification-app-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: linear-gradient(180deg, #5a5a5a 0%, #3a3a3a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.notification-text {
    flex: 1;
    min-width: 0;
}

.notification-title {
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 2px;
    line-height: 1.3;
}

.notification-message {
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
    line-height: 1.4;
}

.notification-dismiss {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.notification:hover .notification-dismiss {
    opacity: 1;
}

.notification-dismiss:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

/* Light theme notifications */
[data-theme="light"] .notification {
    background: rgba(255, 255, 255, 0.8);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.08),
        0 2px 8px rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .notification-app-icon {
    background: linear-gradient(180deg, #e8e8e8 0%, #d0d0d0 100%);
}

[data-theme="light"] .notification-title {
    color: #1d1d1f;
}

[data-theme="light"] .notification-message {
    color: rgba(0, 0, 0, 0.6);
}

[data-theme="light"] .notification-dismiss {
    background: rgba(0, 0, 0, 0.05);
    color: rgba(0, 0, 0, 0.4);
}

[data-theme="light"] .notification-dismiss:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #1d1d1f;
}
