/* Window styles */
.app-window {
    position: absolute;
    background: white;
    border-radius: 8px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    min-width: 600px;
    min-height: 400px;
    width: 600px;
    height: 400px;
    top: 100px;
    left: 100px;
    overflow: hidden;
    resize: both;
    z-index: 1010;
    transition: box-shadow 0.3s ease, border 0.3s ease;
    border: 2px solid transparent;
}

.app-window.active-window {
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(118, 75, 162, 0.4);
}

.app-window.active-window .window-header {
    background: linear-gradient(90deg, #764ba2, #667eea);
}

/* Inactive windows have slightly dimmed headers */
.app-window:not(.active-window) .window-header {
    background: linear-gradient(90deg, #888, #aaa);
    opacity: 0.85;
}

.window-header {
    color: white;
    padding: 8px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: move;
    user-select: none;
    min-height: 40px;
    max-height: 40px;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
    transition: background 0.3s ease, opacity 0.3s ease;
}

/* Only disable pointer events when specifically animating */
.app-window.animating {
    pointer-events: none;
}

.header-left {
    display: flex;
    align-items: center;
    min-width: 80px;
}

.window-header h3 {
    margin: 0;
    font-size: 1.1em;
    font-weight: 500;
}

.header-tabs {
    display: flex;
    align-items: center;
    flex: 1;
    gap: 6px;
    min-width: 0;
    overflow: hidden;
    justify-content: flex-start;
    padding-right: 8px;
    width: 100%;
    max-width: calc(100% - 160px);
}

.tab-list {
    display: flex;
    gap: 4px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    min-width: 0;
    width: auto;
    max-width: calc(100% - 40px);
    flex-shrink: 1;
}

.tab-list::-webkit-scrollbar {
    display: none;
}

.header-right {
    display: flex;
    align-items: center;
    min-width: 80px;
    justify-content: flex-end;
}

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

.window-control-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 4px;
    width: 28px;
    height: 28px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
    padding: 4px;
}

.window-control-btn img {
    width: 16px;
    height: 16px;
    opacity: 0.8;
    filter: brightness(0) invert(1);
}

.window-control-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.window-control-btn:hover img {
    opacity: 1;
}

.minimize-btn:hover {
    background: rgba(255, 193, 7, 0.8);
}

.maximize-btn:hover {
    background: rgba(40, 167, 69, 0.8);
}

.close-btn:hover {
    background: rgba(220, 53, 69, 0.8);
}

.app-window:focus-within {
    z-index: 1100;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
}