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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f0f0f0;
    color: #333;
}

.container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

header {
    background-color: #2c3e50;
    color: white;
    padding: 1rem 2rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

header h1 {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

header p {
    font-size: 0.9rem;
    opacity: 0.8;
}

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

/* Tool Panel */
.tool-panel {
    width: 280px;
    background-color: #34495e;
    color: white;
    padding: 1.5rem;
    overflow-y: auto;
    box-shadow: 2px 0 4px rgba(0,0,0,0.1);
}

.tool-panel h2 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    border-bottom: 2px solid #2c3e50;
    padding-bottom: 0.5rem;
}

.tool-section {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #2c3e50;
}

.tool-section:last-child {
    border-bottom: none;
}

.tool-section h3 {
    font-size: 1rem;
    margin-bottom: 0.75rem;
    color: #ecf0f1;
}

.tool-section label {
    display: block;
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
}

.tool-section input[type="number"],
.tool-section input[type="color"],
.tool-section input[type="range"] {
    width: 100%;
    margin-top: 0.25rem;
    padding: 0.4rem;
    border: 1px solid #2c3e50;
    border-radius: 4px;
    background-color: #2c3e50;
    color: white;
}

.tool-section input[type="color"] {
    height: 40px;
    cursor: pointer;
}

.tool-section input[type="range"] {
    padding: 0;
}

.upload-btn {
    display: inline-block;
    background-color: #3498db;
    color: white;
    padding: 0.6rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    text-align: center;
    margin-bottom: 0.5rem;
    transition: background-color 0.3s;
    width: 100%;
}

.upload-btn:hover {
    background-color: #2980b9;
}

.btn {
    background-color: #95a5a6;
    color: white;
    border: none;
    padding: 0.6rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    width: 100%;
    font-size: 0.9rem;
    transition: background-color 0.3s;
    margin-bottom: 0.5rem;
}

.btn:hover {
    background-color: #7f8c8d;
}

.tool-btn {
    background-color: #2c3e50;
    color: white;
    border: 2px solid #34495e;
    padding: 0.6rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    width: 100%;
    font-size: 0.9rem;
    transition: all 0.3s;
    margin-bottom: 0.5rem;
}

.tool-btn:hover {
    background-color: #34495e;
}

.tool-btn.active {
    background-color: #27ae60;
    border-color: #27ae60;
}

.info {
    font-size: 0.85rem;
    color: #bdc3c7;
    margin-top: 0.5rem;
}

/* Canvas Area */
.canvas-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: #ecf0f1;
    padding: 2rem;
    overflow: auto;
}

#canvasWrapper {
    flex: 1;
    position: relative;
    background-color: #1a1a1a;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    overflow: hidden;
}

#mainCanvas {
    display: block;
    width: 100%;
    height: 100%;
    cursor: crosshair;
}

#instructions {
    background-color: #3498db;
    color: white;
    padding: 1rem;
    text-align: center;
    margin-top: 1rem;
    border-radius: 4px;
    font-size: 0.9rem;
}

#opacityValue, #ringWidthValue, #innerOpacityValue, #ringOpacityValue {
    margin-left: 0.5rem;
    color: #ecf0f1;
    font-weight: bold;
}

.ring-width-control {
    background-color: #2c3e50;
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
}

.ring-width-control label {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.ring-width-control input[type="range"] {
    margin-bottom: 0.5rem;
    cursor: pointer;
}

.ring-width-control input[type="number"] {
    width: 100%;
    text-align: center;
    font-size: 0.95rem;
}

.ring-width-control .info {
    font-size: 0.75rem;
    margin-top: 0.5rem;
    margin-bottom: 0;
    text-align: center;
    color: #95a5a6;
}

.input-row {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.25rem;
}

.input-row input[type="number"] {
    flex: 1;
    margin-top: 0;
}

.unit-label {
    font-size: 0.8rem;
    color: #bdc3c7;
    white-space: nowrap;
}

.source-tag {
    display: block;
    font-size: 0.72rem;
    color: #3498db;
    margin-top: 0.15rem;
    min-height: 1em;
}

footer {
    background-color: #2c3e50;
    color: #7f8c8d;
    text-align: center;
    padding: 0.4rem 2rem;
    font-size: 0.75rem;
    flex-shrink: 0;
}

/* Responsive */
@media (max-width: 768px) {
    .main-content {
        flex-direction: column;
    }

    .tool-panel {
        width: 100%;
        max-height: 300px;
    }
}
