/* Custom Title Bar for Tauri */
:root {
    --titlebar-offset: 0px;
}

#tauri-titlebar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 32px;
    background: var(--surface-color);
    display: flex;
    justify-content: center;
    /* Centers the content (icon + title) */
    align-items: center;
    z-index: 99999;
    user-select: none;
    -webkit-user-select: none;
    transform-origin: top left;
    -webkit-app-region: drag;
    /* Make entire bar draggable */
}

/* Wrapper for Icon + Title */
.titlebar-drag-region {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    /* Remove app-region here, handled by parent */
}

.titlebar-icon {
    width: 18px;
    height: 18px;
}

.titlebar-title {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}

.titlebar-controls {
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    display: flex;
    -webkit-app-region: no-drag;
    /* Buttons must be clickable */
}

.titlebar-btn {
    width: 46px;
    height: 100%;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.1s;
}

.titlebar-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.titlebar-close:hover {
    background: #e81123;
    color: white;
}

/* Adjust ALL fixed elements when title bar is visible */
/* Layout handled by JS in ui.js applyUIScale() */