:root {
    --bg-color: #f3f4f6;
    --canvas-bg: #ffffff;
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --text-color: #1f2937;
    --border-color: #e5e7eb;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    height: 100vh;
    overflow: hidden;
}

canvas {
    touch-action: none;
}

.app-container {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Toolbar */
.toolbar {
    position: absolute;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(229, 231, 235, 0.5);
    border-radius: 12px;
    padding: 8px 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    z-index: 20;
    width: auto; /* Allow it to shrink to fit content */
    height: auto;
    max-width: calc(100vw - 24px);
}

.logo {
    display: none; /* Hide logo in floating toolbar to save space */
}

.actions {
    display: flex;
    gap: 12px;
    flex-wrap: nowrap;
}

.btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
    white-space: nowrap;
}

.btn > span {
    white-space: nowrap;
}

.btn.primary {
    background-color: var(--primary-color);
    color: white;
}

.btn.primary:hover {
    background-color: var(--primary-hover);
}

.btn.secondary {
    background-color: white;
    border-color: var(--border-color);
    color: var(--text-color);
}

.btn.secondary:hover {
    background-color: #f9fafb;
    border-color: #d1d5db;
}

.btn.secondary.is-enabled {
    color: var(--primary-color);
    border-color: rgba(37, 99, 235, 0.6);
    background-color: rgba(37, 99, 235, 0.08);
}

.btn.secondary.is-enabled:hover {
    background-color: rgba(37, 99, 235, 0.12);
    border-color: rgba(37, 99, 235, 0.9);
}

.btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
}

@media (max-width: 768px) {
    .toolbar {
        gap: 10px;
        padding: 8px 12px;
        top: 12px;
    }

    .actions {
        gap: 10px;
    }

    .toolbar .btn > span {
        display: none;
    }

    .btn {
        padding: 8px 10px;
        gap: 0;
    }

    .instructions {
        gap: 10px;
        padding: 10px 14px;
        font-size: 12px;
    }
}

/* Canvas Area */
.canvas-area {
    flex: 1;
    display: flex;
    flex-direction: column; /* Stack children vertically */
    position: relative;
    overflow: hidden;
    background-color: #ffffff;
}

.canvas-wrapper {
    width: 100%;
    flex: 1; /* Take remaining height */
    display: flex; /* Center the canvas inside the wrapper */
    justify-content: center;
    align-items: center;
    position: relative;
}

.split-demo {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.split-demo img {
    max-width: min(980px, 96%);
    max-height: 90%;
    width: 100%;
    height: auto;
}

body.has-uploaded-image .split-demo {
    display: none;
}

/* Instructions */
.instructions {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-wrap: nowrap;
    gap: 16px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(4px);
    padding: 12px 20px;
    border-radius: 100px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    font-size: 13px;
    color: #4b5563;
    pointer-events: none;
    user-select: none;
    width: max-content;
    max-width: calc(100vw - 24px);
    white-space: nowrap;
}

.instruction-item {
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.key {
    background: #e5e7eb;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 11px;
    color: #374151;
}
