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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #1a1a1a;
    color: #fff;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

body.light-bg #canvas-wrapper {
    background: #ffffff;
}

header {
    padding: 12px 20px;
    background: #2a2a2a;
    border-bottom: 1px solid #3a3a3a;
    display: flex;
    align-items: center;
    gap: 16px;
}

h1 {
    font-size: 18px;
    font-weight: 500;
}

.toolbar {
    display: flex;
    gap: 8px;
}

.toolbar-gap {
    width: 16px;
}

button.btn-large {
    font-size: 20px;
    font-weight: bold;
    padding: 4px 14px;
}

button {
    background: #3a3a3a;
    color: #fff;
    border: 1px solid #4a4a4a;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

button:hover {
    background: #4a4a4a;
}

.zoom-info {
    margin-left: auto;
    font-size: 14px;
    color: #888;
}

#canvas-wrapper {
    flex: 1;
    position: relative;
    overflow: hidden;
    background: #1a1a1a;
}

#canvas-container {
    position: absolute;
    inset: 0;
}

#drop-zone {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 100;
}

#drop-zone.active {
    background: rgba(66, 133, 244, 0.1);
    border: 2px dashed #4285f4;
}

#drop-zone.empty {
    pointer-events: auto;
}

.drop-hint {
    text-align: center;
    color: #666;
}

.drop-hint p {
    margin: 8px 0;
}

.drop-hint .icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.heic-loading {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.85);
    padding: 20px 32px;
    border-radius: 8px;
    font-size: 16px;
    z-index: 1000;
}

#file-input {
    display: none;
}

.instructions {
    position: absolute;
    bottom: 20px;
    left: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.7);
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 12px;
    color: #888;
    line-height: 1.4;
    z-index: 100;
    display: flex;
    flex-wrap: wrap;
    gap: 4px 20px;
}

.instructions span {
    white-space: nowrap;
}

.instructions .version {
    margin-left: auto;
    color: #555;
}

.context-menu {
    position: fixed;
    background: #2a2a2a;
    border: 1px solid #4a4a4a;
    border-radius: 4px;
    padding: 4px 0;
    z-index: 1000;
    min-width: 150px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.context-menu-item {
    padding: 8px 16px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.context-menu-item:hover {
    background: #3a3a3a;
}

.context-menu-item .shortcut {
    color: #666;
    font-size: 12px;
    margin-left: 16px;
}

.context-menu-separator {
    height: 1px;
    background: #4a4a4a;
    margin: 4px 0;
}

.context-menu-label {
    padding: 6px 16px;
    font-size: 12px;
    color: #888;
    display: flex;
    justify-content: space-between;
}

.context-menu-item.blend-option {
    padding-left: 24px;
    font-size: 13px;
    position: relative;
}

.context-menu-item.blend-option.active {
    color: #4285f4;
}

.context-menu-item.blend-option.active::before {
    content: '✓';
    position: absolute;
    left: 8px;
}

.progress-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.9);
    padding: 24px 32px;
    border-radius: 8px;
    z-index: 1000;
    min-width: 300px;
    text-align: center;
}

.progress-modal h3 {
    margin: 0 0 16px 0;
    font-size: 16px;
    font-weight: 500;
}

.progress-bar-container {
    background: #3a3a3a;
    border-radius: 4px;
    height: 8px;
    overflow: hidden;
    margin-bottom: 12px;
}

.progress-bar {
    background: #4285f4;
    height: 100%;
    width: 0%;
    transition: width 0.2s ease;
}

.progress-text {
    font-size: 14px;
    color: #888;
}
