:root {
    --bg-main: #f3f3f3;
    --sidebar-bg: rgba(238, 238, 238, 0.8);
    --card-bg: rgba(255, 255, 255, 0.85);
    --accent-color: #0078d4;
    --accent-hover: #005a9e;
    --text-primary: #1a1a1a;
    --text-secondary: #5e5e5e;
    --border-color: #e0e0e0;
    --bar-default: #0078d4;
    --bar-compare: #d13438;
    --bar-sorted: #107c41;
    --radius-main: 8px;
    --radius-sm: 4px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI Variable Text', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-primary);
    user-select: none;
    height: 100vh;
    overflow: hidden;
}

.uwp-app {
    display: flex;
    flex-direction: column;
    height: 100vh;
    backdrop-filter: blur(30px);
}

/* Titlebar */
.uwp-titlebar {
    height: 36px;
    background: #ffffff;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 12px;
}

.titlebar-left {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
}

.titlebar-controls {
    display: flex;
}

.win-btn {
    width: 40px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: #333;
}

.win-btn.close:hover {
    background-color: #e81123;
    color: white;
}

/* Body Window */
.uwp-body {
    display: flex;
    flex: 1;
    height: calc(100vh - 36px);
}

/* Sidebar */
.uwp-sidebar {
    width: 260px;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    padding: 12px 8px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 14px;
    margin-bottom: 4px;
    color: var(--text-primary);
    transition: background 0.15s ease;
}

.nav-item:hover {
    background: rgba(0, 0, 0, 0.05);
}

.nav-item.active {
    background: rgba(0, 0, 0, 0.08);
    font-weight: 600;
    border-left: 3px solid var(--accent-color);
}

/* Developer & Dana Card */
.dev-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-main);
    padding: 12px;
}

.dev-badge {
    background: var(--accent-color);
    color: white;
    font-size: 9px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 3px;
    letter-spacing: 0.5px;
}

.dev-name {
    font-weight: 700;
    font-size: 14px;
    margin-top: 6px;
}

.dev-sub {
    font-size: 11px;
    color: var(--text-secondary);
}

.uwp-divider {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 8px 0;
}

.donate-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
}

.dana-box {
    background: #f0f6ff;
    border: 1px dashed var(--accent-color);
    padding: 6px 8px;
    border-radius: var(--radius-sm);
    margin-top: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
}

.dana-label {
    font-weight: 800;
    color: #005699;
}

.dana-num {
    font-weight: 700;
    color: #1a1a1a;
}

/* Main Content Area */
.uwp-content {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
}

.page-section {
    display: none;
}

.page-section.active {
    display: block;
}

.page-header h1 {
    font-size: 24px;
    font-weight: 600;
}

.subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

/* Grid & Cards */
.uwp-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.uwp-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-main);
    padding: 16px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
}

.uwp-card h3 {
    font-size: 15px;
    margin-bottom: 12px;
}

.full-card {
    width: 100%;
}

.control-group {
    margin-bottom: 12px;
}

.control-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 4px;
}

.uwp-select {
    width: 100%;
    padding: 8px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: white;
    font-family: inherit;
    font-size: 13px;
}

.uwp-slider {
    width: 100%;
    accent-color: var(--accent-color);
}

.btn-group {
    display: flex;
    gap: 8px;
    margin-top: 16px;
}

.uwp-button {
    flex: 1;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid #c8c8c8;
    background: #fbfbfb;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.uwp-button.primary {
    background: var(--accent-color);
    color: white;
    border: none;
}

.uwp-button.primary:hover {
    background: var(--accent-hover);
}

.uwp-button:hover:not(.primary) {
    background: #f0f0f0;
}

.status-box p {
    font-size: 13px;
    margin-bottom: 6px;
}

.uwp-info-banner {
    background: #eef6ff;
    border-left: 4px solid var(--accent-color);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    margin-top: 12px;
    font-size: 12px;
    color: #004578;
}

/* Canvas Bar Visualizer */
.visualizer-card {
    height: 320px;
    display: flex;
    align-items: flex-end;
}

.array-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 3px;
}

.array-bar {
    flex: 1;
    background-color: var(--bar-default);
    border-radius: 3px 3px 0 0;
    transition: height 0.05s ease, background-color 0.05s ease;
}