:root {
    --primary-color: #2196F3;
    --primary-dark: #1976D2;
    --secondary-color: #757575;
    --background-color: #f5f5f5;
    --surface-color: #ffffff;
    --error-color: #f44336;
    --text-primary: #212121;
    --text-secondary: #757575;
    --border-color: #e0e0e0;
    --toolbar-height: 48px;
    --status-bar-height: 24px;
    --sidebar-width: 300px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    background-color: var(--background-color);
    color: var(--text-primary);
    line-height: 1.6;
}

.editor-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

.toolbar {
    height: var(--toolbar-height);
    background-color: var(--surface-color);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    padding: 0 16px;
    gap: 16px;
}

.toolbar-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.toolbar button {
    background: none;
    border: none;
    padding: 8px;
    border-radius: 4px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.toolbar button:hover {
    background-color: rgba(0, 0, 0, 0.04);
    color: var(--text-primary);
}

.toolbar button.active {
    background-color: var(--primary-color);
    color: white;
}

.toolbar button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.tolerance-control {
    display: flex;
    align-items: center;
    gap: 8px;
}

.tolerance-control label {
    display: flex;
    align-items: center;
    gap: 4px;
}

.main-content {
    flex: 1;
    display: flex;
    overflow: hidden;
}

.image-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 16px;
    overflow: hidden;
    min-height: 0;
}

.original-image,
.modified-image {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.canvas-container {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 200px;
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    overflow: hidden;
}

canvas {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.sidebar {
    width: var(--sidebar-width);
    background-color: var(--surface-color);
    border-left: 1px solid var(--border-color);
    padding: 16px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.panel {
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 16px;
}

.panel h3 {
    margin-bottom: 12px;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
}

.color-swatches {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
    gap: 8px;
}

.color-swatch {
    width: 100%;
    padding-bottom: 100%;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: transform 0.2s ease;
}

.color-swatch:hover {
    transform: scale(1.1);
}

.color-pairs {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.color-pair {
    display: flex;
    align-items: center;
    gap: 8px;
}

.color-input {
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
}

.status-bar {
    height: var(--status-bar-height);
    background-color: var(--surface-color);
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    padding: 0 16px;
    font-size: 12px;
    color: var(--text-secondary);
}

.status-item {
    margin-right: 16px;
}

.drop-zone {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(33, 150, 243, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.drop-zone-content {
    text-align: center;
    color: white;
}

.drop-zone-content i {
    font-size: 48px;
    margin-bottom: 16px;
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    color: white;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.hidden {
    display: none !important;
}

.primary-button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.2s ease;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

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

.primary-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.secondary-button {
    background-color: transparent;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 8px;
}

.secondary-button:hover {
    background-color: rgba(33, 150, 243, 0.04);
}

.secondary-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
} 