body {
    font-family: Arial, sans-serif;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background-color: #f5f5f5;
}

h1 {
    color: #333;
    text-align: center;
}

.container {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.controls {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.control-group {
    flex: 1;
    min-width: 200px;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

input[type="number"], input[type="file"], input[type="text"], button {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    width: 100%;
    box-sizing: border-box;
}

input[type="text"][readonly] {
    background-color: #f8f9fa;
    color: #495057;
    cursor: default;
}

input[type="checkbox"] {
    margin-right: 8px;
}

button {
    background-color: #4CAF50;
    color: white;
    border: none;
    cursor: pointer;
    font-size: 16px;
    margin-top: 5px;
}

button:hover {
    background-color: #45a049;
}

button:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}

.canvas-container {
    position: relative;
    margin: 20px 0;
    border: 1px solid #ddd;
    background-color: #eee;
    overflow: auto;
    max-width: 100%;
}

.canvas-container canvas {
    display: block;
    max-width: 100%;
    height: auto;
}

.slice-info {
    margin-top: 20px;
    padding: 15px;
    background-color: #e8f5e9;
    border-radius: 4px;
    display: none;
}

.slice-info.show {
    display: block;
}

.preview-grid {
    display: flex;
    flex-wrap: nowrap;
    gap: 10px;
    margin-top: 20px;
    overflow-x: auto;
    overflow-y: hidden;
    max-height: 200px;
}

.preview-item {
    flex: 0 0 auto;
    width: 150px;
    border: 1px solid #ddd;
    padding: 8px;
    text-align: center;
}

.preview-item img {
    max-width: 100%;
    height: auto;
    display: block;
    margin-bottom: 5px;
    cursor: pointer;
}

.instructions {
    background-color: #e7f3ff;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
    border-left: 4px solid #2196F3;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.9);
    overflow: auto;
}

.modal-content {
    margin: auto;
    display: block;
    max-width: 90%;
    max-height: 90%;
    margin-top: 5%;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
}

.modal-close:hover {
    color: #bbb;
}