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

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    height: 100vh;
    overflow: hidden;
}

#app {
    display: flex;
    height: 100vh;
}

#canvas-container {
    flex: 1;
    position: relative;
    background: #f0f0f0;
}

#cake-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

#controls-panel {
    width: 350px;
    background: rgba(255, 255, 255, 0.95);
    padding: 20px;
    overflow-y: auto;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
}

#controls-panel h2 {
    color: #333;
    margin-bottom: 20px;
    text-align: center;
    font-size: 24px;
}

.control-group {
    margin-bottom: 25px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.control-group h3 {
    color: #495057;
    margin-bottom: 15px;
    font-size: 16px;
}

/* Shape Buttons */
.shape-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Filling Options */
.filling-options {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.filling-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px 10px;
    border: 2px solid #dee2e6;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    min-width: 80px;
}

.filling-btn:hover {
    border-color: #007bff;
    background: #e3f2fd;
}

.filling-btn.active {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

.filling-preview {
    width: 40px;
    height: 20px;
    border-radius: 10px;
    margin-bottom: 8px;
    border: 2px solid rgba(0, 0, 0, 0.1);
}

.filling-preview.vanilla {
    background: linear-gradient(45deg, #FFF8DC, #F5F5DC);
}

.filling-preview.chocolate {
    background: linear-gradient(45deg, #8B4513, #A0522D);
}

.filling-preview.strawberry {
    background: linear-gradient(45deg, #FFB6C1, #FF69B4);
}

.shape-btn {
    padding: 10px 15px;
    border: 2px solid #dee2e6;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.shape-btn:hover {
    border-color: #007bff;
    background: #e3f2fd;
}

.shape-btn.active {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

/* Color Palette */
.color-palette {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 15px;
}

.color-option {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    border: 3px solid transparent;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.color-option:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.color-option.selected {
    border-color: #333;
    transform: scale(1.1);
}

#custom-color {
    width: 100%;
    height: 40px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

/* Text Controls */
.help-text {
    font-size: 12px;
    color: #6c757d;
    margin-bottom: 10px;
    font-style: italic;
}

#cake-text {
    width: 100%;
    padding: 10px;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    margin-bottom: 15px;
    font-size: 14px;
}

/* Decoration Options */
.decoration-options {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.decoration-btn {
    padding: 10px 15px;
    border: 2px solid #dee2e6;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    flex: 1;
    min-width: 80px;
}

.decoration-btn:hover {
    border-color: #007bff;
    background: #e3f2fd;
}

.decoration-btn.active {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

.decoration-controls {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.decoration-controls-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.decoration-controls-row:last-child {
    margin-bottom: 0;
}

.decoration-controls-row label {
    min-width: 60px;
    font-weight: 500;
    color: #495057;
}

.decoration-controls-row input[type="color"] {
    width: 40px;
    height: 30px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.decoration-controls-row input[type="range"] {
    flex: 1;
}

#decoration-size-value {
    min-width: 30px;
    text-align: center;
    font-weight: 500;
}

.text-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.text-controls label {
    min-width: 80px;
    font-weight: 500;
    color: #495057;
}

.text-controls input[type="range"] {
    flex: 1;
}

.text-controls input[type="color"] {
    width: 40px;
    height: 30px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

#text-size-value {
    min-width: 30px;
    text-align: center;
    font-weight: 500;
}

/* File Upload */
#image-upload {
    width: 100%;
    padding: 10px;
    border: 2px dashed #dee2e6;
    border-radius: 6px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

#image-upload:hover {
    border-color: #007bff;
}

#remove-image {
    width: 100%;
    padding: 8px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s ease;
}

#remove-image:hover {
    background: #c82333;
}

#remove-image:disabled {
    background: #6c757d;
    cursor: not-allowed;
}

/* Reset Button */
#reset-cake {
    width: 100%;
    padding: 12px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

#reset-cake:hover {
    background: #5a6268;
}

/* Responsive Design */
@media (max-width: 768px) {
    #app {
        flex-direction: column;
    }
    
    #controls-panel {
        width: 100%;
        height: 40vh;
        order: 2;
    }
    
    #canvas-container {
        height: 60vh;
        order: 1;
    }
}

/* Loading Animation */
.loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #666;
    font-size: 18px;
}

/* Custom Scrollbar */
#controls-panel::-webkit-scrollbar {
    width: 6px;
}

#controls-panel::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

#controls-panel::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

#controls-panel::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}
