.window {
    position: absolute;
    background: var(--window-bg);
    border-radius: var(--window-border-radius);
    box-shadow: var(--window-shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: all 0.3s ease;
    transform-origin: center;
    border-radius: 12px;
}

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

.window-header {
    height: 32px;
    background: var(--window-header);
    display: flex;
    align-items: center;
    padding: 0 12px;
    -webkit-app-region: drag;
    user-select: none;
}

.window-controls {
    display: flex;
    border-radius: 8px;
    gap: 8px;
    filter: grayscale(1) contrast(100) brightness(0.25);
    -webkit-app-region: no-drag;
}

.window-controls:hover {
    filter: none;
}

.window-control {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: none;
    cursor: default;
    position: relative;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: none;
}

.window-control .material-symbols-rounded {
    font-size: 12px;
    color: rgba(0, 0, 0, 0.5);
    opacity: 0;
    font-variation-settings: 'FILL' 0, 'wght' 700, 'GRAD' 200, 'opsz' 20;
    font-display: block;
}

button.window-control:focus-visible {
    outline: 2px solid #808080;
    outline-offset: 2px;
}

.window-controls:hover .window-control .material-symbols-rounded,
.window-control:hover .material-symbols-rounded {
    opacity: 1;
}

.window-control.close {
    background: #ff5f57;
}

.window-control.minimize {
    background: #febc2e;
}

.window-control.maximize {
    background: #28c840;
}

.maximize>span.material-symbols-rounded {
    transform: rotate(90deg);
}

.window.active>.window-header>.window-controls {
    filter: none !important;
}

/* Remove old hover styles since we're using Material Icons now */
.window-control:hover::before {
    display: none;
}

.window-control.close:hover::before,
.window-control.minimize:hover::before,
.window-control.maximize:hover::before {
    display: none;
}

.window-title {
    flex: 1;
    text-align: center;
    color: #808080;
    font-size: 13px;
    font-weight: 500;
    margin: 0 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.window.active .window-title {
    color: var(--text-color, #eee);
}

.window-content {
    flex: 1;
    overflow: auto;
    background: transparent;
    position: relative;
    box-sizing: border-box;
    padding: 0;
}

/* Window Resize Handles */
.window-resize-handle {
    position: absolute;
    background: transparent;
    z-index: 1000;
}

.window-resize-handle.top {
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    cursor: ns-resize;
}

.window-resize-handle.bottom {
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    cursor: ns-resize;
}

.window-resize-handle.left {
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    cursor: ew-resize;
}

.window-resize-handle.right {
    right: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    cursor: ew-resize;
}

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

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

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

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

/* Remove the old resize handle styles */
.window-resize-handle::before {
    display: none;
}

/* Window Animations */
.window {
    animation: windowOpen 0.3s ease-out;
}

.window.minimized {
    display: none;
}

@keyframes windowOpen {
    from {
        transform: scale(0.2);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.no-animation {
    animation: none !important; /* Disable animations */
}

/* Window Content Scrollbar */
.window-content::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.window-content::-webkit-scrollbar-track {
    background: transparent;
}

.window-content::-webkit-scrollbar-thumb {
    background: #d1d1d1;
    border-radius: 4px;
}

.window-content::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Window States */
.window.maximized {
    border-radius: 0;
    transform: none !important;
    width: 100vw !important;
    height: calc(100vh - var(--menubar-height) - var(--dock-height)) !important;
    top: var(--menubar-height) !important;
    left: 0 !important;
}

/* Dock Minimized Windows */
.dock-container {
    display: flex;
    align-items: center;
}

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

.dock-separator {
    width: 1px;
    height: 40px;
    background: rgba(255, 255, 255, 0.3);
    margin: 0 8px;
}

.dock-minimized-windows {
    display: flex;
    align-items: center;
    height: 100%;
    gap: 8px;
    padding: 0;
}

.dock-minimized-windows .dock-item {
    position: relative;
    cursor: pointer;
    transition: all 0.2s ease;
    margin: 0;
    width: auto;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dock-minimized-windows .dock-item:hover {
    transform: scale(1.1) translateY(-5px);
}

.minimized-window-preview {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: transparent;
    width: 100%;
    height: 100%;
}

.minimized-window-preview .preview-window {
    position: absolute;
    transform-origin: top left;
    pointer-events: none;
    border-radius: var(--window-border-radius);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    width: auto;
    height: auto;
}

/* Update window transitions */
.window {
    transition: transform 0.3s ease, opacity 0.3s ease;
}

/* Remove the old minimized class styles */
.window.minimized {
    display: none;
}

/* Menu Dropdown Styles */
.menu-dropdown {
    position: absolute;
    background: var(--window-bg);
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    min-width: 200px;
    z-index: 10000;
    padding: 4px 0;
}

.menu-dropdown .menu-item {
    padding: 4px 12px;
    font-size: 12px;
    height: 24px;
    display: flex;
    align-items: center;
    cursor: default;
    position: relative;
    color: var(--text-color);
}

.menu-dropdown .menu-item:not(.disabled):hover {
    background: var(--accent-color);
}

.menu-dropdown .menu-item.disabled {
    opacity: 0.5;
    cursor: default;
}

.menu-dropdown .menu-item.disabled:hover {
    background: none;
}

.menu-dropdown .menu-separator {
    height: 1px;
    background: var(--separator-color, #ffffff80);
    margin: 4px 0;
    opacity: 0.3;
}

.menu-dropdown .menu-shortcut {
    margin-left: auto;
    color: var(--text-secondary);
    font-size: 12px;
    padding-left: 24px;
}

.menu-dropdown .menu-item-label {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.menu-dropdown .submenu-arrow {
    margin-left: 8px;
    color: var(--text-secondary);
}

/* Disable transitions during resize */
.window.resizing {
    transition: none !important;
}

.window.resizing * {
    transition: none !important;
}

/* Debug Grid for Terminal Windows */
.window[data-grid-resize="true"] .window-content {
    background-image: 
        linear-gradient(to right, rgba(255,255,255,0.05) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255,255,255,0.05) 1px, transparent 1px);
    background-size: 8px 17px;
}