body {
    margin: 0;
    padding: 0;
    background-color: #f0f0f0;
    font-family: 'Helvetica Neue', Arial, sans-serif;
    display: flex;
    height: 100vh;
    overflow: hidden;
}

.sidebar {
    width: 300px;
    background: white;
    padding: 20px;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    gap: 20px;
    z-index: 10;
    flex-shrink: 0;
}

.sidebar h1 {
    font-size: 20px;
    margin-bottom: 10px;
    color: #333;
}

.control-group {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px;
    background: #f9f9f9;
    border-radius: 8px;
}

.control-group label {
    font-size: 14px;
    color: #555;
}

input[type="color"] {
    border: none;
    width: 40px;
    height: 40px;
    cursor: pointer;
    background: none;
}

.save-btn {
    margin-top: auto;
    padding: 15px;
    background: #000;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.2s;
}

.save-btn:hover {
    background: #333;
}

.main-content {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
    background: #e0e0e0;
    overflow: hidden; /* Changed from auto to hidden to handle scaling better */
}

.canvas-wrapper {
    /* Dimensions will be set by JS */
    position: relative;
    box-shadow: 0 0 20px rgba(0,0,0,0.2);
    /* No overflow hidden here, to allow box shadow? 
       Actually artboard has overflow hidden. */
}

#artboard {
    width: 1320px;
    height: 2868px;
    position: relative;
    background: white;
    overflow: hidden;
    transform-origin: top left;
}

.layer {
    position: absolute;
    pointer-events: none;
}

.layer svg {
    width: 100%;
    height: 100%;
    display: block;
}

/* Mobile styles */
@media (max-width: 768px) {
    body {
        flex-direction: column;
        height: 100vh;
    }

    .main-content {
        flex: 1;
        padding: 20px;
        order: 1; /* Canvas on top */
    }

    .sidebar {
        width: 100%;
        height: auto;
        max-height: 40vh; /* Limit height */
        padding: 15px;
        box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
        overflow-y: auto;
        order: 2; /* Controls at bottom */
        flex-shrink: 0;
        box-sizing: border-box; /* Ensure padding is included in width */
    }
    
    .control-group {
        padding: 8px;
    }
    
    .save-btn {
        margin-top: 10px;
        width: 100%;
    }
}
