* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
}

#settings-page {
    min-height: 100vh;
    overflow-y: auto;
}

#coloring-page {
    height: 100vh;
    overflow: hidden;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

.image-item.selected {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.5);
}

.image-item.selected::after {
    content: '';
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    background: #3b82f6;
    border-radius: 50%;
}

.image-item.selected::before {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    top: 10px;
    right: 10px;
    color: white;
    font-size: 12px;
    z-index: 10;
}

.image-preview {
    height: 140px;
}

.color-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
}

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

.color-btn.selected {
    border-color: #1f2937;
    box-shadow: 0 0 0 2px white, 0 0 0 4px #3b82f6;
}

#canvas-wrapper {
    cursor: crosshair;
}

#canvas-wrapper.panning {
    cursor: grab;
}

#canvas-wrapper.panning:active {
    cursor: grabbing;
}

#coloring-canvas {
    display: block;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease;
    transform-origin: center center;
}

.color-bar-row {
    display: flex;
    align-items: center;
    margin-bottom: 6px;
}

.color-bar-label {
    width: 80px;
    font-size: 13px;
    color: #4b5563;
    flex-shrink: 0;
}

.color-bar-track {
    flex: 1;
    height: 18px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
    margin: 0 8px;
}

.color-bar-fill {
    height: 100%;
    transition: width 0.3s ease;
    border-radius: 4px;
}

.color-bar-pct {
    width: 45px;
    font-size: 13px;
    color: #4b5563;
    text-align: right;
    flex-shrink: 0;
}

#results-panel {
    width: 320px;
    min-width: 280px;
    max-width: 400px;
    background: white;
    border-left: 1px solid #e5e7eb;
    overflow: hidden;
}

#results-panel:not(.hidden) {
    display: flex;
    flex-direction: column;
}

@media (max-width: 768px) {
    #results-panel {
        width: 100%;
        max-width: 100%;
        border-left: none;
        border-top: 1px solid #e5e7eb;
        max-height: 40vh;
    }

    #work-area {
        flex-direction: column;
    }
    .color-btn {
        width: 24px;
        height: 24px;
    }
    
    #coloring-canvas {
        max-width: 100%;
        height: auto;
    }
    
    .image-preview {
        height: 120px;
    }
}

@media (max-width: 480px) {
    .image-preview {
        height: 100px;
    }
}
