body {
    margin: 0;
    font-family: 'Segoe UI', sans-serif;
    background: #121212;
    color: #fff;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1em 2em;
    background: #1f1f1f;
    border-bottom: 1px solid #333;
}

header h1 {
    margin: 0;
    font-size: 1.5em;
}

nav a {
    color: #ccc;
    margin-left: 20px;
    text-decoration: none;
}

nav a:hover {
    color: #fff;
}

main {
    display: flex;
    height: calc(100vh - 70px);
}

#left-panel {
    width: 300px;
    padding: 1em;
    background: #1e1e1e;
    border-right: 1px solid #333;
    box-sizing: border-box;
}

#right-panel {
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

canvas {
    max-width: 100%;
    max-height: 100%;
    border: 1px solid #333;
    cursor: crosshair;
}

button, input[type=range] {
    width: 100%;
    margin: 10px 0;
    padding: 8px;
    background: #333;
    color: white;
    border: none;
    border-radius: 4px;
    box-sizing: border-box;
}

button:hover {
    background: #444;
}

#color1Display, #color2Display {
    width: 100%;
    height: 30px;
    border: 1px solid #777;
    margin-bottom: 10px;
}

#pixelInfo {
    margin-top: 10px;
    font-size: 0.9em;
    color: #aaa;
}

#magnifier {
    pointer-events: none;
    image-rendering: pixelated;
    border: 2px solid #fff;
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.2);
    position: absolute;
    width: 120px;
    height: 120px;
    z-index: 1000;
    background: #000;
}

.switch-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #fff;
    font-size: 14px;
    margin-bottom: 10px;
}

.switch {
    position: relative;
    display: inline-block;
    width: 46px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #555;
    transition: 0.3s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #0f8;
}

input:checked + .slider:before {
    transform: translateX(22px);
}

#progressContainer {
    width: 100%;
    height: 6px;
    background-color: #222;
    border-radius: 3px;
    overflow: hidden;
    margin: 10px 0;
    display: none; /* Hidden by default */
}

#progressBar {
    height: 100%;
    width: 0%;
    background: linear-gradient(to right, #0f0, #0ff);
    transition: width 0.2s ease;
}

.color-palette {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(20px, 1fr));
    gap: 4px;
    max-height: 150px;
    overflow-y: auto;
    padding: 4px;
    border: 1px solid #333;
    background: #111;
    border-radius: 4px;
}

.color-swatch {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 2px;
    cursor: pointer;
    border: 1px solid #222;
    box-shadow: 0 0 2px #000;
}

h2{
    margin-top: 0;
}

.file-label {
    display: inline-block;
    background-color: #333;
    color: #eee;
    padding: 6px 12px;
    font-size: 13px;
    border-radius: 4px;
    cursor: pointer;
    border: 1px solid #555;
    transition: background-color 0.2s;
    width: 100%;
    text-align: center;
    box-sizing: border-box
}

.file-label:hover {
    background-color: #444;
}

.file-label input[type="file"] {
    display: none;
}

.file-name {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: #aaa;
    word-break: break-all;
}
